Comment-driven development
| Part of a series on |
| Software development |
|---|
Comment-Driven Development (CDD) is a programming methodology, that emphasizes on explaining first in comments the purpose of the program or program part being developed. Only after the comments state clearly in plain language what the code is supposed to do and why, one begins to write the program code itself.
The purpose of Comment-Driven Development is to enable the current programmer and others, that work on the code later, to get things straight concerning the tasks or problems solved by this program code. It increases the maintainability and unburdens the comprehension of the code. Which is especially important when the software gets older and eventually becomes legacy code.[1] The comments written this way are also a basis for the software documentation. This notably applies to API documentation when the behaviour of non private program objects is described during there development.[2]
Combining it with other programming methodologies like Test-driven development (TDD) or Behaviour-driven Development (BDD) yet increases the clarity and maintainability of the program code. This way the comments describing the still to be implemented program objects facilitate the creation of their Unit tests in the line of TDD and the understanding of the software's expected behaviour.[1]
References
[edit]- ^ a b James Edwards, Comment-Driven Development
- ^ Ralf Holly, Comment-Driven Development
External links
[edit]- James Edwards (2024-02-13). "Comment-Driven Development". SitePoint Pty. Ltd. Retrieved 2025-10-14.
- Muhammad Ibnuh (2021-12-19). "Comment driven development". Muhammad Ibnuh. Retrieved 2025-10-14.
- Ralf Holly (2010-09-28). "Comment-Driven Development". Ralf Holly. Retrieved 2025-10-14.