Summary
You ended up with four sleek, refactored tests. A developer can understand the goal of each test through its name, which provides a generalized summary of behavior. They can see how that behavior plays out by reading the example within the test. Arrange—Act—Assert (AAA) guides them immediately to the act step so that they can see how the code being verified gets executed. They can reconcile the asserts against the test name’s description of behavior. Finally, if needed, they can review the arrange step to understand how it puts the system in the proper state to be tested.
The tests are scannable. A developer can rapidly find and digest each test element (name, arrange, act, and assert) they’re interested in. The needed comprehension ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access