Correctness Rules (BC001–BC010)¶
Rules that detect definitively wrong structures causing runtime errors or test failures.
Default severity: ERROR
BC001: duplicate-scenario-names¶
Detects scenarios (including scenario outlines) that share the same name within a single feature file. Duplicate names cause ambiguity in test execution and reporting.
Tags: scenarios, naming
Since: 0.5.0
Example¶
Before → After
Before:
After:
BC002: empty-feature¶
Detects feature files that contain no scenarios or scenario outlines. An empty feature file may indicate an incomplete or abandoned feature.
Tags: feature, completeness
Since: 0.5.0
Example¶
Before → After
Before:
After:
BC003: scenario-outline-without-examples¶
Detects Scenario Outlines that lack at least one Examples table. A Scenario Outline without Examples cannot execute.
Tags: scenario-outline, examples
Since: 0.5.0
Example¶
Before → After
Before:
Feature: Login
Scenario Outline: Successful login
Given a user with username <username>
When I log in
Then I see the dashboard
After:
BC004: invalid-tag-syntax¶
Detects tags that do not follow the valid syntax: @ followed by
alphanumeric characters and underscores.
Tags: tags, syntax
Since: 0.5.0
Auto-fix: Safe — replaces invalid characters with _.
Example¶
BC005: duplicate-feature-names¶
Detects feature files that share the same feature name. Duplicate feature names cause confusion in test reports.
Tags: feature, naming, cross-file
Scope: Cross-file
Since: 0.5.0
Example¶
Before → After
Before (features/login.feature):
Before (features/signup.feature):
After (features/login.feature):
After (features/signup.feature):
BC006: invalid-example-table¶
Detects Examples tables with empty headers, no data rows, or mismatched column counts between headers and data rows.
Tags: examples, table, syntax
Since: 0.5.0
Example¶
Before → After
Before:
Scenario Outline: Login
Given a user with <username> and <password>
Examples:
| username | password |
| alice |
| bob | secret | extra |
After:
BC007: empty-scenario¶
Detects scenarios that contain no steps. An empty scenario provides no test coverage and may indicate an incomplete or placeholder scenario.
Tags: scenarios, completeness
Since: 1.2.0
Example¶
Before → After
Before:
After:
BC008: unused-outline-placeholder¶
Detects columns in Examples tables that are never referenced via
<param> placeholders in the scenario outline steps. Unused columns
add noise to the data.
Tags: scenario-outline, examples, placeholders
Since: 1.2.0
BC009: undefined-outline-placeholder¶
Detects <param> placeholders in scenario outline steps that are not
defined in any Examples table header. Undefined placeholders cause
runtime errors in behave.
Tags: scenario-outline, examples, placeholders
Since: 1.2.0
BC010: duplicate-examples-name¶
Detects Examples blocks that share the same name within a single scenario outline. Duplicate names cause confusion in test reports.
Tags: examples, naming, scenario-outline
Since: 1.2.0