From 223daa2ee95797f7dd810155b7e5ed7279171854 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sun, 8 Oct 2023 11:13:30 +0100 Subject: [PATCH] daily-email: add 2023-10-04 The best solution is the one that gets the tests to pass --- src/content/daily-email/2023-10-04.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/content/daily-email/2023-10-04.md diff --git a/src/content/daily-email/2023-10-04.md b/src/content/daily-email/2023-10-04.md new file mode 100644 index 000000000..8fb1b3de3 --- /dev/null +++ b/src/content/daily-email/2023-10-04.md @@ -0,0 +1,21 @@ +--- +title: > + The best solution is the one that gets the tests to pass +pubDate: 2023-10-04 +permalink: > + archive/2023/10/04/the-best-solution-is-the-one-that-gets-the-tests-to-pass +tags: + - software-development + - automated-testing + - test-driven-development +--- + +As I said yesterday, there is no perfect solution or approach for every situation. + +However, when doing test-driven development, there is a best solution. + +The simplest thing that gets a failing test to pass. + +Whether it's hard-coding a return value or putting the initial logic in a Controller, that's the objective. + +Once the test is passing, you can refactor the code or continue writing tests, which will each have their own best solution.