From 58504e0042726281dc1d70b3ca6863cfa3baf5fd Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 17 Oct 2023 00:35:22 +0100 Subject: [PATCH] daily-email: add 2023-10-14 Do you need to write tests for small or short-lived projects? --- src/content/daily-email/2023-10-14.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/content/daily-email/2023-10-14.md diff --git a/src/content/daily-email/2023-10-14.md b/src/content/daily-email/2023-10-14.md new file mode 100644 index 00000000..53d0580b --- /dev/null +++ b/src/content/daily-email/2023-10-14.md @@ -0,0 +1,27 @@ +--- +title: > + Do you need to write tests for small or short-lived projects? +pubDate: 2023-10-14 +permalink: > + archive/2023/10/14/do-you-need-to-write-tests-for-small-or-short-lived-projects +tags: + - software-development + - automated-testing + - test-driven-development +--- + +When does it make sense not to write automated tests? + +Tests prevent regressions in codebases that are changed and updated over time. + +So, if you're working on a short-term project, such as a marketing campaign website that will only be live for a few months, you won't get as much benefit from having tests, especially if you may not even change it once it's live. + +Likewise, tests are useful for projects on which you want to avoid downtime and outages, especially if you sell products via your website or it contains important information. For other websites, such as personal blogs, that are less critical, testing may be less beneficial. + +Also, one of Drupal's key benefits is that you can build websites within the Drupal UI, without needing to write custom code. + +If you're going down this route, there is no custom code to test and a separate tool that checks URLs exist and returns the correct response code would be a better fit. + +If you then need to add any custom code and functionality, you may want to add tests. + +Whilst there are some situations where not writing tests is reasonable, there are more reasons and situations when you should, compared to not.