STD: Single Well Combined Outcome Rule (SWCOMBOUT)
Version: v1.0.0 Status: Draft SRS Source:
docusaurus/docs/srs/rules/rule-single-well-combined-outcome.mdRule Name: SINGLE_WELL_COMBINED_OUTCOME Domain: RULES-SWCOMBOUT
Overview
This document specifies tests for the Single Well Combined Outcome rule using decision tables and test vectors. The rule assigns combined outcomes to associated wells only when the combined outcome has exactly one mix result, delegating multi-mix scenarios to the Multi Well Combined Outcome Rule.
Rule Characteristics:
- Pure business logic (no UI)
- Simple binary condition (count = 1 vs count >= 2)
- Deterministic behavior for single-mix scenarios
- Part of Combined Outcome Rules family
Test Method: TM-API (per Test Plan Section 3.3 - Rules use automated API tests)
Verification Approach: Rule verification is performed using data-driven test vectors. Each row in a decision table represents a complete verification scenario with defined inputs and expected outputs. This format enables exhaustive condition coverage while remaining concise and auditable.
Coverage Summary
| REQ ID | Title | Conditions | Test Vectors | Coverage | Gaps |
|---|---|---|---|---|---|
| REQ-RULES-SWCOMBOUT-001 | Single Well Combined Outcome Rule Execution | 4 | 12 | Full | Minor (edge cases) |
Totals: 1 REQ, 4 Conditions, 12 Test Vectors, Full Coverage (v3 config: 11 tests covering TV-002, TV-005, TV-010)
REQ-RULES-SWCOMBOUT-001: Single Well Combined Outcome Rule Execution
Input Variables
| Variable | Type | Valid Values | Description |
|---|---|---|---|
combined_outcome | object | Valid CO entity | The combined outcome being evaluated |
mix_results_count | int | 0, 1, 2, 3, ... | Number of mix results associated with the combined outcome |
associated_wells | array | Valid well entities | Wells linked to the combined outcome |
Output Variables
| Variable | Type | Description |
|---|---|---|
well.combined_outcome | object/null | Assigned combined outcome (null if not assigned by this rule) |
rule_applied | bool | Whether this rule performed the assignment |
Decision Table: Mix Results Count Condition
This table verifies the core decision logic based on mix results count.
| TV | mix_results_count | expected_assignment | rule_applied | Covers |
|---|---|---|---|---|
| TV-SWCOMBOUT-001 | 0 | false | false | AC: Edge case - no mix results |
| TV-SWCOMBOUT-002 | 1 | true | true | AC: Exactly one mix result - rule applies |
| TV-SWCOMBOUT-003 | 2 | false | false | AC: Two or more - delegate to Multi Well Rule |
| TV-SWCOMBOUT-004 | 10 | false | false | AC: Large count - delegate to Multi Well Rule |
Decision Table: Well Assignment Behavior
This table verifies that when the rule applies, ALL associated wells receive the combined outcome.
| TV | mix_results_count | associated_wells | wells_receiving_outcome | Covers |
|---|---|---|---|---|
| TV-SWCOMBOUT-005 | 1 | [Well_A1] | [Well_A1] | AC: Single well assignment |
| TV-SWCOMBOUT-006 | 1 | [Well_A1, Well_B1, Well_C1] | [Well_A1, Well_B1, Well_C1] | AC: Multiple wells all receive assignment |
Decision Table: Independence of Evaluation
This table verifies that each combined outcome is evaluated independently.
| TV | combined_outcomes | co1_mix_count | co2_mix_count | co1_assigned | co2_assigned | Covers |
|---|---|---|---|---|---|---|
| TV-SWCOMBOUT-007 | [CO_A, CO_B] | 1 | 2 | true | false | AC: Independent evaluation - mixed scenario |
| TV-SWCOMBOUT-008 | [CO_A, CO_B] | 1 | 1 | true | true | AC: Both qualify |
| TV-SWCOMBOUT-009 | [CO_A, CO_B] | 3 | 5 | false | false | AC: Neither qualifies |
Decision Table: Eligibility for Subsequent Rules
This table verifies that wells not assigned by this rule remain eligible for other rules.
| TV | mix_results_count | rule_applied | well_eligible_for_multi_well_rule | Covers |
|---|---|---|---|---|
| TV-SWCOMBOUT-010 | 1 | true | N/A (already assigned) | AC: Assigned wells - no further processing needed |
| TV-SWCOMBOUT-011 | 2 | false | true | AC: Unassigned wells remain eligible |
| TV-SWCOMBOUT-012 | 5 | false | true | AC: Unassigned wells remain eligible |
Boundary Value Analysis
| Test Vector | Condition | Value | Expected | Rationale |
|---|---|---|---|---|
| TV-SWCOMBOUT-001 | mix_results_count | 0 | No assignment | Below threshold |
| TV-SWCOMBOUT-002 | mix_results_count | 1 | Assignment | Exact boundary (rule applies) |
| TV-SWCOMBOUT-003 | mix_results_count | 2 | No assignment | Just above threshold |
| TV-SWCOMBOUT-004 | mix_results_count | 10 | No assignment | Well above threshold |
Test File Locations
| Requirement | Test File | Automation Status |
|---|---|---|
| REQ-RULES-SWCOMBOUT-001 | None | Gap - No dedicated unit test exists |
Traceability to Existing Tests
| Requirement | Jira Tests | Status |
|---|---|---|
| REQ-RULES-SWCOMBOUT-001 | BT-5128 (Legacy) | v2 config only (Viracor_PROD.xlsx); tests multi-mix scenario |
| REQ-RULES-SWCOMBOUT-001 | BT-5578-5595 (v3) | Full - Quest Combined Outcomes tests (see Implemented Test Coverage below) |
Note: BT-5281 was previously referenced but does not exist in the feature catalogue.
Implemented Test Coverage
The following tests exercise single-analyte combined outcome scenarios using v3 configuration.
| Test ID | Description | TVs Covered | Config |
|---|---|---|---|
| TEST_BT-5578 | Quest COVID Combined Outcomes | TV-002, TV-005, TV-010 | EZ - San Juan Capistrano CA_v3_from clone.xlsx |
| TEST_BT-5579 | Quest HHV6 Combined Outcomes | TV-002, TV-005, TV-010 | EZ - San Juan Capistrano CA_v3_from clone.xlsx |
| TEST_BT-5581 | Quest MPX Combined Outcomes | TV-002, TV-005, TV-010 | EZ - San Juan Capistrano CA_v3_from clone.xlsx |
| TEST_BT-5582 | Quest PARVO Combined Outcomes | TV-002, TV-005, TV-010 | EZ - San Juan Capistrano CA_v3_from clone.xlsx |
| TEST_BT-5588 | Quest ADV Combined Outcomes | TV-002, TV-005, TV-010 | EZ - San Juan Capistrano CA_v3_from clone.xlsx |
| TEST_BT-5589 | Quest EBV Combined Outcomes | TV-002, TV-005, TV-010 | EZ - San Juan Capistrano CA_v3_from clone.xlsx |
| TEST_BT-5590 | Quest BKV Combined Outcomes | TV-002, TV-005, TV-010 | EZ - San Juan Capistrano CA_v3_from clone.xlsx |
| TEST_BT-5591 | Quest CMV Combined Outcomes | TV-002, TV-005, TV-010 | EZ - San Juan Capistrano CA_v3_from clone.xlsx |
| TEST_BT-5592 | Quest NOROV Combined Outcomes | TV-002, TV-005, TV-010 | EZ - San Juan Capistrano CA_v3_from clone.xlsx |
| TEST_BT-5594 | Quest NOROV II Combined Outcomes | TV-002, TV-005, TV-010 | EZ - San Juan Capistrano CA_v3_from clone.xlsx |
| TEST_BT-5595 | Quest VZV Combined Outcomes | TV-002, TV-005, TV-010 | EZ - San Juan Capistrano CA_v3_from clone.xlsx |
Coverage Notes:
- All 11 tests use single-analyte assays where
mix_results_count = 1, directly exercising this rule - TV-SWCOMBOUT-002: Exactly one mix result triggers assignment
- TV-SWCOMBOUT-005: Single well receives combined outcome
- TV-SWCOMBOUT-010: Assigned wells marked complete (no further rule processing)
Gap Analysis
Identified Gaps
RESOLVED: Core single-mix-result combined outcome scenarios are now covered by BT-5578-5595 (11 v3 tests).
| Gap ID | Description | Severity | Notes |
|---|---|---|---|
| GAP-SWCOMBOUT-001 | No unit test for SingleWellCombinedOutcomeRule | Low | Unit test path does not exist; Behat coverage sufficient |
| RESOLVED - BT-5578-5595 use v3 config | |||
| RESOLVED - All 11 tests use single-analyte assays | |||
| GAP-SWCOMBOUT-004 | TV-SWCOMBOUT-001 (zero mix results) | Low | Edge case not explicitly tested |
| GAP-SWCOMBOUT-005 | TV-SWCOMBOUT-004 (large count boundary) | Low | No large count boundary test |
| GAP-SWCOMBOUT-006 | TV-SWCOMBOUT-007-009 (independence) | Low | No explicit multi-CO independence test |
Coverage Verification
| Acceptance Criteria | Test Vectors | Status |
|---|---|---|
| Count = 1 triggers assignment | TV-SWCOMBOUT-002, TV-SWCOMBOUT-005, TV-SWCOMBOUT-006 | Covered - BT-5578-5595 |
| Count >= 2 skips assignment | TV-SWCOMBOUT-003, TV-SWCOMBOUT-004 | Partial - BT-5128 (v2 multi-mix) |
| Independent evaluation per CO | TV-SWCOMBOUT-007, TV-SWCOMBOUT-008, TV-SWCOMBOUT-009 | Gap - Low priority |
| Unassigned wells remain eligible | TV-SWCOMBOUT-011, TV-SWCOMBOUT-012 | Gap - Low priority |
| Boundary: count = 0 | TV-SWCOMBOUT-001 | Gap - Edge case |
| Single well assignment | TV-SWCOMBOUT-005, TV-SWCOMBOUT-010 | Covered - BT-5578-5595 |