All lessons in Software Engineering: Programs, Systems, and Maintainable Software
Unit, Integration, and State-Based Testing
Select test boundaries and assertions that expose faults in deterministic program behavior.
40 minutes · Members lesson · preview
What you will learn
- Choose unit and integration boundaries according to the failure being investigated.
- Derive test cases from partitions, boundaries, and state transitions.
- Explain why execution coverage does not establish assertion quality.
A borrowing test calls the service and checks that no exception occurred. The service returns success, but it inserts two rows and assigns one to the wrong member. The test passed because it did not observe the required behavior. Test quality depends on the question and the assertions, not merely on how much code executed.
Deterministic program tests should make their setup and expected outcomes explicit. Control dates, identifiers, and fixtures so a failure can be reproduced without guessing what happened in the environment.