STD: Negative Control Validation Rule (NEC)
Version: v1.0.0 Status: Draft SRS Source:
docusaurus/docs/srs/rules/rule-nec.mdRule 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 ID | Title | Conditions | Test Vectors | Coverage | Gaps |
|---|---|---|---|---|---|
| REQ-RULES-NEC-001 | Validate Negative Control Well Classification | 8 | 10 | 100% | None |
Totals: 1 REQ, 8 Conditions, 10 Test Vectors, 100% Coverage
REQ-RULES-NEC-001: Validate Negative Control Well Classification
Input Variables
| Variable | Type | Valid Values | Description |
|---|---|---|---|
well.type | string | NEC, NEG, SAMPLE, PEC, ... | Well type classification |
well.classification | string | Positive, Negative | Final classification result for the well |
Output Variables
| Variable | Type | Description |
|---|---|---|
validation.passed | bool | Whether NEC validation passed |
well.error_codes | array | Error codes assigned to well (empty if passed) |
target.error_codes | array | Error codes assigned to target (empty if passed) |
Constants
| Constant | Value | Description |
|---|---|---|
NEC_FAILURE_WELL | Error code | Well-level error for failed NEC validation |
NEC_FAILURE_TARGET | Error code | Target-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"
| TV | well.type | rule_applies | Covers |
|---|---|---|---|
| TV-NEC-001 | NEC | true | AC: NEC type triggers rule |
| TV-NEC-002 | NEG | true | AC: NEG type triggers rule |
| TV-NEC-003 | SAMPLE | false | AC: Non-control type skipped |
| TV-NEC-004 | PEC | false | AC: 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"
| TV | well.type | well.classification | validation.passed | well.error_codes | target.error_codes | Covers |
|---|---|---|---|---|---|---|
| TV-NEC-005 | NEC | Negative | true | [] | [] | AC: NEC with negative classification passes |
| TV-NEC-006 | NEG | Negative | true | [] | [] | 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"
| TV | well.type | well.classification | validation.passed | well.error_codes | target.error_codes | Covers |
|---|---|---|---|---|---|---|
| TV-NEC-007 | NEC | Positive | false | [NEC_FAILURE_WELL] | [NEC_FAILURE_TARGET] | AC: NEC with positive fails, both error codes set |
| TV-NEC-008 | NEG | Positive | false | [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"
| TV | well.type | well.classification | rule_applies | validation.passed | well.error_codes | Covers |
|---|---|---|---|---|---|---|
| TV-NEC-009 | SAMPLE | Positive | false | N/A (skipped) | [] | AC: Positive sample not evaluated by NEC rule |
| TV-NEC-010 | SAMPLE | Negative | false | N/A (skipped) | [] | AC: Negative sample not evaluated by NEC rule |
Complete Decision Matrix
Full combinatorial coverage of all input conditions:
| TV | well.type | well.classification | rule_applies | validation.passed | NEC_FAILURE_WELL | NEC_FAILURE_TARGET |
|---|---|---|---|---|---|---|
| TV-NEC-005 | NEC | Negative | true | true | No | No |
| TV-NEC-006 | NEG | Negative | true | true | No | No |
| TV-NEC-007 | NEC | Positive | true | false | Yes | Yes |
| TV-NEC-008 | NEG | Positive | true | false | Yes | Yes |
| TV-NEC-009 | SAMPLE | Positive | false | N/A | No | No |
| TV-NEC-010 | SAMPLE | Negative | false | N/A | No | No |
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
| Requirement | Test File | Method | Automation Status |
|---|---|---|---|
| REQ-RULES-NEC-001 | tests/Unit/Rules/BncRuleTest.php | TM-API | Automated |
Traceability to Existing Tests
| Requirement | Jira Tests | Status |
|---|---|---|
| REQ-RULES-NEC-001 | BT-5136, BT-5142 | Existing |
Gap Analysis
Identified Gaps
| Gap | Requirement | Description | Priority | Owner |
|---|---|---|---|---|
| - | - | 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)