From ecf221868bf5f1e353c8e696a7f13067c110fa59 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Wed, 12 Jul 2023 07:42:25 +0100 Subject: [PATCH] daily-email: add 2023-07-04 Think smaller with TDD --- src/content/daily-email/2023-07-04.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/content/daily-email/2023-07-04.md diff --git a/src/content/daily-email/2023-07-04.md b/src/content/daily-email/2023-07-04.md new file mode 100644 index 000000000..de124a8a3 --- /dev/null +++ b/src/content/daily-email/2023-07-04.md @@ -0,0 +1,24 @@ +--- +title: > + Think smaller with TDD +pubDate: 2023-07-04 +permalink: > + archive/2023/07/04/think-smaller-with-tdd +tags: + - automated-testing + - test-driven-development +--- + +I've recently added several custom search blocks and pages to a client project. + +Each requires a results page, a list of autocomplete suggestions for users to select from, a custom form, and a block to place it on the required pages. + +For each search, I'm first testing the results page, ensuring it exists and contains the correct results before testing the autocomplete results, creating the block and form, and linking everything together. + +## Thinking small + +This could seem like a large and daunting task, but with test-driven development, I can break everything into smaller, more manageable tasks. + +My objective is either to write the next failing test and then get it to pass or to refactor what I've written. + +I can focus on these small steps and make progress towards the end goal, guided by the tests I'm writing, instead of needing to focus always on one large and complex task.