24 lines
904 B
Markdown
24 lines
904 B
Markdown
---
|
|
title: >
|
|
Documentation and comments get stale. Tests don't.
|
|
pubDate: 2023-09-22
|
|
permalink: >-
|
|
daily/2023/09/22/documentation-and-comments-get-stale
|
|
tags:
|
|
- software-development
|
|
- automated-testing
|
|
- static-analysis
|
|
---
|
|
|
|
I'm sure you've seen code comments that say the code will do something when, in fact, it does something different.
|
|
|
|
Or documentation that has become outdated and stale and no longer correct.
|
|
|
|
Automated tests and other tools, such as static analysis, are executable documentation, so they can't become stale.
|
|
|
|
If the implementation code changes and no longer matches the tests, the tests will fail, and either the implementation or test can be updated.
|
|
|
|
Then, if you need to refer to the test, as long as it's passing, you know what it shows is still applicable.
|
|
|
|
The same can't be said for markdown files, Confluence pages, Word documents or other static documentation.
|