STD: WDCT Rule (CT Discrepancy Detection)
Version: v1.0.0
Status: Draft
SRS Source: docusaurus/docs/srs/rules/rule-wdct.md
Rule Name: WDCT
Domain: RULES-WDCT
Overview
This document specifies tests for the WDCT rule using decision tables and test vectors. The rule detects CT (Cycle Threshold) discrepancies between pcr.ai-calculated values and machine-reported CT values for Patient wells, flagging wells where the absolute difference exceeds the configured ct_discrepancy_delta threshold.
Rule Characteristics:
- Pure business logic (no UI)
- Sequential condition evaluation (fluorescence -> classification -> max CT threshold -> CT difference)
- Two configuration-based modifiers (suppression and skip)
- Patient wells only (Control wells delegated to WDCTC)
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 ID | Title | Conditions | Test Vectors | Coverage | Gaps |
|---|
| REQ-RULES-WDCT-001 | CT Discrepancy Detection | 11 | 17 | 100% | None |
| REQ-RULES-WDCT-002 | Max CT Threshold Suppression | 4 | 5 | 100% | None |
| REQ-RULES-WDCT-003 | Fluorescence-Based Skip | 3 | 4 | 100% | None |
Totals: 3 REQs, 18 Conditions, 26 Test Vectors, 100% Coverage
| Variable | Type | Valid Values | Description |
|---|
well.type | string | Patient, Control | Well classification type |
obs.classification | string | Positive, Negative, Ambiguous | Observation classification result |
obs.pcrai_ct | float | numeric | CT value calculated by pcr.ai algorithm |
obs.machine_ct | float | numeric | CT value reported by thermocycler instrument |
obs.final_ct | float | numeric | Authoritative CT value for downstream analysis |
obs.max_reading | float | numeric | max(observation.readings) - highest fluorescence reading |
target.ct_discrepancy_delta | float? | null, numeric | Configurable threshold for CT difference detection; null disables rule for target |
target.max_ct_for_ct_discrepancy | float? | null, numeric | Maximum CT value above which CT discrepancy checks are suppressed |
target.minimum_fluorescence_to_positive | float | numeric | Minimum fluorescence threshold for rule evaluation |
Output Variables
| Variable | Type | Description |
|---|
well.error_code | string? | CTDISC_WELL if discrepancy detected, null otherwise |
rule_evaluated | bool | Whether the rule completed evaluation (false if skipped) |
error_suppressed | bool | Whether an error was suppressed by threshold |
REQ-RULES-WDCT-001: CT Discrepancy Detection
Decision Table: Well Type Filter
| TV | well.type | rule_applies | Covers |
|---|
| TV-001-001 | Patient | true | AC: Apply rule to Patient wells |
| TV-001-002 | Control | false | AC: Delegate control wells to WDCTC |
Decision Table: Classification Handling
| TV | obs.classification | ct_diff | error_code | Covers |
|---|
| TV-001-003 | Negative | 5.0 | null | AC: Skip discrepancy detection for negative classification |
| TV-001-004 | Positive | 5.0 | CTDISC_WELL | AC: Compare CTs for non-negative classification |
| TV-001-005 | Ambiguous | 5.0 | CTDISC_WELL | AC: Compare CTs for non-negative classification |
Decision Table: CT Difference Threshold (Default ct_discrepancy_delta=2)
Note: These test vectors assume ct_discrepancy_delta=2 (the default threshold). See "Configurable Threshold" table below for variable threshold tests.
| TV | obs.pcrai_ct | obs.machine_ct | abs_diff | error_code | Covers |
|---|
| TV-001-006 | 25.0 | 28.5 | 3.5 | CTDISC_WELL | AC: Flag when abs diff > threshold |
| TV-001-007 | 25.0 | 22.0 | 3.0 | CTDISC_WELL | AC: Flag when abs diff > threshold (negative direction) |
| TV-001-008 | 25.0 | 26.5 | 1.5 | null | AC: No error when abs diff <= threshold |
| TV-001-009 | 25.0 | 27.0 | 2.0 | null | AC: No error when abs diff = threshold (boundary) |
| TV-001-010 | 25.0 | 27.01 | 2.01 | CTDISC_WELL | AC: Flag when abs diff > threshold (boundary exceeded) |
Decision Table: Configurable Threshold (ct_discrepancy_delta)
| TV | ct_discrepancy_delta | obs.pcrai_ct | obs.machine_ct | ct_diff | error_code | Covers |
|---|
| TV-001-011 | null | 25.0 | 35.0 | 10.0 | null | AC: Null threshold disables rule for target |
| TV-001-012 | 3 | 25.0 | 27.5 | 2.5 | null | AC: No error when diff within threshold=3 |
| TV-001-013 | 3 | 25.0 | 28.5 | 3.5 | CTDISC_WELL | AC: Flag when diff exceeds threshold=3 |
| TV-001-014 | 5 | 25.0 | 29.9 | 4.9 | null | AC: No error when diff within larger threshold=5 |
| TV-001-015 | 5 | 25.0 | 30.1 | 5.1 | CTDISC_WELL | AC: Flag when diff exceeds larger threshold=5 |
| TV-001-016 | 2 | 25.0 | 27.0 | 2.0 | null | AC: No error when diff equals threshold (boundary) |
| TV-001-017 | 2 | 25.0 | 27.01 | 2.01 | CTDISC_WELL | AC: Flag when diff just exceeds threshold (boundary) |
REQ-RULES-WDCT-002: Max CT Threshold Suppression
Decision Table: Suppression Logic
| TV | max_ct_for_ct_discrepancy | obs.final_ct | ct_diff | error_code | error_suppressed | Covers |
|---|
| TV-002-001 | null | 36.0 | 5.0 | CTDISC_WELL | false | AC: Null threshold = no suppression |
| TV-002-002 | 35 | 36.0 | 5.0 | null | true | AC: final_ct > threshold = suppressed |
| TV-002-003 | 36 | 36.0 | 5.0 | null | true | AC: final_ct = threshold = suppressed (>=) |
| TV-002-004 | 37 | 36.0 | 5.0 | CTDISC_WELL | false | AC: final_ct < threshold = not suppressed |
| TV-002-005 | 35 | 34.0 | 5.0 | CTDISC_WELL | false | AC: final_ct below threshold = not suppressed |
REQ-RULES-WDCT-003: Fluorescence-Based Skip
Decision Table: Minimum Fluorescence Check
| TV | minimum_fluorescence_to_positive | obs.max_reading | rule_evaluated | Covers |
|---|
| TV-003-001 | 100 | 99 | false | AC: Skip rule when max reading < threshold |
| TV-003-002 | 100 | 100 | true | AC: Evaluate rule when max reading = threshold |
| TV-003-003 | 100 | 150 | true | AC: Evaluate rule when max reading > threshold |
| TV-003-004 | 100 | 50 | false | AC: Skip to prevent false discrepancy errors on low fluorescence |
Combined Evaluation: End-to-End Scenarios
The following decision table tests the complete rule evaluation path, verifying the execution order: fluorescence check (003) -> classification -> max CT threshold (002) -> CT difference (001).
Decision Table: Full Evaluation Path
| TV | max_reading | min_fluor | classification | final_ct | max_ct_thresh | pcrai_ct | machine_ct | rule_evaluated | error_suppressed | error_code | Covers |
|---|
| TV-E2E-001 | 50 | 100 | Positive | 25.0 | null | 25.0 | 30.0 | false | false | null | AC: Fluorescence skip takes precedence |
| TV-E2E-002 | 150 | 100 | Negative | 25.0 | null | 25.0 | 30.0 | true | false | null | AC: Negative classification ends without error |
| TV-E2E-003 | 150 | 100 | Positive | 36.0 | 35 | 25.0 | 30.0 | true | true | null | AC: Max CT threshold suppresses error |
| TV-E2E-004 | 150 | 100 | Positive | 34.0 | 35 | 25.0 | 30.0 | true | false | CTDISC_WELL | AC: All checks pass, error flagged |
| TV-E2E-005 | 150 | 100 | Positive | 34.0 | null | 25.0 | 26.0 | true | false | null | AC: All checks pass, within tolerance |
Automation Status
| REQ ID | Automation Status | Notes |
|---|
| REQ-RULES-WDCT-001 | Automated | Data-driven test with parameterized inputs |
| REQ-RULES-WDCT-002 | Automated | Data-driven test with parameterized inputs |
| REQ-RULES-WDCT-003 | Automated | Data-driven test with parameterized inputs |
Traceability to Existing Tests
| Requirement | Jira Tests | Status |
|---|
| REQ-RULES-WDCT-001 | BT-5133, BT-5305, BT-5244, BT-5328, BT-5261, BT-5700, BT-5369 | Existing |
| REQ-RULES-WDCT-002 | BT-5308, BT-5307 | Existing |
| REQ-RULES-WDCT-003 | BT-5368, BT-5367 | Existing |
Gap Analysis
Identified Gaps
| Gap | Requirement | Description | Priority | Owner |
|---|
| None | - | All acceptance criteria have corresponding test vectors | - | - |
No gaps identified. All requirements have:
- Complete condition coverage via decision tables
- Boundary value testing for thresholds
- End-to-end integration scenarios
- Traceability to existing Jira test tickets