You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: chapter_27_hot_lava.asciidoc
+17-3Lines changed: 17 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ and the end of our journey with this To-Do app and its tests.
11
11
Let's recap our test structure so far:
12
12
13
13
* We have a suite of "functional tests" that use Selenium to test that the whole app really works.
14
-
On several occations, the FTs have saved us from shipping broken code,
14
+
On several occasions, the FTs have saved us from shipping broken code,
15
15
whether it was broken CSS, a broken database due to filesystem permissions, or broken email integration.
16
16
17
17
* And we have a suit of "unit tests" that use Django's test client,
@@ -175,6 +175,9 @@ The problem is that these things don't scale linearly.
175
175
The more database tables you have,
176
176
the more relationships between them,
177
177
and that starts to increase geometrically.
178
+
// SEBASTIAN: That holds true as long as relationships number grows with database tables.
179
+
// I would add here or in the section about architecture that keeping project decoupled by having autonomous modules
180
+
// will replace geometrical penalty increase with linear one.
178
181
179
182
So you can see why, over time, these kinds of tests
180
183
are going to fail to meet our desiderata because they're too slow
@@ -313,6 +316,8 @@ Often people use it to mean the same thing as functional tests or end-to-end tes
313
316
But as taught to me by one of the legends of QA at MADE (hi Marta!),
314
317
_any_ kind of test can be an acceptance test,
315
318
if it maps onto one of your acceptance criteria.
319
+
// SEBASTIAN: Great point! I think of acceptance tests as part of second, parallel classification of tests.
320
+
// Unit tests, for example, are about scope of SUT. Acceptance tests are about purpose of testing.
316
321
317
322
The point of an acceptance test is to validate a piece of behaviour
318
323
that's important to the user.
@@ -347,6 +352,10 @@ the use of mocks comes with painful trade-offs.
347
352
* And in the extreme, you can sometimes end up with mocks testing mocks,
348
353
almost entirely disconnected from what the code actually does.
349
354
355
+
// SEBASTIAN: Tight coupling to implementation details is debatable. That happens if one mocks whatever they feel like.
356
+
// If one mocks 'stable interfaces', e.g. Gateways or Service layer of another 'unit'/'module' then it's not coupling to implementation details
357
+
// Perhaps there is some middle-ground here, like Mocks lead us astray to mock whatever stands in our way and skipping this part of building solid abstractions?
358
+
350
359
Ed Jung calls this https://youtu.be/CdKaZ7boiZ4[Mock Hell].
351
360
352
361
This isn't to say that mocks are always bad!
@@ -407,7 +416,7 @@ because "Cosmos" is the opposite of "Chaos", in Greek.
@@ -486,8 +497,11 @@ that it can provide them most of the feedback they need about whether the system
486
497
487
498
Not everywhere is Facebook! But it's a good indication that automated tests
488
499
aren't the be-all and end-all.
500
+
// SEBASTIAN: This could use a mention of "shift-right" and perhaps a link or two in further reading to discover this fascinating world of testing in prod
// SEBASTIAN: In this section, I very much miss any mention about internal project's modularity, such as can be achieved by using 'vertical slices'.
504
+
// Shameless plug: in my book, I devoted a whole chapter to it. From maintainability perspective, it's much more rewarding in the long term than horizontal slicing or decoupling from IO/external world as achieved with P&A/the Clean architecture etc.
491
505
492
506
=== The Hardest Part: Knowing When to Make the Switch
0 commit comments