Skip to main content
Version: 3.0.0

STD: Negative Control Validation Rule (NEC)

Version: v1.0.0 Status: Draft SRS Source: docusaurus/docs/srs/rules/rule-nec.md Rule Name: BNC (Negative controls are valid) Domain: RULES-NEC


Overview

This document specifies tests for the Negative Control Validation rule using decision tables and test vectors. The rule validates that negative control wells (NEC and NEG types) do not produce positive classification results, failing the validation with specific error codes when a positive classification is detected.

Rule Characteristics:

  • Pure business logic (no UI)
  • Simple binary decision (well type + classification)
  • Fixed behavior (no configuration options)
  • Error code assignment at both well and target levels

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-NEC-001Validate Negative Control Well Classification810100%None

Totals: 1 REQ, 8 Conditions, 10 Test Vectors, 100% Coverage


REQ-RULES-NEC-001: Validate Negative Control Well Classification

Input Variables

VariableTypeValid ValuesDescription
well.typestringNEC, NEG, SAMPLE, PEC, ...Well type classification
well.classificationstringPositive, NegativeFinal classification result for the well

Output Variables

VariableTypeDescription
validation.passedboolWhether NEC validation passed
well.error_codesarrayError codes assigned to well (empty if passed)
target.error_codesarrayError codes assigned to target (empty if passed)

Constants

ConstantValueDescription
NEC_FAILURE_WELLError codeWell-level error for failed NEC validation
NEC_FAILURE_TARGETError codeTarget-level error for failed NEC validation

Decision Table: Scope and Applicability

Tests AC: "The NEC rule shall apply only to well types NEC and NEG" and "The system shall not apply the NEC rule to non-control well types"

TVwell.typerule_appliesCovers
TV-NEC-001NECtrueAC: NEC type triggers rule
TV-NEC-002NEGtrueAC: NEG type triggers rule
TV-NEC-003SAMPLEfalseAC: Non-control type skipped
TV-NEC-004PECfalseAC: Non-control type skipped

Decision Table: Pass Conditions

Tests AC: "Given a negative control well with a negative classification, the system shall pass the NEC validation"

TVwell.typewell.classificationvalidation.passedwell.error_codestarget.error_codesCovers
TV-NEC-005NECNegativetrue[][]AC: NEC with negative classification passes
TV-NEC-006NEGNegativetrue[][]AC: NEG with negative classification passes

Decision Table: Fail Conditions

Tests AC: "Given a negative control well with a positive classification, the system shall fail the well with an error"

TVwell.typewell.classificationvalidation.passedwell.error_codestarget.error_codesCovers
TV-NEC-007NECPositivefalse[NEC_FAILURE_WELL][NEC_FAILURE_TARGET]AC: NEC with positive fails, both error codes set
TV-NEC-008NEGPositivefalse[NEC_FAILURE_WELL][NEC_FAILURE_TARGET]AC: NEG with positive fails, both error codes set

Decision Table: Non-Control Well Behavior

Tests AC: "The system shall not apply the NEC rule to non-control well types"

TVwell.typewell.classificationrule_appliesvalidation.passedwell.error_codesCovers
TV-NEC-009SAMPLEPositivefalseN/A (skipped)[]AC: Positive sample not evaluated by NEC rule
TV-NEC-010SAMPLENegativefalseN/A (skipped)[]AC: Negative sample not evaluated by NEC rule

Complete Decision Matrix

Full combinatorial coverage of all input conditions:

TVwell.typewell.classificationrule_appliesvalidation.passedNEC_FAILURE_WELLNEC_FAILURE_TARGET
TV-NEC-005NECNegativetruetrueNoNo
TV-NEC-006NEGNegativetruetrueNoNo
TV-NEC-007NECPositivetruefalseYesYes
TV-NEC-008NEGPositivetruefalseYesYes
TV-NEC-009SAMPLEPositivefalseN/ANoNo
TV-NEC-010SAMPLENegativefalseN/ANoNo

Notes:

  • When rule_applies = false, the rule does not evaluate the well; no validation outcome is produced
  • Error codes are always assigned as a pair (both well-level and target-level) when validation fails
  • The rule executes after classification results are available but before final results are reported

Test File Locations

RequirementTest FileMethodAutomation Status
REQ-RULES-NEC-001tests/Unit/Rules/BncRuleTest.phpTM-APIAutomated

Traceability to Existing Tests

RequirementJira TestsStatus
REQ-RULES-NEC-001BT-5136, BT-5142Existing

Gap Analysis

Identified Gaps

GapRequirementDescriptionPriorityOwner
--No gaps identified--

Coverage Notes

All acceptance criteria from REQ-RULES-NEC-001 are covered by test vectors:

  • Scope/Applicability (4 ACs): TV-NEC-001 through TV-NEC-004
  • Pass Conditions (2 ACs): TV-NEC-005, TV-NEC-006
  • Fail Conditions (2 ACs): TV-NEC-007, TV-NEC-008
  • Error Code Assignment (2 ACs): Covered by TV-NEC-007, TV-NEC-008 (both error codes verified)