From 1e3ece300a7db55b41985ac72e3d02fcec86003d Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Mon, 4 Sep 2023 20:57:42 +0100 Subject: [PATCH] daily-email: add 2023-08-30 TDD and Unexpected errors --- src/content/daily-email/2023-08-30.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/content/daily-email/2023-08-30.md diff --git a/src/content/daily-email/2023-08-30.md b/src/content/daily-email/2023-08-30.md new file mode 100644 index 00000000..af2f00cb --- /dev/null +++ b/src/content/daily-email/2023-08-30.md @@ -0,0 +1,22 @@ +--- +title: > + TDD and "Unexpected errors" +pubDate: 2023-08-30 +permalink: > + archive/2023/08/30/tdd-and-unexpected-errors +tags: + - automated-testing + - test-driven-development +--- + +When working on projects, it's common to see messages like "The website encountered an unexpected error. Please try again later.". + +Usually, this is the message shown to the user, whilst a more detailed error message is logged for Developers to diagnose and fix the underlying error. + +The wording "unexpected error" has been intriguing to me, though. When do you expect an error? + +The best example I can think of for an expected error is when doing test-driven development. + +When doing TDD, you want to see an error to start as you start with a failing test. + +Then, you write the code to remove the error and get the test passing.