From 41db944cdbb14d26c08379bd961aa6189ebca932 Mon Sep 17 00:00:00 2001 From: Jackson Popkin Date: Fri, 2 Oct 2026 16:46:46 -0400 Subject: [PATCH] Fix typo `that`, not `tha t`. --- resources/swe-book/html/ch12.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/swe-book/html/ch12.html b/resources/swe-book/html/ch12.html index 8495fed..8afe806 100644 --- a/resources/swe-book/html/ch12.html +++ b/resources/swe-book/html/ch12.html @@ -751,7 +751,7 @@
Example 12-22. Shared values using helper methods

Shared Setup

-

A related way tha t tests shared code is via setup/initialization logic.  Many test frameworks allow engineers to define methods to execute before each test in a suite is run. Used appropriately, these methods can make tests clearer and more concise by obviating the repetition of tedious and irrelevant initialization logic. Used inappropriately, these methods can harm a test’s completeness by hiding important details in a separate initialization method.

+

A related way that   tests shared code is via setup/initialization logic.  Many test frameworks allow engineers to define methods to execute before each test in a suite is run. Used appropriately, these methods can make tests clearer and more concise by obviating the repetition of tedious and irrelevant initialization logic. Used inappropriately, these methods can harm a test’s completeness by hiding important details in a separate initialization method.

The best use case for setup methods is to construct the object under tests and its collaborators. This is useful when the majority of tests don’t care about the specific arguments used to construct those objects and can let them stay in their default states. The same idea also applies to stubbing return values for test doubles, which is a concept that we explore in more detail in Test Doubles.