Chapter 6. Testing Groovy and Java projects

This chapter covers

  • Using GroovyTestCase and its subclasses
  • Testing scripts as well as classes
  • The MockFor and StubFor classes in the Groovy library
  • The Spock testing framework

The rise of automated testing is one of the most significant software development productivity improvements in the past 20 years. Automated tests, running as part of your build process, are very easy to set up, catch problems right away, and give you the freedom to refactor your code without worrying that you’re breaking something unrelated.

Testing is the cornerstone of many of the “agile” development processes, from more modern techniques like SCRUM to Kanban back to the original Extreme Programming (XP) movement. ...

Get Making Java Groovy 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.