Skip to main content
Version: Next

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 IDTitleConditionsTest VectorsCoverageGaps
REQ-RULES-MINCTRL-001Skip Rule for Non-Patient Wells34100%None
REQ-RULES-MINCTRL-002Skip Rule When MINCONTROL Resolution Exists45100%None
REQ-RULES-MINCTRL-003Set CONTROL_MISSING Error When Fallback Disabled45100%None
REQ-RULES-MINCTRL-004Check Backup Mix Controls When Fallback Enabled56100%None

Totals: 4 REQs, 16 Conditions, 20 Test Vectors, 100% Coverage


Input Variables

VariableTypeValid ValuesDescription
well.role_aliasstringPatient, Control, NTC, ...Well role classification
well.resolution_codesarray[], [MINCONTROL], [OTHER], ...Resolution codes assigned to well
well.mixstringmix identifierMix the patient well belongs to
control_wellsarrayWell objectsControl wells in the run
control.role_aliasstringControlControl well role
control.mixstringmix identifierMix the control well belongs to
control.typestringPC, NCPositive or Negative control
role_to_target_mappingsarrayMapping objectsConfigured control requirements
mapping.backup_mixstringmix identifierFallback mix for control lookup
fallback_shared_controlboolenabled, disabledFeature flag for backup mix lookup

Output Variables

VariableTypeDescription
well.error_codestring?CONTROL_MISSING or null
rule_skippedboolWhether rule execution was skipped
rule_executedboolWhether 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

TVwell.role_aliasrule_skippederror_codeCovers
TV-MINCTRL-001-001Patientfalse(depends on controls)AC1: Patient wells proceed
TV-MINCTRL-001-002ControltruenullAC2, AC3: Control wells skipped
TV-MINCTRL-001-003NTCtruenullAC2, AC3: NTC wells skipped
TV-MINCTRL-001-004StandardtruenullAC2, 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

TVwell.role_aliaswell.resolution_codesrule_skippederror_codeCovers
TV-MINCTRL-002-001Patient[MINCONTROL]truenullAC1, AC2, AC3: MINCONTROL skips
TV-MINCTRL-002-002Patient[]false(depends on controls)AC1: No resolution proceeds
TV-MINCTRL-002-003Patient[OTHER_CODE]false(depends on controls)AC4: Other codes do not skip
TV-MINCTRL-002-004Patient[MINCONTROL, OTHER_CODE]truenullAC2: MINCONTROL present skips
TV-MINCTRL-002-005Control[MINCONTROL]truenullAC2: 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)

TVfallback_shared_controlprimary_mix_has_PCprimary_mix_has_NCerror_codeCovers
TV-MINCTRL-003-001disabledtruetruenullAC1, AC2: Both controls present
TV-MINCTRL-003-002disabledtruefalseCONTROL_MISSINGAC4: NC missing
TV-MINCTRL-003-003disabledfalsetrueCONTROL_MISSINGAC3: PC missing
TV-MINCTRL-003-004disabledfalsefalseCONTROL_MISSINGAC3, AC4: Both missing
TV-MINCTRL-003-005disabledfalsefalseCONTROL_MISSINGAC5: 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 ElementValue
Patient well mixmix2
Primary mix controls (mix2)None
Backup mix controls (mix1)PC and NC present
fallback_shared_controldisabled
Expected resultCONTROL_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)

TVfallback_shared_controlprimary_mix_has_PCprimary_mix_has_NCbackup_mix_has_PCbackup_mix_has_NCerror_codeCovers
TV-MINCTRL-004-001enabledtruetrueN/AN/AnullAC1: Primary sufficient
TV-MINCTRL-004-002enabledfalsefalsetruetruenullAC2, AC3, AC4: Backup satisfies
TV-MINCTRL-004-003enabledfalsetruetrueN/AnullAC2: PC from backup, NC from primary
TV-MINCTRL-004-004enabledtruefalseN/AtruenullAC2: NC from backup, PC from primary
TV-MINCTRL-004-005enabledfalsefalsefalsefalseCONTROL_MISSINGAC5: Neither has controls
TV-MINCTRL-004-006enabledfalsefalsetruefalseCONTROL_MISSINGAC5: 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.

TVrole_aliasresolution_codesfallback_enabledprimary_PCprimary_NCbackup_PCbackup_NCresultCovers
TV-FULL-001Control[]N/AN/AN/AN/AN/ASkipREQ-001
TV-FULL-002Patient[MINCONTROL]N/AN/AN/AN/AN/ASkipREQ-002
TV-FULL-003Patient[]disabledtruetrueN/AN/ANo errorREQ-003 (Scenario A)
TV-FULL-004Patient[]disabledfalsefalseN/AN/ACONTROL_MISSINGREQ-003 (Scenario B)
TV-FULL-005Patient[]enabledtruetrueN/AN/ANo errorREQ-004 (Scenario C)
TV-FULL-006Patient[]enabledfalsefalsetruetrueNo errorREQ-004 (Scenario D)
TV-FULL-007Patient[]enabledfalsefalsefalsefalseCONTROL_MISSINGREQ-004 (Scenario E)

Boundary and Edge Cases

Decision Table: Partial Control Availability

TVScenarioprimary_PCprimary_NCbackup_PCbackup_NCfallback_enablederror_codeCovers
TV-EDGE-001PC only in primarytruefalsefalsefalsedisabledCONTROL_MISSINGNC required
TV-EDGE-002NC only in primaryfalsetruefalsefalsedisabledCONTROL_MISSINGPC required
TV-EDGE-003PC in primary, NC in backuptruefalsefalsetrueenablednullMixed sources OK
TV-EDGE-004NC in primary, PC in backupfalsetruetruefalseenablednullMixed sources OK
TV-EDGE-005Multiple PC, no NCtruefalsetruefalseenabledCONTROL_MISSINGNC still required
TV-EDGE-006Multiple NC, no PCfalsetruefalsetrueenabledCONTROL_MISSINGPC still required

Traceability to Existing Tests

RequirementJira TestsStatusNotes
REQ-RULES-MINCTRL-001BT-5252PartialTV-001-001 covered; TV-001-002 to TV-001-004 are gaps
REQ-RULES-MINCTRL-002BT-5252PartialTV-002-002 covered; TV-002-001, TV-002-003 to TV-002-005 are gaps
REQ-RULES-MINCTRL-003BT-5252PartialTV-003-001, TV-003-002, TV-003-004 covered; TV-003-003, TV-003-005 are gaps
REQ-RULES-MINCTRL-004BT-5252PartialTV-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

GapRequirementDescriptionPriorityOwner
GAP-001REQ-RULES-MINCTRL-001TV-001-002 to TV-001-004 (non-Patient role skip) not covered by BT-5252MediumTBD
GAP-002REQ-RULES-MINCTRL-002TV-002-001, TV-002-003 to TV-002-005 (resolution code skip variants) not coveredMediumTBD
GAP-003REQ-RULES-MINCTRL-003TV-003-003, TV-003-005 (fallback-disabled edge cases) not coveredHighTBD
GAP-004REQ-RULES-MINCTRL-004TV-004-002 to TV-004-004, TV-004-006 (fallback-enabled edge cases) not coveredHighTBD
GAP-005AllTV-EDGE-001 to TV-EDGE-006, TV-FULL-001, TV-FULL-002 (boundary and skip cases) not coveredMediumTBD

Remediation Plan

  1. GAP-001 to GAP-004: Extend BT-5252 Scenario Outline examples or create new test ticket to cover remaining TVs
  2. GAP-005: Create dedicated edge case test ticket for boundary conditions