Java Testing with Spock cover
welcome to this free extract from
an online version of the Manning book.
to read more

About this Book


The central topic of this book is, of course, the Spock testing framework. A secondary theme is the employment of proven test practices and the ability to test all aspects of a Java application. Even though this book is introductory as far as Spock is concerned, there are certain assumptions I have made while writing it. When I think about my ideal reader, I assume that you are a seasoned Java developer. By seasoned I mean that you know your way around Java code and have mastered the basics: you have written JUnit tests and understand their purpose and use, and you want to learn new things and improve your craft.

If you do not fit this description, then there are several books available both for Java and testing in general that you need to read first. Especially for testing I can recommend JUnit in Action, Second Edition by Petar Tahchiev, et al. (Manning 2010), Effective Unit Testing by Lasse Koskela (Manning 2013), and BDD in Action by John Ferguson Smart (Manning 2014).

You may have also used Mockito or a similar framework for your unit tests. While this knowledge is helpful, it is not strictly required to take full advantage of this book as I do introduce these concepts (mocks/stubs/spies) and explain how Spock implements them.


Code conventions and downloads

Author online

About the author