From 67706af4802a304e285966447e609331ae2266c3 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Wed, 27 Sep 2023 00:32:27 +0100 Subject: [PATCH] daily-email: fix --- src/content/daily-email/2023-09-22.md | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/content/daily-email/2023-09-22.md b/src/content/daily-email/2023-09-22.md index 61374e551..0af1e4d1c 100644 --- a/src/content/daily-email/2023-09-22.md +++ b/src/content/daily-email/2023-09-22.md @@ -3,8 +3,21 @@ title: > Documentation and comments get stale. Tests don't. pubDate: 2023-09-22 permalink: > - archive/2023/09/22/documentation-and-comments-get-stale--tests-don-t -# tags: -# - a -# - b + archive/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.