Methodology > Citing Requirements in Code
Home | Methodology | Résumé |
Make-It-Good Strategy |
Iterative Prototyping |
Greenfield TDD |
Brownfield TDD |
Comprehensive Test Output |
Requirements Citation |
Code documentation is important, but it is sometimes very painful for a variety of reasons. For example: It is not updated as often as the code. It is harder to maintain than the code because it describes how something is achieved in too great a detail. It often describes functionality that is not actually under the control of the code. |
One of the worst problems with code documentation is that it often describes how something is done rather than why. Describing why code exists is easy: Refer to requirements in the code. For example, if a function fulfills a requirement directly then add its requirement number to its header comment. Citing requirements in code facilitates quick solutions to these common problems:
|
Requirement text can also be useful when added to code comments. When you describe a piece of code, that description is very likely to contain a restatement of the requirement text. Some argue that this practice will too-often result in comment-only edits to source code files. This will only happen if your SDLC process permits requirements to be changed mid-project without proper consideration of their impact. It should not happen in an organization that treats requirements changes with proper reverence. Requirements should only be cited in code that directly implements them, and any change to a requirement should impact that code, so comment-only edits to source code files should be a rarity. |
Home | Methodology | Résumé |
Copyright © 2021-2024 Spalted Software LLC