liveBook · Manning

Entity finder pattern

As explained in Effective Behavior-Driven Development

A pattern that finds entities in existing data that satisfy a scenario’s prerequisites instead of creating them.

The entity finder pattern uses suitable entities already in a data baseline to meet scenario prerequisites, instead of creating those entities. Given step definitions query the baseline for the required entities. section 18.6.2

Use the pattern when setting up application context is complicated or time-consuming. It can help a team get started with an unfamiliar domain, even if the initial solution is imperfect. section 18.6.2

A customer who cancelled an order

A scenario may need a customer who previously cancelled an order. Rather than perform several steps to create that history, search a varied baseline database for a suitable customer. section 18.6.2

How Effective Behavior-Driven Development covers it

How deep it goes
Defines the pattern, explains its use in Given steps, and gives a domain example.
Examples
Uses a customer with a cancelled order and a legacy application's existing test database.
What it assumes
Assumes a baseline database may contain suitable entities and explains finding them instead of creating them.
What you can do after
Evaluate whether baseline data can satisfy scenario prerequisites before building setup that creates entities.
How it connects
Links entity finding to query-based test data management and snapshot baselines.

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.