7
Tidying up Test Suites
Have you ever felt frustrated when working with your test suites? They can easily become messy and overgrown, unless you’re actively tending to them. In this chapter, we’ll look at some of the ways you can keep your test suites tidy.
The techniques you’ll use to tidy test suites differ from the techniques you’d use in your application code. Application code requires building abstractions and encapsulating details, with deep layers of connecting objects. However, tests benefit from being shallow, with each test statement having a clear effect.
Another way to think of it is that normal program flow can take many different paths through the code, but test suites have just one flow – they are scripts that run from top to ...
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