oliverdavies.uk/source/_daily_emails/2023-06-26.md

18 lines
932 B
Markdown
Raw Permalink Normal View History

2024-01-03 20:00:00 +00:00
---
title: >
2024-09-08 22:09:54 +00:00
Is any code without tests legacy code?
2024-01-03 20:00:00 +00:00
pubDate: 2023-06-26
permalink: >-
daily/2023/06/26/is-any-code-without-tests-legacy
2024-01-03 20:00:00 +00:00
tags:
2024-09-08 22:09:54 +00:00
- automated-testing
2024-01-03 20:00:00 +00:00
---
While I can't find the original quote, I've heard numerous people describe any code without automated tests as legacy.
Legacy code is typically inherited from other Developers and is riskier to work on and harder to change, as there is no guarantee changing one piece of code won't cause breakages elsewhere in the codebase.
This is true for code that doesn't have accompanying automated tests, regardless of when it was written.
I can release a feature to an environment, and although it may be checked and tested at the time, it likely won't be again for every subsequent release. Automated tests can run automatically for every commit and before every deployment, ensuring the code continues to work and for it to be edited without causing regressions.