STD: Well Discrepant Classification Rule (WDCLS)
Version: v1.0.0
Status: Draft
SRS Source: docusaurus/docs/srs/rules/rule-wdcls.md
Rule Name: WDCLS
Domain: RULES-WDCLS
Overview
This document specifies tests for the WDCLS (Well Discrepant Classification) rule using decision tables and test vectors. The rule detects classification discrepancies between pcr.ai and machine classifications for Patient wells.
Rule Characteristics:
- Pure business logic (no UI)
- Applies exclusively to Patient wells (not controls)
- Two threshold-based modifiers (CT suppression, fluorescence skip)
- Ordered evaluation: fluorescence check -> classification comparison -> CT check
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-WDCLS-001 | Core Discrepancy Detection | 6 | 8 | 100% | None |
| REQ-RULES-WDCLS-002 | CT Threshold Suppression | 4 | 6 | 100% | None |
| REQ-RULES-WDCLS-003 | Fluorescence Threshold Skip | 3 | 5 | 100% | None |
Totals: 3 REQs, 13 Conditions, 19 Test Vectors, 100% Coverage
| Variable | Type | Valid Values | Description |
|---|
well.type | string | Patient, Control | Well type (rule applies only to Patient) |
obs.pcrai_cls | string | Positive, Negative, Ambiguous, ... | pcr.ai classification |
obs.machine_cls | string | Positive, Negative, Ambiguous, ... | Machine classification |
obs.final_ct | float | numeric, null | Final cycle threshold value |
max(obs.readings) | float | numeric | Maximum fluorescence reading value |
target.max_ct_for_cls_discrepancy | float? | null, numeric | CT threshold for suppression |
target.minimum_fluorescence_to_positive | float? | null, numeric | Minimum fluorescence threshold |
Output Variables
| Variable | Type | Description |
|---|
discrepancy_error | bool | Whether discrepancy error is flagged on well |
rule_skipped | bool | Whether rule was skipped due to fluorescence threshold |
error_suppressed | bool | Whether error was suppressed due to CT threshold |
REQ-RULES-WDCLS-001: Core Discrepancy Detection
Decision Table: Well Type Filter
| TV | well.type | rule_applies | Covers |
|---|
| TV-001-001 | Patient | true | AC: Rule applies to Patient wells |
| TV-001-002 | Control | false | AC: Rule not applied to control wells |
Decision Table: Classification Comparison
| TV | well.type | pcrai_cls | machine_cls | thresholds_met | discrepancy_error | Covers |
|---|
| TV-001-003 | Patient | Positive | Negative | true | true | AC: Different classifications = error |
| TV-001-004 | Patient | Negative | Positive | true | true | AC: Different classifications = error |
| TV-001-005 | Patient | Positive | Positive | true | false | AC: Same classifications = no error |
| TV-001-006 | Patient | Negative | Negative | true | false | AC: Same classifications = no error |
| TV-001-007 | Patient | Ambiguous | Positive | true | true | AC: Different classifications = error |
| TV-001-008 | Patient | Ambiguous | Ambiguous | true | false | AC: Same classifications = no error |
REQ-RULES-WDCLS-002: CT Threshold Suppression
Decision Table: CT Threshold Logic
| TV | max_ct_for_cls_discrepancy | final_ct | classifications_differ | discrepancy_error | Covers |
|---|
| TV-002-001 | null | 36 | true | true | AC: Null threshold = no suppression |
| TV-002-002 | 35 | 36 | true | false | AC: CT > threshold = suppressed |
| TV-002-003 | 36 | 36 | true | false | AC: CT == threshold = suppressed (boundary) |
| TV-002-004 | 37 | 36 | true | true | AC: CT < threshold = not suppressed |
| TV-002-005 | 35 | 34 | true | true | AC: CT below threshold = not suppressed |
| TV-002-006 | null | 36 | false | false | AC: No discrepancy = no error regardless |
REQ-RULES-WDCLS-003: Fluorescence Threshold Skip
Decision Table: Fluorescence Threshold Logic
| TV | min_fluorescence_to_positive | max_reading | rule_skipped | Covers |
|---|
| TV-003-001 | 100 | 99 | true | AC: Below threshold = rule skipped |
| TV-003-002 | 100 | 100 | false | AC: Equals threshold = rule evaluates (boundary) |
| TV-003-003 | 100 | 101 | false | AC: Above threshold = rule evaluates |
| TV-003-004 | null | 50 | false | AC: Null threshold = rule evaluates |
| TV-003-005 | null | 150 | false | AC: Null threshold = rule evaluates |
Integrated Scenarios
Decision Table: Full Rule Evaluation Flow
These vectors verify the complete evaluation path through all three requirements.
| TV | well.type | max_reading | min_fluor | pcrai_cls | machine_cls | final_ct | max_ct | discrepancy_error | reason | Covers |
|---|
| TV-INT-001 | Control | 150 | 100 | Pos | Neg | 30 | null | false | Control well excluded | REQ-001 |
| TV-INT-002 | Patient | 50 | 100 | Pos | Neg | 30 | null | false | Fluorescence too low | REQ-003 |
| TV-INT-003 | Patient | 150 | 100 | Pos | Pos | 30 | null | false | Classifications match | REQ-001 |
| TV-INT-004 | Patient | 150 | 100 | Pos | Neg | 30 | null | true | Discrepancy detected | REQ-001 |
| TV-INT-005 | Patient | 150 | 100 | Pos | Neg | 40 | 35 | false | CT above threshold | REQ-002 |
| TV-INT-006 | Patient | 150 | 100 | Pos | Neg | 30 | 35 | true | CT below threshold | REQ-002 |
| TV-INT-007 | Patient | 150 | null | Pos | Neg | 40 | null | true | Both thresholds null | REQ-001,002,003 |
| TV-INT-008 | Patient | 100 | 100 | Pos | Neg | 35 | 35 | false | Both at boundary | REQ-002,003 |
Boundary Value Analysis
CT Threshold Boundaries
| TV | Scenario | max_ct | final_ct | Expected | Covers |
|---|
| TV-BND-001 | CT exactly at threshold | 35.0 | 35.0 | Suppressed | REQ-002 boundary |
| TV-BND-002 | CT just below threshold | 35.0 | 34.99 | Error flagged | REQ-002 boundary |
| TV-BND-003 | CT just above threshold | 35.0 | 35.01 | Suppressed | REQ-002 boundary |
Fluorescence Threshold Boundaries
| TV | Scenario | min_fluor | max_reading | Expected | Covers |
|---|
| TV-BND-004 | Reading exactly at threshold | 100 | 100 | Evaluates | REQ-003 boundary |
| TV-BND-005 | Reading just below threshold | 100 | 99.99 | Skipped | REQ-003 boundary |
| TV-BND-006 | Reading just above threshold | 100 | 100.01 | Evaluates | REQ-003 boundary |
Automation Mapping
| Test Vector Range | Test File | Method | Automation Status |
|---|
| TV-001-* | tests/Unit/Rules/WdclsRuleTest.php | TM-API | Automated |
| TV-002-* | tests/Unit/Rules/WdclsRuleTest.php | TM-API | Automated |
| TV-003-* | tests/Unit/Rules/WdclsRuleTest.php | TM-API | Automated |
| TV-INT-* | tests/Unit/Rules/WdclsRuleTest.php | TM-API | Automated |
| TV-BND-* | tests/Unit/Rules/WdclsRuleTest.php | TM-API | Automated |
Traceability to Existing Tests
| Requirement | Jira Tests | Status |
|---|
| REQ-RULES-WDCLS-001 | BT-5133, BT-5221, BT-5238 | Existing |
| REQ-RULES-WDCLS-002 | BT-5229, BT-5237 | Existing |
| REQ-RULES-WDCLS-003 | BT-5369, BT-5700 | Existing |
Gap Analysis
Identified Gaps
| Gap | Requirement | Description | Priority | Owner |
|---|
| None | - | All requirements have Jira test coverage | - | - |
Verification Notes
- REQ-RULES-WDCLS-001: Core discrepancy detection covered by BT-5133 (v3 Quest_ez_pp_v30.xlsx), BT-5221, BT-5238 (v2 Quest_220_beta15.xlsx)
- REQ-RULES-WDCLS-002: CT threshold suppression covered by BT-5229, BT-5237 (Quest configs)
- REQ-RULES-WDCLS-003: Fluorescence threshold skip covered by BT-5369 (Idea_config 3.0.1.xlsx), BT-5700 (kit-configuration.xlsx)
All test vectors map to existing Jira test tickets. No new test tickets required.