volume_mute
TDD and Debugging Simplification
publish date: 2026/06/18 05:45:6.377829 UTC
volume_mute
TDD simplifies debugging. When a test fails during TDD development, why is it easier to locate the defect than in traditional test-after-code approaches?
Correct Answer
The defect must be in the new code just written, since all previous tests were passing before this increment was added
Explanation
TDD simplifies debugging because when a test fails, the defect must be in the newly written code since all previous tests were passing. The scope of the search is narrowed to the most recent increment. In traditional development, a failing test could be caused by defects anywhere in a large codebase accumulated since the last test run.
Reference
Software Engineering, Ian Sommerville, 10th edition
