Skip to main content
Version: Next

STD: ADJ Rule (Cross Contamination)

Version: v1.0.0 Status: Draft SRS Source: docusaurus/docs/srs/rules/rule-adj.md Rule Name: ADJ (Adjacent CT Rule) Domain: RULES-ADJ


Overview

This document specifies tests for the ADJ rule using decision tables and test vectors. The rule detects potential cross-contamination between adjacent wells on a thermocycler plate by comparing Ct or Quant values against configured thresholds.

Rule Characteristics:

  • Pure business logic (no UI)
  • Adjacency detection (8 positions around target well)
  • Dual detection modes (Ct-based and Quant-based)
  • Error persistence across export and re-analysis
  • Configuration validation (missing thresholds)

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 VectorsCoverageGapsAutomation Status
REQ-RULES-ADJ-001Cross-Contamination Detection812100%NoneAutomated (BT-5134, BT-5143, BT-5155)
REQ-RULES-ADJ-002Error Persistence34100%NoneAutomated (BT-5638)
REQ-RULES-ADJ-003Error Resolution33100%NoneAutomated (BT-5134, BT-5143)
REQ-RULES-ADJ-004Audit Logging240%GAP-001Not identified
REQ-RULES-ADJ-005Quant-Based Detection56100%NoneAutomated (BT-5155, BT-5157)
REQ-RULES-ADJ-006Missing Configuration340%GAP-002Not identified

Totals: 6 REQs, 24 Conditions, 33 Test Vectors, 67% Coverage (4/6 REQs with identified tests)


Input Variables (Common)

VariableTypeValid ValuesDescription
well.positionstringA1-H12Well position on plate
well.positivebooltrue, falseWhether well has positive result
well.targetstringNCOV1, HEV, IC, ...Target identifier
well.is_icbooltrue, falseWhether target is Internal Control
well.ctfloat?null, numericCycle threshold value
well.quantityfloat?null, numericQuantification value
config.potential_contaminated_ctfloat?null, numericCt threshold for potentially contaminated well
config.potential_contaminating_ctfloat?null, numericCt threshold for potentially contaminating source
config.potential_contaminated_quantfloat?null, numericQuant threshold for potentially contaminated well
config.potential_contaminating_quantfloat?null, numericQuant threshold for potentially contaminating source
config.quant_or_ctstringCt, QuantDetection mode selection
adjacent.wells[]arrayWell objectsWells adjacent to target well

Output Variables (Common)

VariableTypeDescription
well.error_codestring?ADJ_CT or ADJ_LIMITS_MISSED or null
well.error_messagestring?"Cross-contamination concern" or null
audit.entryobject?Audit log entry (for config changes)

REQ-RULES-ADJ-001: Cross-Contamination Detection

Decision Table: Well Eligibility

Tests whether a well is evaluated for cross-contamination based on positive status and IC target exclusion.

TVwell.positivewell.is_icevaluatedCovers
TV-001-001truefalsetrueAC: Rule evaluates positive non-IC wells
TV-001-002truetruefalseAC: IC targets excluded
TV-001-003falsefalsefalseAC: Negative wells skipped
TV-001-004falsetruefalseAC: Negative IC wells skipped

Decision Table: Ct-Based Detection

Tests cross-contamination detection when a well has high Ct (potential contaminated) and adjacent well has low Ct (potential contaminating) for same target.

TVwell.ctconfig.contaminated_ctwell > thresholdadjacent.ctconfig.contaminating_ctadjacent < thresholdsame_targeterror_codeCovers
TV-001-0053835true2025truetrueADJ_CTAC: Cross-contamination detected
TV-001-0063235false2025truetruenullAC: Well Ct below contaminated threshold
TV-001-0073835true2825falsetruenullAC: Adjacent Ct above contaminating threshold
TV-001-0083835true2025truefalsenullAC: Different targets - no detection

Decision Table: Adjacent Well Positions

Tests that all 8 adjacent positions are evaluated correctly. Example: Well B2 should check A1, B1, C1, A2, C2, A3, B3, C3.

TVtarget_welladjacent_wellscontaminating_wellerror_onCovers
TV-001-009B2 (Ct=38)A1(Ct=20), B1(Ct=40), C1(Ct=40), A2(Ct=40), C2(Ct=40), A3(Ct=40), B3(Ct=40), C3(Ct=40)A1B2AC: Diagonal adjacency detected
TV-001-010B2 (Ct=38)A1(Ct=40), B1(Ct=40), C1(Ct=40), A2(Ct=20), C2(Ct=40), A3(Ct=40), B3(Ct=40), C3(Ct=40)A2B2AC: Horizontal adjacency detected
TV-001-011B2 (Ct=38)A1(Ct=40), B1(Ct=20), C1(Ct=40), A2(Ct=40), C2(Ct=40), A3(Ct=40), B3(Ct=40), C3(Ct=40)B1B2AC: Vertical adjacency detected
TV-001-012A1 (Ct=38)A2(Ct=40), B1(Ct=40), B2(Ct=40)nonenullAC: Edge well with no contaminating adjacent

REQ-RULES-ADJ-002: Error Persistence

Decision Table: Error Persistence After Export and Re-Analysis

TVinitial_erroradjacent_exportedre_analyzedfinal_errorCovers
TV-002-001ADJ_CTtruetrueADJ_CTAC: Error persists after export and re-analysis
TV-002-002ADJ_CTtruefalseADJ_CTAC: Error persists after export only
TV-002-003ADJ_CTfalsetrueADJ_CTAC: Error persists after re-analysis only
TV-002-004nullfalsetruenullAC: No false positives on re-analysis

REQ-RULES-ADJ-003: Error Resolution

Decision Table: Resolution via Manage Outcomes

TVinitial_errorresolution_actionconfig.resolution_codesfinal_errorCovers
TV-003-001ADJ_CTresolve[RESOLVED_OK, REPEAT]nullAC: Error resolvable via Manage Outcomes
TV-003-002ADJ_CTresolve[]ADJ_CTAC: No resolution codes configured
TV-003-003nullresolve[RESOLVED_OK]nullAC: No error to resolve

REQ-RULES-ADJ-004: Audit Logging

Decision Table: Configuration Change Audit Entries

TVactionfield_changedvalue_beforevalue_afteraudit.areaaudit.change_typeaudit.actionCovers
TV-004-001setcontaminating_ctnull25ConfigurationContaminationSet Contamination CtAC: New contaminating threshold logged
TV-004-002setcontaminated_ctnull35ConfigurationContaminationSet Contaminated CtAC: New contaminated threshold logged
TV-004-003updatecontaminating_ct2528ConfigurationContaminationSet Contamination CtAC: Updated contaminating threshold logged
TV-004-004updatecontaminated_ct3538ConfigurationContaminationSet Contaminated CtAC: Updated contaminated threshold logged

REQ-RULES-ADJ-005: Quant-Based Detection

Decision Table: Quant-Based Cross-Contamination Detection

TVconfig.quant_or_ctwell.quantityconfig.contaminated_quantwell < thresholdadjacent.quantityconfig.contaminating_quantadjacent > thresholdsame_targeterror_codeCovers
TV-005-001Quant100200true600400truetrueADJ_CTAC: Quant-based detection (HEV example)
TV-005-002Quant300200false600400truetruenullAC: Well quant above contaminated threshold
TV-005-003Quant100200true300400falsetruenullAC: Adjacent quant below contaminating threshold
TV-005-004Quant100200true600400truefalsenullAC: Different targets - no detection
TV-005-005Ct100200-600400-truenullAC: Quant values ignored when mode is Ct
TV-005-006Quant100200true600400truetrueADJ_CTAC: ZIKA assay support verified

REQ-RULES-ADJ-006: Missing Configuration Handling

Decision Table: Missing Threshold Detection

TVconfig.potential_contaminated_ctconfig.potential_contaminating_ctconfig.quant_or_cterror_codeCovers
TV-006-001null25CtADJ_LIMITS_MISSEDAC: Missing contaminated_ct
TV-006-00235nullCtADJ_LIMITS_MISSEDAC: Missing contaminating_ct
TV-006-003nullnullCtADJ_LIMITS_MISSEDAC: Both thresholds missing
TV-006-0043525CtnullAC: Both thresholds present - no error

Traceability to Existing Tests

RequirementJira TestsStatus
REQ-RULES-ADJ-001BT-5134, BT-5143, BT-5155Existing
REQ-RULES-ADJ-002BT-5638Existing
REQ-RULES-ADJ-003BT-5134, BT-5143Existing
REQ-RULES-ADJ-004-Gap (no audit-specific tests identified)
REQ-RULES-ADJ-005BT-5155, BT-5157Existing
REQ-RULES-ADJ-006-Gap (no missing-config tests identified)

Note: Prior references to BT-146, BT-226, BT-690-694, BT-4148, BT-4154, BT-4167, BT-4303, BT-4313 were requirement/story tickets, not test tickets. Actual test coverage mapped from feature catalogue.


Gap Analysis

Identified Gaps

GapRequirementDescriptionPriority
GAP-001REQ-RULES-ADJ-004No audit logging tests identified in existing test suiteMedium
GAP-002REQ-RULES-ADJ-006No missing configuration handling tests identifiedMedium

Remediation Plan

  1. GAP-001 (Audit Logging): Review BT-5134/BT-5143 fixtures for audit assertions or create dedicated audit verification tests
  2. GAP-002 (Missing Config): Create test scenarios with null threshold configurations to verify ADJ_LIMITS_MISSED error behavior