STD: WDCLSC Rule (Well Discrepant Classification Control)
Version: v1.0.0
Status: Draft
SRS Source: docusaurus/docs/srs/rules/rule-wdclsc.md
Rule Name: WDCLSC
Domain: RULES-WDCLSC
Overview
This document specifies tests for the WDCLSC rule using decision tables and test vectors. The rule detects classification discrepancies between pcr.ai and machine classification on control wells.
Rule Characteristics:
- Pure business logic (no UI)
- Sequential evaluation (fluorescence check, then CT check, then comparison)
- Two exemption/skip conditions with specific boundary behaviors
- Applies only to control wells
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. The evaluation order (fluorescence first, CT second, comparison last) is tested through combined condition scenarios.
Coverage Summary
| REQ ID | Title | Conditions | Test Vectors | Coverage | Gaps |
|---|
| REQ-RULES-WDCLSC-001 | Core Classification Discrepancy Detection | 4 | 6 | 100% | None |
| REQ-RULES-WDCLSC-002 | Max CT Threshold Exemption | 5 | 6 | 100% | None |
| REQ-RULES-WDCLSC-003 | Minimum Fluorescence Skip Condition | 3 | 4 | 100% | None |
Totals: 3 REQs, 12 Conditions, 16 Test Vectors, 100% Coverage
| Variable | Type | Valid Values | Description |
|---|
well.type | string | Control, Sample, NEC, PEC | Well designation type |
obs.pcraiCls | string | Positive, Negative, Ambiguous | pcr.ai classification result |
obs.machineCls | string | Positive, Negative, Ambiguous | Machine classification result |
obs.final_ct | float | numeric | Final cycle threshold value |
obs.readings | array | [float, ...] | Fluorescence readings array |
target.max_ct_for_cls_discrepancy | float? | null, numeric | Max CT threshold for exemption |
target.minimum_fluorescence_to_positive | float | numeric | Minimum fluorescence threshold |
Output Variables
| Variable | Type | Description |
|---|
rule.executed | bool | Whether the rule was evaluated (not skipped) |
well.discrepancy_error | bool | Whether discrepancy error was applied |
REQ-RULES-WDCLSC-001: Core Classification Discrepancy Detection
Acceptance Criteria Mapping
| AC ID | Acceptance Criteria | Test Vectors |
|---|
| AC-001-1 | Rule applies only to Control wells | TV-001-001, TV-001-002 |
| AC-001-2 | When pcr.ai differs from machine, apply discrepancy error | TV-001-003, TV-001-004 |
| AC-001-3 | When pcr.ai matches machine, no discrepancy error | TV-001-005, TV-001-006 |
Decision Table: Well Type Scope
| TV | well.type | rule_applies | Covers |
|---|
| TV-001-001 | Control | true | AC-001-1: Control wells in scope |
| TV-001-002 | Sample | false | AC-001-1: Non-control wells out of scope |
Decision Table: Classification Comparison
Preconditions: well.type = Control, no skip/exemption conditions apply
| TV | obs.pcraiCls | obs.machineCls | discrepancy_error | Covers |
|---|
| TV-001-003 | Positive | Negative | true | AC-001-2: Classifications differ |
| TV-001-004 | Negative | Positive | true | AC-001-2: Classifications differ (inverse) |
| TV-001-005 | Positive | Positive | false | AC-001-3: Classifications match |
| TV-001-006 | Negative | Negative | false | AC-001-3: Classifications match |
REQ-RULES-WDCLSC-002: Max CT Threshold Exemption
Acceptance Criteria Mapping
| AC ID | Acceptance Criteria | Test Vectors |
|---|
| AC-002-1 | Uses config parameter target.max_ct_for_cls_discrepancy | TV-002-001 through TV-002-006 |
| AC-002-2 | When config is null, exemption does not apply | TV-002-001 |
| AC-002-3 | final_ct > threshold: exempt (no error) | TV-002-002 |
| AC-002-4 | final_ct = threshold: exempt (no error, boundary) | TV-002-003 |
| AC-002-5 | final_ct < threshold: exemption does not apply | TV-002-004 |
Decision Table: Max CT Exemption
Preconditions: well.type = Control, max(readings) >= minimum_fluorescence_to_positive, classifications differ
| TV | max_ct_for_cls_discrepancy | obs.final_ct | exempt | discrepancy_error | Covers |
|---|
| TV-002-001 | null | 36 | false | true | AC-002-2: Config null, no exemption |
| TV-002-002 | 35 | 36 | true | false | AC-002-3: CT exceeds threshold |
| TV-002-003 | 36 | 36 | true | false | AC-002-4: CT equals threshold (boundary) |
| TV-002-004 | 37 | 36 | false | true | AC-002-5: CT below threshold |
| TV-002-005 | 35 | 35.001 | true | false | AC-002-3: CT marginally above |
| TV-002-006 | 35 | 34.999 | false | true | AC-002-5: CT marginally below |
REQ-RULES-WDCLSC-003: Minimum Fluorescence Skip Condition
Acceptance Criteria Mapping
| AC ID | Acceptance Criteria | Test Vectors |
|---|
| AC-003-1 | Uses config parameter target.minimum_fluorescence_to_positive | TV-003-001 through TV-003-004 |
| AC-003-2 | max(readings) < threshold: rule skipped entirely | TV-003-001 |
| AC-003-3 | max(readings) >= threshold: rule proceeds | TV-003-002, TV-003-003 |
Decision Table: Minimum Fluorescence Skip
Preconditions: well.type = Control
| TV | minimum_fluorescence_to_positive | max(obs.readings) | rule_executed | discrepancy_error | Covers |
|---|
| TV-003-001 | 100 | 99 | false | false | AC-003-2: Below threshold, skipped |
| TV-003-002 | 100 | 100 | true | depends on CLS | AC-003-3: At threshold (boundary), proceeds |
| TV-003-003 | 100 | 101 | true | depends on CLS | AC-003-3: Above threshold, proceeds |
| TV-003-004 | 100 | 50 | false | false | AC-003-2: Well below threshold |
Combined Scenario Testing
Decision Table: Evaluation Order Verification
These vectors verify that evaluation order is: fluorescence check first, then CT check, then classification comparison.
| TV | max(readings) | min_fluor | final_ct | max_ct_cfg | pcraiCls | machineCls | rule_exec | error | Covers |
|---|
| TV-CMB-001 | 50 | 100 | 36 | 35 | Pos | Neg | false | false | Fluor skip overrides CT exemption check |
| TV-CMB-002 | 150 | 100 | 36 | 35 | Pos | Neg | true | false | CT exemption applies when fluor passes |
| TV-CMB-003 | 150 | 100 | 34 | 35 | Pos | Neg | true | true | No exemption, error applied |
| TV-CMB-004 | 150 | 100 | 34 | null | Pos | Pos | true | false | CLS match, no error |
Traceability to Existing Tests
| Requirement | Jira Tests | Status |
|---|
| REQ-RULES-WDCLSC-001 | Pending | Gap |
| REQ-RULES-WDCLSC-002 | BT-5229 | Existing |
| REQ-RULES-WDCLSC-003 | Pending | Gap |
Automation Status
| REQ ID | Status | Notes |
|---|
| REQ-RULES-WDCLSC-001 | Automated | Core rule logic |
| REQ-RULES-WDCLSC-002 | Automated | CT exemption logic |
| REQ-RULES-WDCLSC-003 | Automated | Fluorescence skip logic |
Gap Analysis
Identified Gaps
| Gap | Requirement | Description | Priority | Owner |
|---|
| GAP-001 | REQ-RULES-WDCLSC-001 | No Jira test ticket for core discrepancy detection | High | TBD |
| GAP-002 | REQ-RULES-WDCLSC-003 | No Jira test ticket for minimum fluorescence skip | Medium | TBD |
- GAP-001: Create test ticket covering TV-001-001 through TV-001-006
- GAP-002: Create test ticket covering TV-003-001 through TV-003-004