Chapter 2 - Program Correctness and Efficiency Flashcards
Bug
Software defect
Types of errors (3)
- Syntax error
- Run-time error
- Logic error
Syntax errors
Mistakes using the grammar style, c++ compiler will detect most syntax errors in compilation
Run-time error
Occur during program execution when the compiler detects an operation that it knows to be incorrect, most halt the program, ex: division by zero, array out of bounds, null pointer reference
Logic error
Occurs when the programmer or analyst makes a mistake in the design of a class, makes a mistake in the design of a class function, or implemented algorithm incorrectly, the code will compile and run but will not meet the requirements
Exception handling
Try {
}
Catch () {
}
Structured walkthrough
when a designer explains the algorithm or program to other team members and simulates its execution with other team members looking on
Levels of testing (4)
- Unit testing
- Integration testing
- System testing
- Acceptance testing
Unit testing
The smallest testable piece of software, a function or class