BDD & TDD / Scenario

The Feature File Autopsy

A checkout feature written as a click-script: XPath in the steps, three behaviors in one scenario, and a Then nobody can observe. Tear it down properly.

Difficulty
Medium
Format
Scenario
Points
150
Estimate
13 min

// MISSION BRIEF

Your Mission

A contractor left behind a "BDD suite". The business can't read it, and every UI tweak breaks half the steps. Read the feature file and make the calls a reviewer would have to make.

Scoring: weighted decisions; the core diagnosis counts double.

// FIRST CONTACT

Battle teaser

First artifact

checkout.feature

The fundamental problem with this feature file:

  1. AThe credit card number should come from a data table
  2. BIt is missing tags and a Background section
  3. CIt uses XPath where CSS selectors would be faster
  4. DThe steps script UI mechanics instead of expressing behavior, so every markup change breaks scenarios and no business rule is visible
Answers, scoring, hints, and the full battle stay sealed.

// SKILL TAGS

bddgherkinanti-patternstest-design