BDD Best Practices
Rules for BDD suites that stay readable for stakeholders and maintainable for developers.
Search across all documentation pages
Rules for BDD suites that stay readable for stakeholders and maintainable for developers.
{amount:f} not string parsing in step body.features/billing/, features/auth/.@wip excluded until stable.BDD scenarios are stakeholder-readable acceptance specs. Integration tests are developer-focused.
One per capability area. 5-15 scenarios per file.
Dev + product together. Developers own step definitions.
Parameterize steps. Review step inventory monthly; merge duplicates.
Gherkin keywords are English. Step text can use domain language agreed by the team.
Hide version in step definitions. Scenarios stay version-agnostic.
Limited. Performance and security better suited to dedicated tools. BDD for functional behavior.
Copy nearest feature file. Follow naming and step reuse conventions.
Use domain-language steps. UI details hidden in step definition layer (Appium, etc.).
If stakeholders stop reading scenarios and maintenance cost exceeds value, consolidate to pytest.
Stack versions: This page was written for Python 3.14.0, FastAPI 0.115+, Django 5.2, Flask 3.1, Pydantic 2, PyTorch 2.6+, pandas 2.2+, Polars 1.x, ruff 0.9+, and uv 0.6+.
Reviewed by Chris St. John·Last updated Jul 19, 2026