7.1. Unit tests vs. integration tests vs. functional tests
Let’s start with a brief review of the types of tests useful to an enterprise application. This knowledge isn’t specific to Spock, so if you already know the theory,[1] feel free to skip ahead to the Spock implementation.
For more information, see Test Driven by Lasse Koskela (Manning, 2007).
Each time you want to create a new unit test, you have to decide on its scope. An automated test can focus on a single class, multiple classes, a single module, or even the whole system. The breadth of the tested area will affect several factors of your unit test, from the time it takes to complete (the more you’re trying to test, the bigger the unit test execution) to the readability and ...
Get Java Testing with Spock now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.