STD: Min Controls Rule (MINCTRL)
Version: v1.0.0
Status: Draft
SRS Source: docusaurus/docs/srs/rules/rule-mincontrols.md
Rule Name: MIN_CONTROLS
Domain: RULES-MINCTRL
Overview
This document specifies tests for the MIN_CONTROLS rule using decision tables and test vectors. The rule validates that patient wells have the required positive and negative controls available within the same run before processing. When controls are missing, an optional fallback mechanism can check a configured backup mix.
Rule Characteristics:
- Pure business logic (no UI)
- Skip conditions based on well role and resolution codes
- Primary/backup mix control validation
- Configuration-driven fallback behavior
Test Method: TM-API (per Test Plan Section 3.3 - Rules use automated API tests)
Automation Status: Automated
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-MINCTRL-001 | Skip Rule for Non-Patient Wells | 3 | 4 | 100% | None |
| REQ-RULES-MINCTRL-002 | Skip Rule When MINCONTROL Resolution Exists | 4 | 5 | 100% | None |
| REQ-RULES-MINCTRL-003 | Set CONTROL_MISSING Error When Fallback Disabled | 4 | 5 | 100% | None |
| REQ-RULES-MINCTRL-004 | Check Backup Mix Controls When Fallback Enabled | 5 | 6 | 100% | None |
Totals: 4 REQs, 16 Conditions, 20 Test Vectors, 100% Coverage
| Variable | Type | Valid Values | Description |
|---|
well.role_alias | string | Patient, Control, NTC, ... | Well role classification |
well.resolution_codes | array | [], [MINCONTROL], [OTHER], ... | Resolution codes assigned to well |
well.mix | string | mix identifier | Mix the patient well belongs to |
control_wells | array | Well objects | Control wells in the run |
control.role_alias | string | Control | Control well role |
control.mix | string | mix identifier | Mix the control well belongs to |
control.type | string | PC, NC | Positive or Negative control |
role_to_target_mappings | array | Mapping objects | Configured control requirements |
mapping.backup_mix | string | mix identifier | Fallback mix for control lookup |
fallback_shared_control | bool | enabled, disabled | Feature flag for backup mix lookup |
Output Variables
| Variable | Type | Description |
|---|
well.error_code | string? | CONTROL_MISSING or null |
rule_skipped | bool | Whether rule execution was skipped |
rule_executed | bool | Whether full rule logic ran |
REQ-RULES-MINCTRL-001: Skip Rule for Non-Patient Wells
Acceptance Criteria Reference
- AC1: Evaluate the well's role_alias attribute to determine patient status
- AC2: Wells with role_alias values other than "Patient" shall be skipped
- AC3: Skipped wells shall not receive any errors from this rule
- AC4: No further rule processing shall occur for non-patient wells
Decision Table: Role-Based Skip Condition
| TV | well.role_alias | rule_skipped | error_code | Covers |
|---|
| TV-MINCTRL-001-001 | Patient | false | (depends on controls) | AC1: Patient wells proceed |
| TV-MINCTRL-001-002 | Control | true | null | AC2, AC3: Control wells skipped |
| TV-MINCTRL-001-003 | NTC | true | null | AC2, AC3: NTC wells skipped |
| TV-MINCTRL-001-004 | Standard | true | null | AC2, AC4: Other roles skipped |
REQ-RULES-MINCTRL-002: Skip Rule When MINCONTROL Resolution Exists
Acceptance Criteria Reference
- AC1: Check the well's resolution codes before processing
- AC2: If "MINCONTROL" resolution code is present, skip all further logic
- AC3: Wells with MINCONTROL resolution shall not receive any errors from this rule
- AC4: Other resolution codes shall not trigger the skip behavior
Decision Table: Resolution Code Skip Condition
| TV | well.role_alias | well.resolution_codes | rule_skipped | error_code | Covers |
|---|
| TV-MINCTRL-002-001 | Patient | [MINCONTROL] | true | null | AC1, AC2, AC3: MINCONTROL skips |
| TV-MINCTRL-002-002 | Patient | [] | false | (depends on controls) | AC1: No resolution proceeds |
| TV-MINCTRL-002-003 | Patient | [OTHER_CODE] | false | (depends on controls) | AC4: Other codes do not skip |
| TV-MINCTRL-002-004 | Patient | [MINCONTROL, OTHER_CODE] | true | null | AC2: MINCONTROL present skips |
| TV-MINCTRL-002-005 | Control | [MINCONTROL] | true | null | AC2: Role check occurs first |
REQ-RULES-MINCTRL-003: Set CONTROL_MISSING Error When Fallback Disabled
Acceptance Criteria Reference
- AC1: Identify required control roles from role-to-target mappings
- AC2: Search for control wells matching the patient well's mix
- AC3: When no matching PC controls are found, CONTROL_MISSING shall apply
- AC4: When no matching NC controls are found, CONTROL_MISSING shall apply
- AC5: The rule shall not consult backup_mix configuration when fallback is disabled
Decision Table: Control Validation (Fallback Disabled)
| TV | fallback_shared_control | primary_mix_has_PC | primary_mix_has_NC | error_code | Covers |
|---|
| TV-MINCTRL-003-001 | disabled | true | true | null | AC1, AC2: Both controls present |
| TV-MINCTRL-003-002 | disabled | true | false | CONTROL_MISSING | AC4: NC missing |
| TV-MINCTRL-003-003 | disabled | false | true | CONTROL_MISSING | AC3: PC missing |
| TV-MINCTRL-003-004 | disabled | false | false | CONTROL_MISSING | AC3, AC4: Both missing |
| TV-MINCTRL-003-005 | disabled | false | false | CONTROL_MISSING | AC5: Backup not checked |
Note: TV-MINCTRL-003-005 verifies that even when backup_mix has controls available, they are not consulted when fallback is disabled.
Test Setup for TV-MINCTRL-003-005
| Setup Element | Value |
|---|
| Patient well mix | mix2 |
| Primary mix controls (mix2) | None |
| Backup mix controls (mix1) | PC and NC present |
| fallback_shared_control | disabled |
| Expected result | CONTROL_MISSING (backup ignored) |
REQ-RULES-MINCTRL-004: Check Backup Mix Controls When Fallback Enabled
Acceptance Criteria Reference
- AC1: First check for controls matching the patient well's mix
- AC2: When no direct match found, consult the backup_mix from role-to-target mappings
- AC3: If control wells exist for the backup mix, the control requirement shall be satisfied
- AC4: No error shall be assigned when backup mix controls satisfy the requirement
- AC5: If neither primary nor backup mix has required controls, CONTROL_MISSING shall apply
Decision Table: Control Validation (Fallback Enabled)
| TV | fallback_shared_control | primary_mix_has_PC | primary_mix_has_NC | backup_mix_has_PC | backup_mix_has_NC | error_code | Covers |
|---|
| TV-MINCTRL-004-001 | enabled | true | true | N/A | N/A | null | AC1: Primary sufficient |
| TV-MINCTRL-004-002 | enabled | false | false | true | true | null | AC2, AC3, AC4: Backup satisfies |
| TV-MINCTRL-004-003 | enabled | false | true | true | N/A | null | AC2: PC from backup, NC from primary |
| TV-MINCTRL-004-004 | enabled | true | false | N/A | true | null | AC2: NC from backup, PC from primary |
| TV-MINCTRL-004-005 | enabled | false | false | false | false | CONTROL_MISSING | AC5: Neither has controls |
| TV-MINCTRL-004-006 | enabled | false | false | true | false | CONTROL_MISSING | AC5: Backup missing NC |
Combined Decision Table: Full Rule Flow
This table consolidates the complete rule execution path per the Configuration Impact Matrix in the SRS.
| TV | role_alias | resolution_codes | fallback_enabled | primary_PC | primary_NC | backup_PC | backup_NC | result | Covers |
|---|
| TV-FULL-001 | Control | [] | N/A | N/A | N/A | N/A | N/A | Skip | REQ-001 |
| TV-FULL-002 | Patient | [MINCONTROL] | N/A | N/A | N/A | N/A | N/A | Skip | REQ-002 |
| TV-FULL-003 | Patient | [] | disabled | true | true | N/A | N/A | No error | REQ-003 (Scenario A) |
| TV-FULL-004 | Patient | [] | disabled | false | false | N/A | N/A | CONTROL_MISSING | REQ-003 (Scenario B) |
| TV-FULL-005 | Patient | [] | enabled | true | true | N/A | N/A | No error | REQ-004 (Scenario C) |
| TV-FULL-006 | Patient | [] | enabled | false | false | true | true | No error | REQ-004 (Scenario D) |
| TV-FULL-007 | Patient | [] | enabled | false | false | false | false | CONTROL_MISSING | REQ-004 (Scenario E) |
Boundary and Edge Cases
Decision Table: Partial Control Availability
| TV | Scenario | primary_PC | primary_NC | backup_PC | backup_NC | fallback_enabled | error_code | Covers |
|---|
| TV-EDGE-001 | PC only in primary | true | false | false | false | disabled | CONTROL_MISSING | NC required |
| TV-EDGE-002 | NC only in primary | false | true | false | false | disabled | CONTROL_MISSING | PC required |
| TV-EDGE-003 | PC in primary, NC in backup | true | false | false | true | enabled | null | Mixed sources OK |
| TV-EDGE-004 | NC in primary, PC in backup | false | true | true | false | enabled | null | Mixed sources OK |
| TV-EDGE-005 | Multiple PC, no NC | true | false | true | false | enabled | CONTROL_MISSING | NC still required |
| TV-EDGE-006 | Multiple NC, no PC | false | true | false | true | enabled | CONTROL_MISSING | PC still required |
Traceability to Existing Tests
| Requirement | Jira Tests | Status | Notes |
|---|
| REQ-RULES-MINCTRL-001 | BT-5252 | Partial | TV-001-001 covered; TV-001-002 to TV-001-004 are gaps |
| REQ-RULES-MINCTRL-002 | BT-5252 | Partial | TV-002-002 covered; TV-002-001, TV-002-003 to TV-002-005 are gaps |
| REQ-RULES-MINCTRL-003 | BT-5252 | Partial | TV-003-001, TV-003-002, TV-003-004 covered; TV-003-003, TV-003-005 are gaps |
| REQ-RULES-MINCTRL-004 | BT-5252 | Partial | TV-004-001, TV-004-005 covered; TV-004-002 to TV-004-004, TV-004-006 are gaps |
Note: BT-3918 was previously referenced but tests MINEXTRACT rule, not MINCONTROLS. BT-5252 (Scenario Outline with config Quest_EZ_MINCONTROLS.xlsx) is the correct automated test for this rule.
Gap Analysis
Identified Gaps
| Gap | Requirement | Description | Priority | Owner |
|---|
| GAP-001 | REQ-RULES-MINCTRL-001 | TV-001-002 to TV-001-004 (non-Patient role skip) not covered by BT-5252 | Medium | TBD |
| GAP-002 | REQ-RULES-MINCTRL-002 | TV-002-001, TV-002-003 to TV-002-005 (resolution code skip variants) not covered | Medium | TBD |
| GAP-003 | REQ-RULES-MINCTRL-003 | TV-003-003, TV-003-005 (fallback-disabled edge cases) not covered | High | TBD |
| GAP-004 | REQ-RULES-MINCTRL-004 | TV-004-002 to TV-004-004, TV-004-006 (fallback-enabled edge cases) not covered | High | TBD |
| GAP-005 | All | TV-EDGE-001 to TV-EDGE-006, TV-FULL-001, TV-FULL-002 (boundary and skip cases) not covered | Medium | TBD |
- GAP-001 to GAP-004: Extend BT-5252 Scenario Outline examples or create new test ticket to cover remaining TVs
- GAP-005: Create dedicated edge case test ticket for boundary conditions