Behavior-Driven Development with Cucumber: Better Collaboration for Better Software

Book Description

Master BDD to deliver higher-value software more quickly

To develop high-value products quickly, software development teams need better ways to collaborate. Agile methods like Scrum and Kanban are helpful, but they're not enough. Teams need better ways to work inside each sprint or work item. Behavior-driven development (BDD) adds just enough structure for product experts, testers, and developers to collaborate more effectively.

Drawing on extensive experience helping teams adopt BDD, Richard Lawrence and Paul Rayner show how to explore changes in system behavior with examples through conversations, how to capture your examples in expressive language, and how to flow the results into effective automated testing with Cucumber. Where most BDD resources focus on test automation, this guide goes deep into how BDD changes team collaboration and what that collaboration looks like day to day. Concrete examples and practical advice will prepare you to succeed with BDD, whatever your context or role.

· Learn how to collaborate better by using concrete examples of system behavior

· Identify your project's meaningful increment of value so you're always working on something important

· Begin experimenting with BDD slowly and at low risk

· Move smoothly from informal examples to automated tests in Cucumber

· Use BDD to deliver more frequently with greater visibility

· Make Cucumber scenarios more expressive to ensure you're building the right thing

· Grow a Cucumber suite that acts as high-value living documentation

· Sustainably work with complex scenario data

· Get beyond the "mini-waterfalls" that often arise on Scrum teams

Table of Contents

  1. Cover Page
  2. About This eBook
  3. Halftitle Page
  4. Title Page
  5. Copyright Page
  6. Contents
  7. Acknowledgments
  8. About the Authors
  9. Chapter 1: Focusing on Value
    1. When Scrum Isn’t Enough
    2. Finding a High-Value Feature to Start With
    3. Before You Start with Cucumber
      1. Finding the First MMF
      2. Slicing an MMF into User Stories
    4. Summary
    5. Reference
  10. Chapter 2: Exploring with Examples
    1. BDD Is a Cooperative Game
      1. BDD Is a Whole Team Thing
      2. Allow Time and Space to Learn
      3. Flesh Out the Happy Path First
      4. Use Real Examples
      5. Example Mapping Gives the Discussion Structure
      6. Optimizing for Discovery
    2. Addressing Some Concerns
      1. Treat Resistance as a Resource
    3. Playing the BDD Game
      1. Opening
      2. Exploring
      3. Closing
    4. Summary
    5. References
  11. Chapter 3: Formalizing Examples into Scenarios
    1. Moving from Examples to Scenarios
      1. Feature Files as Collaboration Points
      2. BDD Is Iterative, Not Linear
      3. Finding the Meaningful Variations
      4. Gherkin: A Language for Expressive Scenarios
    2. Summary
    3. Resources
  12. Chapter 4: Automating Examples
    1. The Test Automation Stack
    2. Adjusting to Working Test-First
    3. Annotating Element Names in Mockups
    4. How Does User Experience Design Fit In to This?
    5. Did They Really Just Hard Code Those Results?
    6. Anatomy of a Step Definition
    7. Simple Cucumber Expressions
    8. Regular Expressions
      1. Anchors
      2. Wildcards and Quantifiers
      3. Capturing and Not Capturing
      4. Just Enough
    9. Custom Cucumber Expressions Parameter Types
    10. Beyond Ruby
    11. Slow Is Normal (at First)
    12. Choose Cucumber Based on Audience, Not Scope
    13. Summary
  13. Chapter 5: Frequent Delivery and Visibility
    1. How BDD Changes the Tester’s Role
    2. Exploratory Testing
    3. BDD and Automated Builds
    4. Faster Stakeholder Feedback
    5. How Getting to Done More Often Changes All Sorts of Things
    6. Frequent Visibility and Legacy Systems
    7. Documentation: Integrated and Living
    8. Avoiding Mini-Waterfalls and Making the Change Stick
    9. Summary
    10. References
  14. Chapter 6: Making Scenarios More Expressive
    1. Feedback About Scenarios
    2. How to Make Your Scenarios More Expressive
      1. Finding the Right Level of Abstraction
      2. Including the Appropriate Details
      3. Expressive Language in the Steps
      4. Refactoring Scenarios
      5. Good Scenario Titles
    3. Summary
    4. References
  15. Chapter 7: Growing Living Documentation
    1. What Is Living Documentation and Why Is It Better?
    2. Cucumber Features and Other Documentation
    3. Avoid Gherkin in User Story Descriptions
    4. The Unexpected Relationship Between Cucumber Features and User Stories
      1. Stable Scenarios
    5. Growing and Splitting Features
      1. Split When Backgrounds Diverge
      2. Split When a New Domain Concept Emerges
    6. Secondary Organization Using Tags
    7. Structure Is Emergent
    8. Summary
  16. Chapter 8: Succeeding with Scenario Data
    1. Characteristics of Good Scenarios
      1. Independent
      2. Repeatable
      3. Researchable
      4. Realistic
      5. Robust
      6. Maintainable
      7. Fast
    2. Sharing Data
      1. When to Share Data
      2. Raising the Level of Abstraction with Data Personas
    3. Data Cleanup
    4. Summary
    5. Reference
  17. Chapter 9: Conclusion
  18. Index
  19. Code Snippets

Product Information

  • Title: Behavior-Driven Development with Cucumber: Better Collaboration for Better Software
  • Author(s): Richard Lawrence, Paul Rayner
  • Release date: June 2019
  • Publisher(s): Addison-Wesley Professional
  • ISBN: 9780132748544