From f0c4d172f37d08c4d1ca5e640385dba21136032b Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Fri, 22 Sep 2023 08:29:52 +0100 Subject: [PATCH] daily-email: add 2023-09-18 Increasing test coverage with regression tests --- src/content/daily-email/2023-09-18.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/content/daily-email/2023-09-18.md diff --git a/src/content/daily-email/2023-09-18.md b/src/content/daily-email/2023-09-18.md new file mode 100644 index 00000000..979c7f4e --- /dev/null +++ b/src/content/daily-email/2023-09-18.md @@ -0,0 +1,27 @@ +--- +title: > + Increasing test coverage with regression tests +pubDate: 2023-09-18 +permalink: > + archive/2023/09/18/increasing-test-coverage-with-regression-tests +tags: + - software-development + - automated-testing + - test-driven-development +--- + +Automated test suites don't tell you everything works - they tell you what you've tested isn't broken. + +Having tests doesn't mean your code is bug-free. There could be edge cases or scenarios you haven't tested for that contain bugs, even though your test suite is passing. + +## What do we do? + +When you find a bug, try replicating it within an automated test before attempting to fix it. + +Once you have a failing test and can replicate the issue, go ahead and fix it. + +If the test passes, you know you've fixed the bug and solved the issue. + +## Here's the thing + +Now you have this test, you cannot re-add the bug again without the test failing. You've prevented anyone from accidentally re-introducing it in the future and increased your test coverage.