06ProgramCorrectness

06ProgramCorrectness - CMSC 132: Object-Oriented...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
CMSC 132: Object-Oriented Programming II Program Correctness, Exceptions Department of Computer Science University of Maryland, College Park
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Overview Program correctness is determined by the presence / absence of program defects (errors) Issues Types of errors Testing Debugging Exceptions
Background image of page 2
Program Errors – Compile Time Compile-time (syntax) errors Errors in code construction Lexical (typographical), grammatical, types Detected during compilation Usually easy to correct quickly Examples Misspelled keyword Missing or misplaced symbol Incorrect operator for variable type
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Program Errors – Run Time Run-time errors Operations illegal / impossible to execute Detected during program execution But not detectable at compile time Treated as exceptions in Java Example Division by zero Array index out of bounds Using null pointer Illegal format conversion
Background image of page 4
Program Errors – Logic Logic errors Operations leading to incorrect program state May (or may not) lead to run-time errors Problem in design or implementation of algorithm Examples Computing incorrect arithmetic value Ignoring illegal input Hardest error to handle Detect by testing Fix by debugging
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Testing Run program (or part of program) under controlled conditions to verify behavior Detects run-time error if exception thrown Detects logic error if behavior is incorrect Issues Selecting test cases Testing different parts of program Visibility of program code Test coverage
Background image of page 6
Test Coverage Test coverage Whether code is executed by some test case Automatically calculated by submit server For set of tests selected (from link) E.g., student tests, public tests, student+public tests
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/04/2011 for the course CMSC 132 taught by Professor Padua-perez during the Spring '08 term at Maryland.

Page1 / 24

06ProgramCorrectness - CMSC 132: Object-Oriented...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online