You are previewing The Cucumber for Java Book.
O'Reilly logo
The Cucumber for Java Book

Book Description

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.

Table of Contents

  1. The Cucumber for Java Book
    1. Copyright
      1. For the Best Reading Experience...
    2. Table of Contents
    3. What Readers Are Saying About The Cucumber for Java Book
    4. Foreword
    5. Acknowledgments
    6. Preface
      1. Who This Book Is For
      2. Why You Should Listen to Us
      3. How This Book Is Organized
      4. What Is Not in This Book
      5. Running the Code Examples
      6. Online Resources
    7. Part 1: Cucumber Fundamentals
      1. Chapter 1: Why Cucumber?
        1. Automated Acceptance Tests
        2. Behaviour-Driven Development
        3. Living Documentation
        4. How Cucumber Works
        5. What We Just Learned
      2. Chapter 2: First Taste
        1. Understanding Our Goal
        2. Creating a Feature
        3. Creating Step Definitions
        4. Implementing Our First Step Definition
        5. Changing Cucumber’s Output
        6. Testing Our Checkout Class
        7. Adding an Assertion
        8. Making It Pass
        9. What We Just Learned
      3. Chapter 3: Gherkin Basics
        1. What’s Gherkin For?
        2. Format and Syntax
        3. Feature
        4. Scenario
        5. Comments
        6. Spoken Languages
        7. What We Just Learned
      4. Chapter 4: Step Definitions: From the Outside
        1. Steps and Step Definitions
        2. Capturing Arguments
        3. Multiple Captures
        4. Flexibility
        5. Returning Results
        6. What We Just Learned
      5. Chapter 5: Expressive Scenarios
        1. Background
        2. Data Tables
        3. Scenario Outline
        4. Too Much Information
        5. Doc Strings
        6. Staying Organized with Tags and Subfolders
        7. What We Just Learned
      6. Chapter 6: Keeping Your Cucumbers Sweet
        1. Feeling the Pain
        2. Working Together
        3. Caring for Your Tests
        4. Stop the Line and Defect Prevention
        5. What We Just Learned
    8. Part 2: A Worked Example
      1. Chapter 7: Step Definitions: On the Inside
        1. Sketching Out the Domain Model
        2. Staying Honest with Transforms
        3. Adding Custom Helper Methods
        4. Organizing the Code
        5. Dependency Injection
        6. What We Just Learned
      2. Chapter 8: Support Code
        1. Fixing the Bug
        2. Bootstrapping the User Interface
        3. Making the Switch
        4. Using Hooks
        5. Getting to Green
        6. What We Just Learned
      3. Chapter 9: Message Queues and Asynchronous Components
        1. Our New Asynchronous Architecture
        2. How to Synchronize
        3. Implementing the New Architecture
        4. Fixing the Flickering Scenario
        5. What We Just Learned
      4. Chapter 10: Databases
        1. Iterative Database Development
        2. Refactoring to Use a Database
        3. Reading and Writing to the Database
        4. Cleaning the Database with Transactions
        5. Cleaning the Database with Truncation
        6. What We Just Learned
      5. Chapter 11: Simplifying Design with Dependency Injection
        1. DI and Cucumber
        2. Improving Our Design Using DI
        3. PicoContainer Is Almost Invisible
        4. Moving to Guice
        5. Spring in Your Steps
        6. CDI with Weld
        7. What We Just Learned
      6. Chapter 12: Working with Web Applications
        1. Selenium WebDriver
        2. Handling Failure
        3. Reusing the Browser
        4. Ajax
        5. What We Just Learned
      7. Chapter 13: Keeping Your Features Fast
        1. Partitioning Features and Scenarios
        2. What Sort of Tests?
        3. Environment-Specific Step Definitions
        4. Changing Step Definitions Using Tags
        5. What We Just Learned
    9. Part 3: More Techniques
      1. Chapter 14: Controlling Cucumber
        1. Cucumber’s Runtime Options
        2. Overriding Cucumber Options
        3. Automating Cucumber
        4. What We Just Learned
      2. Chapter 15: Working with a REST Web Service
        1. Structure Your Step Definitions
        2. Storing Some Fruit
        3. Building a Skeleton Web Server
        4. The Fruits of Our Labor
        5. What We Just Learned
      3. Chapter 16: Working with Legacy Applications
        1. Characterization Tests
        2. Squashing Bugs
        3. Adding New Behavior
        4. Are Your Scenarios Sufficient?
        5. What We Just Learned
    10. Appendix 1: Installing Cucumber
      1. Choosing Your JARs
      2. External Dependencies
      3. Console Colors on Windows
    11. Appendix 2: Cucumber and Other JVM Languages
      1. Groovy
      2. Scala
      3. Clojure
    12. Appendix 3: Bibliography
      1. You May Be Interested In…