The Behaviour Specification Handbook

The Behaviour Specification Handbook

Overview

As a long-time advocate of Behaviour-Driven Development (BDD) and having been a technical lead and coach of BDD enterprise software development teams since 2010, I have tried many different variations of the process of BDD and the writing and implementation of Behaviour Specifications.

This handbook is my suggested practical, prescriptive methodology for writing Behaviour Specifications (also known as ‘scenarios’ in the Gherkin language), including tips and suggestions that have repeatedly proven to me to be worthwhile practices in both small and large-scale solutions.

I hope they help you and your team to write better Behaviour Specifications and deliver successful solutions!

Table of Contents

Chapter 1: Background

  1. Behaviour-Driven Development (BDD) Overview
  2. Scaling BDD To Large Solutions
  3. What Is A Software Component?

Chapter 2: Behaviour Specifications

  1. What Are Behaviour Specifications?
  2. No Other Test Cases Are Necessary!
  3. Developers: No Other Automated Tests!
  4. Overview of The Gherkin Language
  5. Thoughts On Gauge
  6. Feature Files
  7. Feature Names
  8. What Is A Behaviour Specification Description?

Chapter 3: The Behaviour Specification Writing Process

  1. Prerequisites
  2. The Behaviour Specification Writing Meeting
  3. Meeting Milestone 1 — Background Context and Requirements Overview
  4. Meeting Milestone 2 — Technical Design Overview
  5. Meeting Milestone 3 — Checkpoint
  6. What’s Happening In Our Minds?
  7. Meeting Milestone 4 — Behaviour Identification
  8. Meeting Milestone 5 — Step Writing
  9. Meeting Milestone 6 — Determine Test Types
  10. About End-To-End Behaviours
  11. About Outsourcing Delivery

Chapter 4: General Tips

  1. The Software Component Context Is King
  2. Avoid Specifying Internal Technical Implementation Details
  3. Specify Relevant Business Capabilities
  4. Specify Component Interaction Behaviours
  5. Write One Specification For One Behaviour
  6. Use Present Tense
  7. Avoid Generic Verbs
  8. Write In Everyday Business Language
  9. SpecFlow/Cucumber Is Only The Name Of A Tool
  10. Have Different Feature Files For Different User Interfaces

Chapter 5: Effective Behaviour Specification Descriptions

  1. Start With Should
  2. Indicate Positive or Negative Behaviour
  3. Indicate Primary or Secondary Behaviour
  4. Unique Within Their Feature File
  5. Unique Without Their Feature File
  6. Follow This Template

Chapter 6: Effective Behaviour Specification Steps

  1. Work Backwards: Then-When-Given
  2. Avoid “I”
  3. Terminology Guidelines
  4. Reuse Steps, If Possible
  5. Understand Technical Tool Constraints
  6. Single When
  7. Guidelines For Examples and Data Tables

Chapter 7: The Implementation Process

  1. Behaviour Specifications Before Implementation
  2. The Roles of Developers and Test Analysts
  3. Identify Which Developers Will Code Each Behaviour
  4. Identify Who Will Code The Automation Or Manually Perform Each Test
  5. Code!
  6. Separate Implementation of Unit Test Steps From Integration Test Steps
  7. Review Test Outputs
Please leave below any comments, feedback or suggestions, or alternatively contact me on a social network.

comments powered by Disqus