-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Link: Types of testing
Issue: Conceptual Errors and Misinterpretations of BDD
Overview
The current documentation presents Behavior-Driven Development (BDD) with a generally correct intent but contains conceptual inaccuracies that may lead to misunderstandings in implementation, team expectations, and tooling decisions. Several sections incorrectly conflate BDD with Test-Driven Development (TDD) and misrepresent the role of specifications, test failure, and supporting tools.
Clean, Corrected Summary (Recommended)
Behavior-Driven Development (BDD) is an iterative methodology inspired by TDD that focuses on defining system behavior through shared examples. It emphasizes collaboration between business stakeholders, developers, and testers to ensure a common understanding of requirements.
Development begins by defining specifications in a ubiquitous language, commonly expressed using Gherkin. These specifications describe expected behavior and serve as acceptance criteria. Scenarios may initially fail when automated, guiding development until the behavior is implemented.
BDD scenarios are supported by underlying code and tests, which may include unit, integration, or UI-level automation. Tools such as Cucumber and SpecFlow enable mapping specifications to executable code, often integrating with automation tools like Selenium.
The primary goal of BDD is to prevent misunderstandings and acceptance-level defects by ensuring the right software is built from the start.
In common practice, Selenium is integrated with BDD frameworks to automate browser-based behaviors described in BDD scenarios. In this setup:
BDD frameworks (e.g., JBehave) are responsible for parsing and managing specifications
Step definitions act as the bridge between human-readable scenarios and executable code
Selenium is used as the underlying automation engine to perform browser interactions
Some frameworks and tools frequently used in BDD contexts—such as JBehave, Capybara, or Robot Framework—can leverage Selenium as one of their execution drivers, but they are not built on top of Selenium. Instead, Selenium is an optional dependency that enables UI automation when browser-level validation is required.
Issues and Clarification
- Confusion Between BDD and TDD Mechanics
The documentation suggests that BDD follows the same “failing test → implementation” cycle as TDD, including the creation of failing unit tests after specifications.
Errors/Correction
BDD is not a test-first methodology in the strict TDD sense. While BDD was inspired by TDD, its primary artifact is a behavioral specification, not a unit test. BDD scenarios define what the system should do, not how the code should be implemented.Correct Concept:
BDD is example-driven, not failure-driven. Scenarios may initially fail when automated, but failure is not the goal; shared understanding is. Unit tests are optional supporting artifacts, not the center of the BDD cycle.
- Misrepresentation of Specifications as “Failing by Design.”
Specifications are described as being created with the expectation that they “should fail.”
Errors/Correction
Specifications are behavior descriptions, not tests. Treating them as failing artifacts introduces a testing-centric mindset that undermines BDD’s collaborative purpose.Correct Concept:
Specifications define acceptance criteria and expected behavior. Their value lies in clarity and alignment, not in their execution result. Automation is a secondary step.
- Incorrect Framing of BDD’s Primary Goal
BDD is positioned as a technique to “detect more errors than TDD.”
Errors/Correction
BDD is not optimized for error detection, but for error prevention—specifically, preventing acceptance-level and requirement-level defects.Correct Concept:
BDD reduces rework by ensuring that the right software is built through early alignment between business and technical teams.
- Inaccurate Tooling Relationships
The documentation states that BDD tools are “built on top of Selenium,” listing tools such as JBehave, Capybara, and Robot Framework.
Errors/Correction
BDD frameworks are independent of UI automation tools. Selenium is a browser automation library that may be integrated with BDD frameworks, but it is not their foundation.Correct Concept:
BDD frameworks (Cucumber, SpecFlow, JBehave) focus on specification execution
Automation tools (Selenium) handle technical interaction
Integration is optional and context-dependent
Specific inaccuracies:
- JBehave → BDD framework (not Selenium-based)
- Capybara → DSL for web interaction (Ruby), not BDD per se
- Robot Framework → Keyword-driven framework (can do BDD-like syntax)
- Overgeneralization of Test Coverage in BDD
The documentation implies that BDD cycles continue until “all types of tests are passing.”
Errors/Correction
BDD does not mandate exhaustive test coverage across all test levels. Its scope is behavior validation, not comprehensive test completeness.Correct Concept:
BDD scenarios validate business-critical behavior. Other test types (unit, performance, security) remain complementary and are not governed by BDD cycles.
Enhancement Opportunity
- By clarifying these concepts, the documentation can:
- Help prevent BDD from being interpreted primarily as a UI-driven testing approach
- Set clearer and more realistic expectations around the role of automation and Selenium integration
- Better distinguish responsibilities between business stakeholders, testers, and development roles
- Strengthen collaboration by reinforcing BDD as a behavior- and communication-focused practice rather than a test-centric one
Official or Trusted Sources on BDD Concepts
🔗 Cucumber Documentation — Scenarios as Executable Specifications
The official Cucumber docs describe BDD as collaborative and example-led, where concrete examples are documented and automated to reflect behavior, serving as executable specifications:
https://cucumber.io/docs/bdd/ BDD focuses on shared examples that can be automated as checks against behavior
🔗 Cucumber Official Blog — Understanding BDD & TDD
Explains how BDD uses a ubiquitous language (e.g., Gherkin) and collaboration between developers, testers, and business stakeholders.
https://cucumber.io/blog/bdd/bdd-vs-tdd
🔗 Introducing BDD by Dan North (2006) — this is the original source where Dan North explains the idea of reframing test-first thinking into behavior and collaboration rather than testing mechanics:
https://dannorth.net/blog/introducing-bdd/Showing history and evolution of BDD from TDD
🔗 ISTQB Foundation Level Syllabus (CTFL) — this official syllabus lists BDD as a recognized agile and example-based approach to expressing behavior using simple natural language (like Given/When/Then): https://istqb.org/?download_id=3345 Behavior-Driven Development (BDD) is recognized as expressing desired behavior in natural language.
🔗Agile Alliance — BDD Definition and Collaboration Focus
The Agile Alliance glossary defines BDD as a collaborative approach (refinement of TDD and ATDD) focused on describing behavior in a unified notation accessible to developers, testers, and domain experts:
https://agilealliance.org/glossary/bdd