2. Introduction to Software Testing Flashcards
What does testing check?
Testing checks whether the program implementation agrees with the program specification
Automated vs Manual testing
Automated Testing
- Find bugs more quickly
- No need to write tests
- If software changes, no need to maintain tests
Manual Testing
- Efficient test suite
- Potentially better coverage
Black-box vs White-box testing
Black-box:
- Tester knows nothing about the tested programs
- Can work with code that cannot be modified
- Does not need to analyze or study code
- Code can be in any format (managed binary, obfuscated)
White-box:
- Tester can see the internal details of the program being tested
- Efficient test suite
- Potentially better coverage
What is a pre-condition? What is a post-condition?
A pre-condition is a predicate that is assumed to hold before a function executes.
A post-condition is a predicate that is expected to hold after a function executes, whenever the pre-condition also holds.
What are the types of code coverage?
- Function coverage: which functions were called?
- Statement coverage: which statements were executed?
- Branch coverage: which branches were taken?
- Others include line coverage, condition coverage, basic block coverage, path coverage…
What is mutation analysis?
Test variations (mutants) of the program (e.g., replace x > 0 with x < 0). If the test suite is good, it should report failed tests in the mutants.