About This Title

Pages: 338
Published: February 2015
ISBN: 9781941222294
In Print

Skill Level Meter

The Cucumber for Java Book

Behaviour-Driven Development for Testers and Developers

by Seb Rose, Matt Wynne & Aslak Hellesøy

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.

eBook Formats:

  • PDF for desktop/tablets

  • epub for Apple Books, e-readers

  • mobi for Kindle readers

Get all eBook formats here for $27.95 (USD)

Add to Cart we accept visa, mastercard, amex, discover, paypal


Paperback Formats:

Please support indie bookstores!
Find indie bookstores in the U.S. Find indie bookstores around the world.


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.

The Cucumber for Java Book - Q&A

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.

What You Need

You’ll need any system with an installed JVM 1.6 or later and Maven. The examples in the book work with versions of Cucumber-JVM from 1.1.3 upwards.

Resources

Releases:

  • P1.0 2015/02/11
  • B6.0 2015/01/21
  • B5.0 2014/11/18
  • B4.0 2014/10/20

Contents & Extracts

  • Cucumber-JVM Fundamentals
    • Why Cucumber-JVM?
      • Automated Acceptance Tests
      • Behaviour-Driven Development
      • Living Documentation
      • How Cucumber-JVM Works
      • What We Just Learned
    • First Taste
      • Understanding Our Goal
      • Creating a Feature
      • Creating Step Definitions
      • Implementing Our First Step Definition
      • Changing Formatters
      • Testing Our Checkout Class
      • Adding an Assertion
      • Making It Pass
      • What We Just Learned
    • Gherkin Basics
      • What’s Gherkin For?
      • Format and Syntax
      • Feature
      • Scenario
      • Comments
      • Spoken Languages
      • What We Just Learned
    • Step Definitions: From the Outside
      • Steps and Step Definitions
      • Capturing Arguments
      • Multiple Captures
      • Flexibility
      • Returning Results
      • What We Just Learned
    • Expressive Scenarios
      • Background
      • Data Tables
      • Scenario Outline
      • Too Much Information
      • Doc Strings
      • Staying Organized with Tags and Subfolders
      • What We Just Learned
    • When Cucumbers Go Bad
      • Feeling the Pain
      • Working Together
      • Caring for Your Tests
      • Stop the Line and Defect Prevention
      • What We Just Learned
  • A Worked Example
    • Step Definitions: On the Inside
      • Sketching Out the Domain Model excerpt
      • Staying Honest with Transforms
      • Adding Custom Helper Methods
      • Organizing the Code
      • Dependency Injection
      • What We Just Learned
    • Support Code
      • Fixing the Bug
      • Bootstrapping the User Interface
      • Making the Switch
      • Using Hooks
      • Getting to green
      • What We Just Learned
    • Dealing with Message Queues and Asynchronous Components
      • Our New Asynchronous Architecture
      • How to Synchronize
      • Implementing the New Architecture
      • Fixing the Flickering Scenario
      • What We Just Learned
    • Databases
      • Iterative Database Development
      • Refactoring to Use a Database
      • Reading and Writing to the Database
      • Cleaning the Database with Transactions
      • Cleaning the Database with Truncation
      • What We Just Learned
    • Simplifying Our Design Using Dependency Injection excerpt
      • DI and Cucumber-JVM
      • Improving Our Design Using DI
      • PicoContainer is Almost Invisible
      • Moving to Guice
      • Spring in Your Steps
      • CDI with Weld
      • What We Just Learned
    • Working With Web Applications
      • Selenium WebDriver
      • Handling Failure excerpt
      • Reusing the Browser
      • AJAX
      • What We Just Learned
    • Keeping Your Features Fast
  • More Techniques
    • Controlling Cucumber-JVM
    • Working with a REST web service
    • Working with Legacy Applications

Author

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 from 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.

eBook Formats:

  • PDF for desktop/tablets

  • epub for Apple Books, e-readers

  • mobi for Kindle readers

Get all eBook formats here for $27.95 (USD)

Add to Cart we accept visa, mastercard, amex, discover, paypal


Paperback Formats:

Please support indie bookstores!
Find indie bookstores in the U.S. Find indie bookstores around the world.

Related Titles:

Skill Level Meter

About This Title

Pages: 338
Published: February 2015
ISBN: 9781941222294
Edition: 1
In Print