daily-email: add 2023-09-14
Outside-in or inside-out?
This commit is contained in:
parent
59b82c330f
commit
2543521576
25
src/content/daily-email/2023-09-14.md
Normal file
25
src/content/daily-email/2023-09-14.md
Normal file
|
@ -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
|
Loading…
Reference in a new issue