From 2543521576929b53affe955add69567d920fdfbc Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Wed, 20 Sep 2023 19:04:10 +0100 Subject: [PATCH] daily-email: add 2023-09-14 Outside-in or inside-out? --- src/content/daily-email/2023-09-14.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/content/daily-email/2023-09-14.md diff --git a/src/content/daily-email/2023-09-14.md b/src/content/daily-email/2023-09-14.md new file mode 100644 index 00000000..026c6615 --- /dev/null +++ b/src/content/daily-email/2023-09-14.md @@ -0,0 +1,25 @@ +--- +title: > + Outside-in or inside-out? +pubDate: 2023-09-14 +permalink: > + archive/2023/09/14/outside-in-or-inside-out +tags: + - software-development + - automated-testing + - test-driven-development +--- + +[In yesterday's email][yesterday], I described the different types of tests available in Drupal and how to determine which test I should use. + +I start with functional tests and move to kernel or unit tests when needed, so I usually have more functional tests, some kernel tests and a few unit tests. + +This is the outside-in approach to testing. + +The opposite is inside-out testing when you start with unit tests and have fewer functional tests. + +Tests written outside-in are slower to run as they need to perform tasks like HTTP requests and interact with the database, compared to unit tests, which are fast to run but do reply on mocking dependencies rather than using real services and content. + +Which do you prefer? Reply and let me know. + +[yesterday]: https://www.oliverdavies.uk/archive/2023/09/13/which-type-of-test-should-i-use