Published: February 2015
Teams working on the JVM can now say goodbye forever to misunderstood requirements, tedious manual acceptance tests, and out-of-date documentation. Cucumber—the popular, open-source tool that helps teams communicate more effectively with their customers—now has a Java version, and our bestselling Cucumber Book has been updated to match. The Cucumber for Java Book has the same great advice about how to deliver rock-solid applications collaboratively, but with all code completely rewritten in Java. New chapters cover features unique to the Java version of Cucumber, and reflect insights from the Cucumber team since the original book was published.
Printed in full color.
Until now it’s been difficult for teams developing Java applications to learn how to benefit from Behaviour-Driven Development (BDD). This book changes all that by describing in detail how to use Cucumber to harness the power of plain language specifications in your development process.
In part 1, you’ll discover how to use Cucumber’s Gherkin DSL to describe the behavior your customers want from the system. You’ll also learn how to write Java code that interprets those plain language specifications and checks them against your application. Part 2 guides you through a worked example, using Spring, MySQL, and Jetty. Enhanced chapters teach you how to use Selenium to drive your application and handle asynchronous Ajax calls, and new chapters cover Dependency Injection (DI) and advanced techniques to help keep your test suites fast. Part 3 shows you how to integrate Cucumber with your Continuous Integration (CI) system, work with a REST web service, and even use BDD with legacy applications.
Written by the creator of Cucumber and two of its most experienced users and contributors, The Cucumber for Java Book is an authoritative guide that will give you and your team all the knowledge you need to start using Cucumber with confidence.
What is Cucumber?
Cucumber lets software development teams describe how software should behave in plain text. The text is written in a business-readable domain-specific language and serves as documentation, automated tests, and collaborative development-aid—all rolled into one format.
Who is this book for?
The first part of this book is for the whole team—customer, product owner, business analyst, developer, tester, architect, Scrum master, and anyone else you can think of. The rest of the book focuses on more technical aspects of Cucumber for Java and is suitable mainly for developers and testers.
How will this book help us at work?
Seb, Matt, and Aslak have spent years consulting in a wide variety of organizations. In response, we developed Cucumber to help support the effective ways of working that we had learned. In this book you get the distillation of all that knowledge, along with in-depth advice that will help you be successful at Behaviour-Driven Development (BDD) using Cucumber.
Can’t I learn all this from the online documentation?
The online documentation gives you the bare bones of how Cucumber for Java works. This book has much more. From the invaluable BDD advice in part 1, through the extensive worked example in part 2, to the detailed technical insights in part 3, this book collects everything you need to know in one handy package.
Is the book useful even if my project isn’t written in Java?
Cucumber doesn’t care what language your project is written in. As long as there’s a way to interface with your project from Java, then Cucumber for Java can work for you. If your project is written in Java (or another JVM language), then your Cucumber scenarios can interact directly with the code, which can be very useful. The book also gives a brief introduction to writing your “glue” code in other JVM languages, such as Scala, Groovy, or Clojure.
Is this the same as The Cucumber Book?
The Cucumber for Java Book is based upon the best-selling original, The Cucumber Book. All the examples have been completely rewritten to take advantage of the Java version of Cucumber. There are new chapters that cover Java specific topics, such as Cucumber’s integration with various dependency injection containers, and there’s a brand new chapter on how to keep your Cucumber scenarios running fast as your project grows.
Is Cucumber just another test automation tool?
No it isn’t. Cucumber is a collaboration and documentation tool first. Start by getting your business people to collaborate effectively with your technical teams. Then use Cucumber to document those interactions as described in the book. Finally, automate those interactions using Cucumber to get the full value from your improved development process. Teams that try to use Cucumber only as a test automation tool generally find that it is the wrong tool—because that’s not what it was designed for.
Seb Rose* works as an independent consultant, helping teams adopt and refine their agile practice. He works with Kickstart Academy and is a core developer on the Cucumber-JVM project. Seb tweets as @sebrose and blogs at claysnow
Matt Wynne is a leading BDD practitioner, a member of the Cucumber
core team, and a programmer, coach, trainer, and popular international
speaker. Alongside Aslak Hellesøy and Julien Biezemans, Matt is
co-founder of Cucumber Ltd., the company behind Cucumber. Matt tweets
mattwynne and cucumberbdd.
Aslak Hellesøy is the creator of Cucumber. During his career Aslak
has worked with both small and large organizations in industries such as
telecom, trading, insurance, car manufacturing, education, and
government. Aslak is co-founder of Cucumber Ltd, the company behind
Cucumber. He tweets from
aslak_hellesoy and cucumberbdd.
Published: February 2015