TEST-INFRA: [test-data-quality] Improve Test Data Variation in BDD Scenarios #6892

Open
opened 2026-04-10 04:52:32 +00:00 by HAL9000 · 0 comments
Owner

Metadata

  • Branch: task/test-data-quality-bdd-scenario-outlines
  • Commit Message: test(bdd): refactor feature files to use Scenario Outline with Examples tables
  • Milestone: Backlog
  • Parent Epic: #739

Background and Context

Several BDD feature files in the features/ directory use hardcoded data and test a limited range of data variations. This can lead to tests that are less robust and may miss edge cases.

Area: Test Data Quality

Examples of files that could be improved:

  • features/plan_lifecycle_persistence.feature
  • features/resource_handler_crud.feature

Current Behavior

These files use a separate Scenario for each test case, with hardcoded data for things like file names, paths, and content. This makes the tests:

  • Less thorough: They only cover a narrow range of "happy path" scenarios.
  • Harder to maintain: Adding new test cases requires duplicating the entire scenario.
  • Less readable: The intent of the test can be obscured by the boilerplate of the scenario.

Expected Behavior

Feature files should use Scenario Outline with Examples tables to enable data-driven testing. This approach allows for testing a wide range of inputs — including positive and negative test cases, boundary conditions, and different character sets — in a concise and maintainable way.

The features/data_variation_*.feature files are excellent examples of this approach and should be used as a model.

Acceptance Criteria

  • features/plan_lifecycle_persistence.feature is refactored to use Scenario Outline with Examples tables.
  • features/resource_handler_crud.feature is refactored to use Scenario Outline with Examples tables.
  • Other feature files benefiting from a data-driven approach are identified and a refactoring plan is documented.
  • New tests cover a wider range of data variations, including positive and negative test cases, boundary conditions, and different character sets.
  • Refactored feature files are more concise and easier to maintain.
  • All nox stages pass after refactoring.
  • Coverage remains ≥ 97%.

Subtasks

  • Review features/plan_lifecycle_persistence.feature and refactor to use Scenario Outline with Examples tables.
  • Review features/resource_handler_crud.feature and refactor to use Scenario Outline with Examples tables.
  • Identify other feature files that would benefit from a data-driven approach and document a refactoring plan.
  • Ensure Examples tables cover positive cases, negative cases, boundary conditions, and varied character sets.
  • Verify all nox sessions pass after refactoring.
  • Verify coverage remains ≥ 97%.

Definition of Done

  • features/plan_lifecycle_persistence.feature refactored to Scenario Outline + Examples.
  • features/resource_handler_crud.feature refactored to Scenario Outline + Examples.
  • Additional candidate feature files identified and plan documented.
  • New tests cover a wider range of data variations (positive, negative, boundary, character sets).
  • Refactored feature files are more concise and easier to maintain.
  • All nox stages pass.
  • Coverage >= 97%.

Backlog note: This issue was discovered during autonomous operation
on milestone v3.7.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.


Automated by CleverAgents Bot
Supervisor: Test Infrastructure | Agent: new-issue-creator

## Metadata - **Branch**: `task/test-data-quality-bdd-scenario-outlines` - **Commit Message**: `test(bdd): refactor feature files to use Scenario Outline with Examples tables` - **Milestone**: Backlog - **Parent Epic**: #739 ## Background and Context Several BDD feature files in the `features/` directory use hardcoded data and test a limited range of data variations. This can lead to tests that are less robust and may miss edge cases. **Area**: Test Data Quality **Examples of files that could be improved**: - `features/plan_lifecycle_persistence.feature` - `features/resource_handler_crud.feature` ## Current Behavior These files use a separate `Scenario` for each test case, with hardcoded data for things like file names, paths, and content. This makes the tests: - **Less thorough**: They only cover a narrow range of "happy path" scenarios. - **Harder to maintain**: Adding new test cases requires duplicating the entire scenario. - **Less readable**: The intent of the test can be obscured by the boilerplate of the scenario. ## Expected Behavior Feature files should use `Scenario Outline` with `Examples` tables to enable data-driven testing. This approach allows for testing a wide range of inputs — including positive and negative test cases, boundary conditions, and different character sets — in a concise and maintainable way. The `features/data_variation_*.feature` files are excellent examples of this approach and should be used as a model. ## Acceptance Criteria - `features/plan_lifecycle_persistence.feature` is refactored to use `Scenario Outline` with `Examples` tables. - `features/resource_handler_crud.feature` is refactored to use `Scenario Outline` with `Examples` tables. - Other feature files benefiting from a data-driven approach are identified and a refactoring plan is documented. - New tests cover a wider range of data variations, including positive and negative test cases, boundary conditions, and different character sets. - Refactored feature files are more concise and easier to maintain. - All `nox` stages pass after refactoring. - Coverage remains ≥ 97%. ## Subtasks - [ ] Review `features/plan_lifecycle_persistence.feature` and refactor to use `Scenario Outline` with `Examples` tables. - [ ] Review `features/resource_handler_crud.feature` and refactor to use `Scenario Outline` with `Examples` tables. - [ ] Identify other feature files that would benefit from a data-driven approach and document a refactoring plan. - [ ] Ensure `Examples` tables cover positive cases, negative cases, boundary conditions, and varied character sets. - [ ] Verify all `nox` sessions pass after refactoring. - [ ] Verify coverage remains ≥ 97%. ## Definition of Done - [ ] `features/plan_lifecycle_persistence.feature` refactored to `Scenario Outline` + `Examples`. - [ ] `features/resource_handler_crud.feature` refactored to `Scenario Outline` + `Examples`. - [ ] Additional candidate feature files identified and plan documented. - [ ] New tests cover a wider range of data variations (positive, negative, boundary, character sets). - [ ] Refactored feature files are more concise and easier to maintain. - [ ] All nox stages pass. - [ ] Coverage >= 97%. > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.7.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. --- **Automated by CleverAgents Bot** Supervisor: Test Infrastructure | Agent: new-issue-creator
HAL9000 self-assigned this 2026-04-10 06:16:34 +00:00
HAL9000 added this to the v3.5.0 milestone 2026-04-10 06:16:34 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveragents-core#6892
No description provided.