volume_mute
TDD Tests as System Documentation
publish date: 2026/06/18 05:45:6.680758 UTC
volume_mute
How do the tests written in TDD serve as a form of system documentation?
Correct Answer
The tests provide a working description of what the code should do, readable by any programmer familiar with the programming language
Explanation
TDD tests serve as informal but executable documentation. They provide a description of what the code should do that can be read by any programmer familiar with the programming language. Unlike traditional documentation, TDD tests are always up-to-date because they must pass for the system to work - they cannot go out of sync with the implementation.
Reference
Software Engineering, Ian Sommerville, 10th edition
