Skip to content

Universal BDR Pseudo-code Standard

This document defines the framework-agnostic language used to describe BDR scenarios and behaviors. It is designed to be readable by humans, LLMs, and easily mapped to any programming language.

Focus: Business intent and outcome.

SCENARIO "Scenario Name"
ACTOR "Role/User Type"
// Setup (optional)
GIVEN Actor.hasCondition(param)
// Execution
DO Actor.businessAction(param)
// Verification
VERIFY Actor.hasState(expectedValue)
SCENARIO "User buys a backpack"
ACTOR "Customer"
GIVEN Customer.isLoggedIn()
DO Customer.addItemToCart("Backpack")
DO Customer.checkout()
VERIFY Customer.hasPurchased("Backpack")

Focus: Orchestrating business flows and steps.

ACTION Actor.businessAction(param)
STEP "Human readable description for reporting"
FLOW ModuleName.atomicAction(param)
FLOW AnotherModule.confirmAction()
ACTION Customer.addItemToCart(name)
STEP "Customer adds {name} to the cart"
FLOW Inventory.selectItem(name)
FLOW Cart.confirmAddition()

Focus: Bridging Domain to technical components.

FLOW ModuleName.atomicAction(param)
STEP "Interacting with technical component"
UI Component.performAction(param)
API Service.sendRequest(data)
DB Repository.saveRecord(entity)
FLOW Cart.confirmAddition()
STEP "Press Add to Cart button"
UI CartPage.addButton.click()
UI CartPage.cartBadge.waitForIncrease()

Focus: Native tool interaction (Playwright, Selenium, etc).

UI Component.performAction(param)
NATIVE tool.click(this.selector)
NATIVE tool.fill(this.selector, param)
API Service.sendRequest(data)
NATIVE httpClient.post(this.endpoint, data)
DB Repository.saveRecord(entity)
NATIVE database.insert(this.table, entity)
UI Component.click()
STEP "Perform native click"
NATIVE tool.click(this.selector)
KeywordLayerDescription
SCENARIO3Starts a test scenario.
ACTOR3Defines the entity performing actions (User, Admin).
GIVEN3Optional setup condition (pre-condition).
DO3Executes a business-level action.
VERIFY3Asserts a condition.
ACTION2Defines a domain-level behavior.
STEP2, 1Marks a block for reporting (Allure step).
FLOW2, 1Calls an atomic interaction.
UI1, 0Points to the UI technical layer.
API1, 0Points to the API technical layer.
DB1, 0Points to the database layer.
NATIVE0Direct call to the underlying tool (Playwright/Selenium).

This pseudo-code standard ensures that BDR specifications remain readable and portable across different technology stacks.