liveBook · Manning

Abstraction

As explained in BDD in Action, Second Edition

Abstraction is the software design practice of separating an interface or high-level behavior from the details of its implementation.

Abstraction separates stable business behavior from volatile implementation details. In automated acceptance tests, this keeps business rules readable while isolating screen layouts, field names, and library calls that change more often. section 9.3

Apply abstraction as a progression from business intent to implementation:

  • Describe the business task in readable terms—the what—rather than exposing interaction mechanics. section 11.4
  • Decompose high-level goals into smaller tasks, such as locating a registration form, filling it out, and submitting it. section 15.1.1
  • Encapsulate low-level actions behind reusable domain-friendly objects or functions, so implementation changes have limited impact. section 9.3 section 15.2.5

Searching for flights

A scenario can say that a traveler searches using departure, destination, and travel class. An abstraction such as SearchFlights.matchingCriteria(searchCriteria) then coordinates navigation, field entry, selection, clicking, and waiting for results without exposing those mechanics in the scenario.

Figure 9.3 Well-written automated acceptance criteria are organized in three main layers.

Use the three-layer view to navigate from stable acceptance criteria toward lower-level implementation details. section 9.3

How BDD in Action, Second Edition covers it

How deep it goes
Explains layered decomposition and reusable abstractions, stopping short of a general software-design treatment beyond test automation.
Examples
Uses flight-search scenarios, sign-up task decomposition, Page Elements, and Serenity/JS interactions such as Click.on and Text.of.
What you can do after
Build it from scratch by modeling business tasks as reusable layers that keep acceptance scenarios readable and implementations maintainable.
How it connects
Connects abstraction with automated acceptance testing, Page Objects, domain-specific languages, Action classes, and the Screenplay Pattern.

Also explained in

Compare how 15 books explain abstraction →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of BDD in Action, Second Edition. The section links point to the parts of the book it draws on.