Skip to main content
Version: 3.0.0

STD: WT Rule (Associated Well Error)

Version: v1.0.0 Status: Draft SRS Source: docusaurus/docs/srs/rules/rule-wt.md Rule Name: WT (Well Transfer) Domain: RULES-WT


Overview

This document specifies tests for the WT rule using decision tables and test vectors. The rule propagates error messages from failed control wells to associated patient wells and clears those errors when control failures are resolved.

Rule Characteristics:

  • Pure business logic (no UI)
  • Error propagation from controls to patients
  • Distinguishes extraction vs non-extraction control types
  • Configuration-dependent fallback mix behavior
  • Automatic error clearing on resolution

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-WT-001Propagate Control Failure Errors810100%None
REQ-RULES-WT-002Clear Patient Well Errors45100%None
REQ-RULES-WT-003Check Fallback Mixes68100%None

Totals: 3 REQs, 18 Conditions, 23 Test Vectors, 100% Coverage


Input Variables

VariableTypeValid ValuesDescription
control.has_errorbooltrue, falseControl well has failed
control.is_extractionbooltrue, falseControl is extraction type
well.typestringControl, PatientWell type
well.mixstringmix1, mix2, ...Mix identifier
control.mixstringmix1, mix2, ...Control's mix
patient.has_wt_errorbooltrue, falsePatient has existing WT error
config.fallback_shared_controlbooltrue, falseFallback setting enabled
mapping.backup_mixstring?null, mix1, mix2, ...Backup mix from role-to-target mapping
control.error_resolvedbooltrue, falseControl error was resolved

Output Variables

VariableTypeDescription
patient.error_messagestring?Error message set on patient well
patient.error_codestring?Error code (for fallback: INHERITED_CONTROL_FAILURE)
patient.export_blockedboolPatient well is blocked from export
patient.wt_error_clearedboolWT error was removed from patient

REQ-RULES-WT-001: Propagate Control Failure Errors to Patient Wells

Acceptance Criteria Summary

  • AC1: Non-extraction control failure sets specific error message
  • AC2: Extraction control failure sets extraction-specific error message
  • AC3: Error applies to all patient wells in same mix
  • AC4: Error blocks export until resolved
  • AC5: Rule distinguishes extraction from non-extraction controls

Decision Table: Error Message Selection

TVcontrol.has_errorcontrol.is_extractionsame_mixexpected_messageCovers
TV-001-001truefalsetrue"An associated control has failed. That error must be resolved before this well can be exported."AC1: Non-extraction error
TV-001-002truetruetrue"An associated extraction control has failed. That error must be resolved before this well can be exported."AC2: Extraction error
TV-001-003truefalsefalsenullAC3: Different mix - no propagation
TV-001-004truetruefalsenullAC3: Different mix - no propagation
TV-001-005falsefalsetruenullControl has no error
TV-001-006falsetruetruenullControl has no error

Decision Table: Export Blocking

TVcontrol.has_errorsame_mixpatient.export_blockedCovers
TV-001-007truetruetrueAC4: Export blocked
TV-001-008truefalsefalseAC4: Different mix - not blocked
TV-001-009falsetruefalseNo error - not blocked

Decision Table: Control Type Distinction

TVcontrol.has_errorcontrol.is_extractionmessage_contains_extractionCovers
TV-001-010truetruetrueAC5: Extraction distinguished

REQ-RULES-WT-002: Clear Patient Well Errors on Control Resolution

Acceptance Criteria Summary

  • AC1: WT errors cleared when control error is resolved
  • AC2: Clearing is automatic
  • AC3: All associated patient wells have WT errors cleared
  • AC4: Patient wells eligible for export after clearing (no other errors)

Decision Table: Error Clearing

TVpatient.has_wt_errorcontrol.error_resolvedsame_mixpatient.wt_error_clearedCovers
TV-002-001truetruetruetrueAC1, AC2: Auto-clear on resolution
TV-002-002truefalsetruefalseControl not resolved
TV-002-003falsetruetruefalseNo WT error to clear
TV-002-004truetruefalsefalseDifferent mix - not associated

Decision Table: Export Eligibility After Clearing

TVwt_error_clearedother_errors_existexport_eligibleCovers
TV-002-005truefalsetrueAC4: Eligible after clearing

REQ-RULES-WT-003: Check Fallback Mixes for Control Errors

Acceptance Criteria Summary

  • AC1: Fallback disabled - backup mix patients do NOT inherit control errors
  • AC2: Fallback enabled - backup mix patients DO inherit control errors
  • AC3: Error code is INHERITED_CONTROL_FAILURE for fallback errors
  • AC4: Backup mix relationship defined in role-to-target mappings

Decision Table: Fallback Shared Control Configuration

TVconfig.fallback_shared_controlcontrol.has_errorpatient.mixmapping.backup_mixpatient.error_codeCovers
TV-003-001falsetruemix2mix2nullAC1: Fallback disabled - no inheritance
TV-003-002truetruemix2mix2INHERITED_CONTROL_FAILUREAC2, AC3: Fallback enabled - inherits
TV-003-003truefalsemix2mix2nullNo control error to inherit
TV-003-004truetruemix3mix2nullPatient not in backup mix

Decision Table: Primary vs Backup Mix

TVcontrol.mixpatient.mixmapping.backup_mixconfig.fallback_shared_controlerror_propagatedCovers
TV-003-005mix1mix1mix2truetrue (via primary)Primary mix - standard propagation
TV-003-006mix1mix2mix2truetrue (via fallback)Backup mix - fallback propagation
TV-003-007mix1mix2mix2falsefalseAC1: Fallback disabled
TV-003-008mix1mix3mix2truefalseNeither primary nor backup

Error Handling Test Vectors

Decision Table: Error Conditions

TVConditionExpected BehaviorCovers
TV-ERR-001Missing mix associationLog warning, skip wellREQ-001 Error Handling
TV-ERR-002Well update failureRetry once, then fail run with notificationREQ-001 Error Handling
TV-ERR-003Configuration read failureUse default (fallback disabled), log errorREQ-003 Error Handling
TV-ERR-004Missing role-to-target mappingSkip fallback check for that wellREQ-003 Error Handling

Automation Status

REQ IDTest MethodAutomation Status
REQ-RULES-WT-001TM-APIAutomated
REQ-RULES-WT-002TM-APIAutomated
REQ-RULES-WT-003TM-APIAutomated

Traceability to Existing Tests

RequirementJira TestsStatus
REQ-RULES-WT-001BT-749, BT-750, BT-1523, BT-1557, BT-1558, BT-1559Existing
REQ-RULES-WT-002BT-1524, BT-1560, BT-1561, BT-1562Existing
REQ-RULES-WT-003BT-3940Existing

Gap Analysis

Identified Gaps

GapRequirementDescriptionPriorityOwner
None-All requirements have existing Jira test coverage--

Coverage Notes

All three requirements have existing Jira test tickets that align with the test vectors defined in this STD. The test vectors provide a structured mapping to ensure complete condition coverage.