liveBook · Manning

Business flow layer

As explained in BDD in Action, Second Edition

A business flow layer is a high-level test-code layer that expresses user tasks and system workflows in business terms while delegating application interactions to lower-level components.

The business flow layer expresses how users achieve business goals through readable, high-level tasks and workflow steps. It describes what the user does, not detailed application implementation. section 9.3.2

A strong business flow layer:

  • Maps each acceptance-test scenario step to one or more business tasks, such as registering for an account or applying for insurance. section 9.3.2
  • Keeps glue code readable by naming actions in business terms instead of exposing clicks, links, fields, or other interface details. section 9.3.2
  • Delegates execution to lower-level tasks and interaction components, which may use web pages, REST APIs, database queries, message queues, or email-testing services. section 9.3.3
  • Changes when the application workflow changes, while core business goals and constraints remain more stable. section 9.3.2

Account registration

A readable step such as “When Jane registers for a new account” can orchestrate navigation, registration-detail entry, and terms-and-conditions confirmation without describing browser clicks. The same pattern supports insurance applications and checks such as confirmation emails or account balances. section 9.3.2 section 9.3.3

@When("{actor} registers for a new account")
public void registersForANewAccount(Actor theTraveler) {
    theTraveler.attemptsTo(
            Navigate.toTheFrequentFlyerRegistrationPage(),
            EnterRegistrationDetails.using(travelerDetails),
            Confirms.termsAndConditions()
    );
}

Shows a business-language step delegating registration to named tasks through the Screenplay pattern. section 9.3.2

How BDD in Action, Second Edition covers it

How deep it goes
Maps scenario steps to business tasks and delegates execution, stopping short of button-level application detail.
Examples
Uses account registration, confirmation email, bonus-point balance, and comprehensive car-insurance quote journeys.
What you can do after
Builds from scratch readable acceptance-test steps that delegate browser, API, database, queue, and email interactions.
How it connects
Connects business rules, user journeys, business tasks, the Screenplay pattern, REST APIs, databases, message queues, and email testing.

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.