Skip to main content
Version: Next

STD: Control Fail Rule (CONTROLFAIL)

Version: v1.0.0 Status: Draft SRS Source: docusaurus/docs/srs/rules/rule-control-fail.md Rule Name: CONTROL_FAIL Domain: RULES-CONTROLFAIL


Overview

This document specifies tests for the CONTROL_FAIL rule using decision tables and test vectors. The rule propagates control well failures to patient wells, ensuring that runs with failed quality controls cannot produce valid patient results.

Rule Characteristics:

  • Pure business logic (no UI)
  • Run-level quality control enforcement
  • Control well failure detection with mix-based exclusion
  • Patient well error propagation

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 IDTitleConditionsTest VectorsCoverageGaps
REQ-RULES-CONTROLFAIL-001Mark Patient Wells on Control Failure814100%None
REQ-RULES-CONTROLFAIL-002Exclude Unknown Mix Wells613100%None

Totals: 2 REQs, 14 Conditions, 27 Test Vectors, 100% Coverage


Input Variables

VariableTypeValid ValuesDescription
run.control_wellsarray[] or [well...]Control wells in the run
control.statusenumPASSED, FAILEDControl well pass/fail status
control.mix_statusenumknown, unknownWhether well mix is identifiable
run.patient_wellsarray[well...]Patient wells in the run

Output Variables

VariableTypeDescription
patient.error_codestring?QC error code (null if no error)
patient.has_qc_errorboolWhether patient well marked with error

REQ-RULES-CONTROLFAIL-001: Mark Patient Wells on Control Failure

Decision Table: Core Control Failure Detection

TVcontrol_countany_control_failedall_known_mixpatient_markedCovers
TV-001-0011truetruetrueAC: Single control failure triggers error
TV-001-0021falsetruefalseAC: No failure means no error
TV-001-0033true (1 of 3)truetrueAC: Single failure sufficient among multiple
TV-001-0043true (all)truetrueAC: Multiple failures still trigger
TV-001-0053falsetruefalseAC: All controls pass means no error

Decision Table: No Control Wells Scenario

TVcontrol_countpatient_countpatient_markedCovers
TV-001-00601falseEH: No controls in run, no error
TV-001-00703falseEH: No controls, multiple patients unaffected

Decision Table: Error Code Assignment

TVcontrol_failederror_code_assignederror_typeCovers
TV-001-008truetrueQC_ERRORAC: Error expressed as code
TV-001-009truetrueINHERITED_CONTROL_FAILUREAC: Code indicates repeat due to QC

Decision Table: All Patient Wells Affected

TVcontrol_failedpatient_countpatients_markedCovers
TV-001-010true55AC: All patient wells receive error

Decision Table: Gap Coverage — Control Failure Propagation

TVScenariocontrol_failedpatient_countpatient_markedCovers
TV-CONTROLFAIL-GAP-006All known-mix controls failedtrue (all)1trueAC: All known controls fail triggers error
TV-CONTROLFAIL-GAP-007Multiple patient wells all get error from failed controlstrue (all)2true (all)AC: Error propagated to all patients
TV-CONTROLFAIL-GAP-008No control wells in run — MINEXTRACT fires0 controls1MINEXTRACT errorEH: Missing controls produce different error
TV-CONTROLFAIL-GAP-009Single passing control set + single patient — minimal passing casefalse1falseAC: Minimal passing scenario

REQ-RULES-CONTROLFAIL-002: Unknown Mix Exclusion

Decision Table: Mix Status Filtering

TVcontrol.statuscontrol.mix_statuscounted_as_failureCovers
TV-002-001FAILEDknowntrueAC: Known-mix failures counted
TV-002-002FAILEDunknownfalseAC: Unknown-mix excluded from count
TV-002-003PASSEDknownfalseAC: Passed wells not failures
TV-002-004PASSEDunknownfalseAC: Passed unknown not failures

Decision Table: Combined Scenarios

TVknown_failedunknown_failedknown_passedunknown_passedpatient_markedCovers
TV-002-0050110falseAC: Only unknown failures, no patient error
TV-002-0061100trueAC: Known failure present, patient marked
TV-002-0070011falseAC: All passed, no errors
TV-002-0081001trueAC: Known failure triggers despite unknown passed

Decision Table: Gap Coverage — Unknown Mix Exclusion Scenarios

TVknown_failedunknown_failedknown_passedunknown_passedpatient_markedCovers
TV-CONTROLFAIL-GAP-0010011 (unrecognised)falseAC: Unknown-mix control fails, patient NOT marked
TV-CONTROLFAIL-GAP-0020110falseAC: Extraction controls pass + unknown fails — patient clean
TV-CONTROLFAIL-GAP-0030010falseAC: Nonsense-label patient with known controls passing
TV-CONTROLFAIL-GAP-0040410falseAC: Many unknown-mix fails + passing extraction — no patient error
TV-CONTROLFAIL-GAP-0050310falseAC: Known-pass + many unknown-fail — patient clean

Boundary Conditions

Decision Table: Edge Cases

TVScenariocontrol_wellsresultCovers
TV-BND-001Single control, single patient[C1:FAILED,known]P1 markedREQ-001 minimum case
TV-BND-002Many controls, all unknown-failed[C1:FAILED,unknown, C2:FAILED,unknown]P1 not markedREQ-002 all-unknown edge
TV-BND-003Mixed: 1 known-pass, many unknown-fail[C1:PASSED,known, C2:FAILED,unknown, C3:FAILED,unknown]P1 not markedREQ-002 pass dominates
TV-CONTROLFAIL-VARIANT-BND-PASSSingle control set passes + single patient — minimum viable passing[C1:PASSED,known, C2:PASSED,known]P1 not markedREQ-001 minimum passing case

Test File Locations

RequirementTest FileAutomation Status
REQ-RULES-CONTROLFAIL-001tests/Unit/Rules/ControlFailRuleTest.phpAutomated
REQ-RULES-CONTROLFAIL-002tests/Unit/Rules/ControlFailRuleTest.phpAutomated

Traceability to Existing Tests

RequirementJira TestsStatus
REQ-RULES-CONTROLFAIL-001BT-2398Existing
REQ-RULES-CONTROLFAIL-002BT-2398Existing

Gap Analysis

Identified Gaps

GapRequirementDescriptionPriorityOwner
None-Full coverage achieved--

Remediation Plan

No gaps identified. All acceptance criteria are covered by test vectors.