Create BDD specifications

ALM Octane lets you create BDD (Behavior-driven development) specifications and scenarios. This topic describes how to create BDD specs. You then create and run scenarios as described in Create and run BDD scenarios.

Overview: Gherkin test and BDD framework

ALM Octane offers you two frameworks for working with BDD: either using Gherkin tests where all scenarios in a test are run each time, or using BDD specifications where you can run each scenario on its own.

A Gherkin test will give you a run result for the whole feature file, while a BDD spec gives a run result per scenario in the feature file. For details on the Gherkin framework, see Plan and run manual and Gherkin tests.

Advantages of the BDD spec framework

The BDD spec framework described in this section offers you greater granularity than Gherkin tests:

  • You can run individual scenarios.

  • You can report on a scenario run level.

  • You can partially automate a specification to only run some of its scenarios.

  • You can link specific scenarios to specific backlog items.

For example, if you have a Gherkin test with 20 scenarios and only 19 of them pass, the test fails. In the BDD framework you can run 20 scenarios separately, and immediately identify a failed scenario.

You can also add specific scenarios to a suite, and do not need to run the full Gherkin test each time.

Mapping the BDD spec framework to Gherkin tests

If you previously worked with Gherkin tests in ValueEdge and ALM Octane, the following table can help you understand where to do various tasks in BDD.

In the Gherkin test framework: In the BDD spec framework:
Versioning, execution, automation, and backlog coverage are at the Gherkin test level.
  • Versioning is at the BDD specification level.

  • Execution, automation, and backlog coverage are at the scenario level.

You can add a Gherkin test to a suite. You can add scenarios to a suite.
Tests can be run manually or automatically. Scenarios can be run manually or automatically.

Back to top

Create a BDD Specification

Use the Backlog module to add BDD specifications and their associated scenarios.

To add a new BDD specification:

  1. In the Backlog module, click + BDD Specification.

  2. Enter the desired values.

  3. Click the customize fields button to show more fields in the Add BDD Specification dialog box.

  4. Click Add & Edit.

  5. In the Script tab, create or edit the scenarios. For details, see Create Gherkin tests.

    1. Click Add Scenario or Add Scenario Outline and edit the scenario scripts. For details, click the Syntax help button or see Gherkin test syntax.

    2. Click Save Version to save the current version of the script. Enter a label and click Save.

    3. Click Versions to view, sort and compare the saved versions of the script.

  6. Open the Details tab to add any other relevant information for the BDD specification, such as owner or linked backlog item.

  7. Click the Save button to save the specification.

  8. Run scenarios as described in Create and run BDD scenarios.

To re-use steps using the auto-complete mechanism:

Available in versions: 16.0.200 and later

You can re-use test steps from a BDD specification, for example to improve consistency across automated testing environments.

  1. Open the BDD specification's Details tab and add the fields Contributes to Auto-Complete and Auto-Complete category.

  2. Define Contributes to Auto-Complete as Yes.

  3. Define the Auto-Complete category according to your testing environment needs (the default is Main).

    The site admin can add categories using Settings > Lists > Auto-Complete categories.

  4. When you create a new test start typing a step, and then type ctrl-space to see a list of related steps available in the spec's category. If there is only one relevant step available, it will be automatically filled in.

    An icon appears next to each test step indicating how many times it has been re-used in the workspace.

    When a step contains parameters, the auto-complete options do not display the exact parameter names, to enable re-use with other parameters.

    Note: Auto-complete supports multiple languages. Tests written in one language will not be provided suggestions from tests written in other languages.

Back to top

Next steps: