StoryQ/Gherkin for Automotive Requirements
Automotive requirements are often written as statements.
For example:
The vehicle shall remain stable during emergency braking.
That sounds precise enough.
But several questions immediately remain.
Under what road conditions?
At what speed?
With what vehicle load?
What does “stable” mean?
What event triggers the requirement?
What observable result proves that the requirement has been satisfied?
ZenOps treats this as a problem of transformation.
A human need must eventually become something that reality can answer.
The chain is:
Human Need → NDD → Requirement → Scenario → Test → Evidence
StoryQ/Gherkin provides a particularly useful bridge between the requirement and the test.
Its simple structure is:
Given → When → Then
The syntax is easy to read, but its implications for automotive engineering are significant.
It turns a static requirement into a description of behavior under defined conditions.
From Human Need to Scenario
Suppose the original human need is:
I need the vehicle to remain controllable when I brake on an icy road.
The Need Definition Document might contain:
Maintain vehicle controllability on low-friction surfaces.
An engineering requirement might refine that into:
The vehicle shall maintain defined directional-control performance during braking under specified low-friction conditions.
StoryQ/Gherkin can then express the intended behavior:
Scenario: Emergency braking on a low-friction surfaceGiven the vehicle is travelling within the specified speed rangeAnd the road surface has the defined low friction conditionWhen the driver applies emergency brakingThen the vehicle shall decelerate within the defined performance limitsAnd directional controllability shall remain within the accepted limits
We now have something much more useful than an isolated sentence.
We have a situation that can eventually be reproduced.
Given Describes Reality Before the Event
Automotive behavior depends heavily on context.
A battery behaves differently at -25°C than at +20°C.
A tire behaves differently on dry asphalt than on ice.
A vehicle behaves differently when fully loaded.
Therefore the Given part of a scenario is extremely important.
Examples might include:
Given the ambient temperature is within the specified cold-test range
or:
Given the battery state of charge is within the defined operating window
or:
Given the vehicle is travelling on a road surface with the specified friction level
The Given statement describes the starting state of the relevant part of reality.
Without it, many automotive requirements are incomplete.
When Defines the Trigger
The When statement defines what happens.
This might be a human action:
When the driver presses the brake pedal
an environmental event:
When the outside temperature falls below the defined threshold
a system event:
When communication with the wheel-speed sensor is lost
or a physical failure:
When the coolant pump stops operating
The trigger provides an explicit transition from one state to another.
This is especially useful in systems containing many sensors, controllers, software states, and actuators.
Then Defines What Must Become True
The Then statement expresses the expected outcome.
For example:
Then the braking system shall enter the defined degraded mode
or:
Then the battery temperature shall remain within the specified safe range
or:
Then a diagnostic event shall be recorded
The strongest Then clauses describe something that can eventually be observed or measured.
This is where the scenario begins connecting directly to evidence.
A Requirement Becomes a Question
This reveals an important ZenOps interpretation.
A StoryQ/Gherkin scenario is essentially a question to the system:
Given this state of reality, when this event happens, will the vehicle produce the expected result?
The test later asks that question.
Reality provides the answer.
The chain becomes:
Requirement ↓Scenario ↓Question to the System ↓Test ↓Result ↓Evidence
This turns requirements into something much more active.
Example: Cold-Weather Start
Suppose the NDD contains:
Provide reliable winter transportation.
One resulting scenario might be:
Scenario: Start vehicle after cold soakGiven the vehicle has remained at the defined cold-soak temperatureAnd the battery is within the permitted state-of-charge rangeWhen the driver requests vehicle startThen the vehicle shall reach the defined ready stateWithin the specified maximum timeAnd no safety-critical fault shall prevent normal operation
This can later be verified using:
- Simulation
- Hardware-in-the-loop testing
- Environmental chamber testing
- Full-vehicle testing
The test technology may change.
The behavioral intent remains the same.
Example: Windshield Defrost
Consider the need:
Maintain driver visibility during winter operation.
A scenario could become:
Scenario: Restore windshield visibility after frostingGiven the vehicle has been exposed to the defined cold conditionAnd the windshield has the specified frost coverageWhen the driver activates the defrost functionThen the defined visibility area shall become clearWithin the specified maximum time
The requirement now has context, trigger, and measurable result.
Example: Battery Overtemperature
Failure behavior is especially important.
Scenario: Battery exceeds normal operating temperatureGiven the battery is operating within the normal temperature rangeWhen the measured battery temperature exceeds the defined thresholdThen the thermal system shall request the required cooling responseAnd battery power shall be limited according to the defined strategyAnd the diagnostic system shall record the event
This scenario crosses several domain objects:
Battery
Temperature Sensor
Battery Controller
Thermal System
Diagnostic System
StoryQ therefore naturally fits the ORIGIN object-and-relation model.
Example: Sensor Failure
Suppose one wheel-speed sensor becomes unavailable.
Scenario: Wheel-speed sensor becomes unavailableGiven all wheel-speed sensor signals are initially validAnd the vehicle is movingWhen one wheel-speed signal becomes unavailableThen the system shall detect the loss of the signalAnd the affected control function shall enter the defined degraded modeAnd the diagnostic system shall record the faultAnd no unsafe control command shall be generated
This is much more useful than simply writing:
The vehicle shall tolerate wheel-speed sensor failure.
The scenario forces us to define what tolerance actually means.
Gherkin Exposes Ambiguity
Consider the requirement:
The driver shall be warned when battery energy is low.
Try to write the scenario.
Immediately questions appear.
What is “low”?
How is available energy calculated?
When exactly should the warning appear?
What happens if temperature temporarily changes the estimated range?
Does the warning disappear again?
The requirement might become:
Scenario: Low usable-energy warningGiven the vehicle is operating normallyAnd usable energy is above the defined warning thresholdWhen usable energy falls below the defined thresholdThen the low-energy warning shall be presented to the driverWithin the specified response time
StoryQ/Gherkin therefore does not merely document requirements.
It helps discover where requirements are incomplete.
One Requirement Can Produce Many Scenarios
Consider:
The vehicle shall charge safely.
One scenario is not enough.
The requirement might generate scenarios for:
- Normal charging
- Cold-weather charging
- High-temperature charging
- Communication failure
- Loss of grid power
- Connector removal
- Battery fault
- Thermal-system failure
- Interrupted charging
- Recovery after interruption
Each scenario explores a different part of the same requirement space.
This creates systematic coverage.
Scenario Outlines Handle Variation
Some behavior must be tested under several conditions.
Gherkin can express this using a scenario outline.
Scenario Outline: Vehicle startup at low temperatureGiven the vehicle has stabilized at <temperature>When the driver requests vehicle startThen the vehicle shall reach the ready stateWithin <maximum_start_time>Examples:| temperature | maximum_start_time || T1 | S1 || T2 | S2 || T3 | S3 |
The precise values can remain controlled engineering parameters.
The behavioral pattern remains readable.
Keep Engineering Parameters Separate
Gherkin should not become a replacement for engineering data.
A poor scenario might contain dozens of values:
VoltageCurrentPressureTemperatureTorqueSpeedTiming
until the behavioral logic disappears.
It is often better to write:
Given the battery is in the defined nominal operating condition
and allow the referenced test or requirement definition to specify the detailed numeric ranges.
StoryQ captures behavior.
Engineering data defines exact limits.
Requirements and Scenarios Are Different Objects
The requirement should still have its own identity.
For example:
REQ-02841Loss of valid wheel-speed information shallbe detected within the defined diagnostic time.
The corresponding scenario might be:
Scenario: Detect missing wheel-speed informationGiven the wheel-speed signal is initially validWhen the signal becomes unavailableThen the system shall detect the missing signalWithin the defined diagnostic time
The relationship can be modeled as:
Requirement verified byScenario
The scenario does not erase the requirement.
It makes the required behavior explicit.
Connect StoryQ to ORIGIN
Because ZenOps already models the vehicle as objects and relations, the scenario can reference the same domain.
For example:
Wheel-Speed Sensor reports toVehicle ControllerVehicle Controller controlsBrake SystemDiagnostic System observes state ofWheel-Speed Sensor
The Gherkin scenario then describes a change propagating through that object network.
This creates consistency between:
domain model
and:
behavior model.
Patterns Can Contain Scenario Templates
The ZenOps Pattern Library can also store reusable StoryQ/Gherkin patterns.
Suppose the engineering pattern is:
Detect → Isolate → Report → Recover
It may carry scenario templates such as:
Scenario: Detect failureGiven the component is operating normallyWhen the defined failure occursThen the system shall detect the failure
followed by:
Scenario: Enter degraded modeGiven the failure has been detectedWhen normal operation can no longer be maintainedThen the system shall enter the defined degraded state
and:
Scenario: Recover after failure condition disappearsGiven the system is in the defined degraded stateWhen the recovery conditions become validThen the system shall recover according to the defined strategy
Now the Pattern Library carries not only architectural knowledge but verification knowledge.
Gherkin Can Generate WBS Work
Once a scenario exists, work becomes visible.
Suppose the scenario says:
When the temperature sensor fails, the thermal system shall enter degraded control.
That may generate work to:
- Implement failure detection
- Implement degraded control
- Create diagnostic reporting
- Create test instrumentation
- Inject the failure
- Verify the response
- Record evidence
The behavioral scenario therefore helps generate the Work Breakdown Structure.
StoryQ and FLEXI
StoryQ also fits naturally with FLEXI micro-sprints.
Instead of assigning:
Work on charging software.
a micro-sprint can say:
Make charging scenario SCN-042 pass.
The work becomes bounded:
Scenario↓Implementation↓Test↓Result↓Evidence
This gives the engineer an explicit target.
StoryQ and Quality Thresholds
Scenarios can also contribute directly to QT.
Suppose the Winter Operation QT requires:
Cold StartWindshield VisibilityTractionBrakingBattery HeatingCharging
Each item may have several StoryQ scenarios.
The evidence hierarchy becomes:
NDD↓Requirement↓Scenario↓Test↓Evidence↓QT
A Quality Threshold PASS is therefore backed by specific behavior that has been demonstrated.
PASS Becomes More Meaningful
Compare:
Winter operation: 90% complete.
with:
Cold Start PASSWindshield Defrost PASSLow-Friction Braking PASSBattery Heating PASSCold Fast Charging FAILSensor Icing UNKNOWN
The second representation gives the team useful engineering knowledge.
StoryQ/Gherkin makes this possible because the expected behavior has been broken into explicit scenarios.
Manufacturing Can Use the Same Approach
StoryQ/Gherkin need not stop at vehicle behavior.
Consider a battery installation process:
Scenario: Install correct battery packGiven the vehicle identity is knownAnd the approved battery pack for the vehicle configuration is availableWhen the battery pack is installedThen the mechanical connections shall satisfy the defined specificationAnd electrical connections shall be verifiedAnd thermal connections shall be verifiedAnd the battery identity shall be associated with the vehicle identity
The same behavioral logic can describe manufacturing.
Supplier Requirements Can Become Scenarios
Suppose a supplier provides a controller.
Instead of only specifying interfaces in prose, a behavioral scenario might state:
Scenario: Recover after communication interruptionGiven the controller is operating normallyWhen communication is interrupted for the defined durationAnd communication is restoredThen the controller shall return to the defined operational stateWithout requiring a complete vehicle restart
The supplier now receives an observable behavioral expectation.
Service Can Use StoryQ Too
Consider component replacement:
Scenario: Replace failed drive moduleGiven diagnostics identify the drive module as faultyWhen an approved replacement module is installedThen the replacement identity shall be recordedAnd the required software configuration shall be appliedAnd the verification procedure shall passAnd the vehicle service history shall be updated
The same conceptual method now spans engineering, manufacturing, and service.
Field Failures Should Become New Scenarios
One of the most valuable uses of StoryQ is regression learning.
Suppose field vehicles reveal a failure nobody anticipated.
The organization investigates.
The cause is understood.
Then a new scenario should often remain behind:
Field Failure↓Root Cause↓Requirement Update↓New Scenario↓Regression Test↓Permanent Organizational Knowledge
A failure should not merely be repaired.
It should teach the engineering system something.
Every Important Bug Can Become Memory
Suppose charging fails only after:
- Cold soak
- Communication interruption
- Recovery attempt
Once discovered, the condition can become:
Scenario: Charging recovers after cold communication interruptionGiven the vehicle is at the defined low temperatureAnd charging is operating normallyWhen the charging communication is interruptedAnd communication is restoredThen charging shall recover according to the defined recovery behavior
Future vehicle versions can rerun this scenario.
The mistake becomes less likely to return.
Scenario Identity Enables Traceability
Each scenario can receive its own identity:
SCN-001 Cold StartSCN-002 Windshield DefrostSCN-003 Sensor FailureSCN-004 Low-Friction Braking
Relations can then connect:
NDD Need ↓Requirement ↓Scenario ↓Test ↓Evidence ↓QT
Now the scenario becomes a first-class object in the ZenOps domain model.
A Shared Language Across Disciplines
Perhaps the greatest advantage of Given/When/Then is its readability.
Automotive programs include:
- Domain experts
- Systems engineers
- Mechanical engineers
- Electronics engineers
- Software developers
- Test engineers
- Manufacturing engineers
- Suppliers
- Product owners
- Project managers
Not everyone can read control software.
Not everyone can interpret a detailed mechanical specification.
But many people can understand:
Given this condition, when this happens, then the vehicle must behave like this.
This creates a common behavioral language across disciplines.
StoryQ Turns Stories Into Questions
StoryQ can be interpreted as a progression:
Story↓Question↓Scenario↓Experiment↓Evidence
A customer says:
I need the car to work reliably in winter.
ZenOps structures that through the NDD.
Engineering produces requirements.
StoryQ asks:
What situation would demonstrate whether the requirement is actually true?
Gherkin expresses the situation.
Testing asks the question physically.
Reality answers.
The Complete ZenOps Chain
The automotive ZenOps flow can now become:
HUMAN REALITY ↓ x ↓ NDD ↓REQUIREMENTS ↓ STORYQ ↓GIVEN / WHEN / THEN ↓ TEST ↓ EVIDENCE ↓ QT ↓ RELEASE
The crucial transformation happens in the middle.
Requirements stop being passive statements.
They become questions that can be asked of the system.
Reality Gets the Final Word
This may be the most important reason for using StoryQ/Gherkin in automotive ZenOps.
A requirement can look convincing on paper.
A design can look correct in CAD.
Software can compile.
Simulation can predict success.
But sooner or later we need to ask:
Given the real conditions the vehicle must face, when the relevant event occurs, does the system actually behave as intended?
StoryQ/Gherkin gives us a disciplined way of writing that question.
Testing provides the experiment.
Evidence provides the answer.
And ZenOps keeps the entire chain connected back to the original human need.
That is the purpose of StoryQ/Gherkin for automotive requirements:
to transform what we hope the vehicle will do into behavior precise enough for reality to confirm or reject.