liveBook · Manning

Automation

As explained in Effective Behavior-Driven Development

Automation is the behavior-driven development practice of making specified scenarios executable so that software behavior can be checked automatically.

Automating a scenario is more than replacing a manual test. In behavior-driven development (BDD), a team first discovers examples of the behavior it needs, turns them into business-readable scenarios, and checks that those scenarios express what stakeholders expect. Automation then adds code that runs the scenarios as tests. section 1.3 section 4.1

For each story, the working sequence is:

  • Formulate and review scenarios before implementation, using business terminology the team and stakeholders understand. section 4.1
  • Automate a scenario first, then write production code to make the failing scenario pass. Continue until the story’s scenarios pass. section 4.8
  • Run the scenarios as the software changes. Passing tests help verify that the documented behavior still matches the implementation; supplementary testing remains necessary. section 1.3 section 4.8

Collaboration matters as much as executable code. Scenarios written by a test team alone can read like manual test scripts rather than shared specifications. Automating them only after implementation also loses their chance to guide development. An automation library built separately from production code can encourage low-level steps such as filling text boxes and clicking buttons, making scenarios slow and brittle. section 1.4.3

Changing existing behavior

Before modifying an area of an existing codebase, a team can recover and document its current behavior. Discovery produces an example map, formulation produces business-readable scenarios, and automation uses those scenarios to guide implementation of the new behavior. section 11.2.1

The result is living documentation: scenarios that people can read and tests that signal when implementation diverges from the behavior they describe. Keeping that value requires attention to code quality, not just a collection of passing tests. section 1.7 section 1.6.4

How Effective Behavior-Driven Development covers it

How deep it goes
Explains the sequence and collaboration behind automation, while stopping short of framework-specific code or step implementations.
Examples
Contrasts brittle text-box and button-click steps with business-readable scenarios, and applies the workflow to changes in an existing codebase.
What it assumes
Assumes collaboratively discovered examples and reviewed, business-readable scenarios before automation begins.
What you can do after
Practice/perform scenario-first development: automate an agreed scenario, implement until it passes, and retain it as a check on documented behavior.
How it connects
Connects discovery and formulation to scenario review, test-driven development, living documentation, and supplementary testing.

Also explained in

Compare how 23 books explain automation →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Effective Behavior-Driven Development. The section links point to the parts of the book it draws on.