STD: CC Rule (BCC - Curve Control)
Version: v1.0.0
Status: Draft
SRS Source: docusaurus/docs/srs/rules/rule-cc.md
Rule Name: BCC (Curve Control)
Domain: RULES-CC
Overview
This document specifies tests for the BCC (Curve Control) rule using decision tables and test vectors. The rule validates that positive classifications have CT values within configured control range bounds, with explicit error handling for missing configuration.
Rule Characteristics:
- Pure business logic (no UI)
- Sequential validation (config check → classification check → CT bounds check)
- Dual-level error application (well and target)
- Explicit failure on missing configuration
Test Method: TM-API (per Test Plan §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-CC-001 | Validate Curve Control via Classification and CT Bounds | 6 | 12 | 100% | None |
| REQ-RULES-CC-002 | Set Error When Control Range Configuration Missing | 3 | 4 | 100% | None |
Totals: 2 REQs, 9 Conditions, 16 Test Vectors, 100% Coverage
| Variable | Type | Valid Values | Description |
|---|
config.exists | bool | true, false | Control range settings exist for role-to-target mapping |
config.upper_bound | float | numeric | Maximum acceptable CT value |
config.lower_bound | float | numeric | Minimum acceptable CT value |
obs.classification | string | Positive, Negative | Observation classification result |
obs.ct | float | numeric | Observation CT (Cycle Threshold) value |
obs.role_to_target_mapping | string | any | Links observation to control range settings |
Output Variables
| Variable | Type | Description |
|---|
well.error_code | string? | Error code set on well (null if pass) |
target.error_code | string? | Error code set on target (null if pass) |
rule.passed | bool | Whether the rule passed validation |
REQ-RULES-CC-001: Validate Curve Control via Classification and CT Bounds
Acceptance Criteria Summary
| AC ID | Description |
|---|
| AC-001-A | Validation sequence: classification check → upper bound check → lower bound check |
| AC-001-B | Negative classification fails with FAILED_POS error codes |
| AC-001-C | CT > upper bound fails with CONTROL_OUT_OF_RANGE_HIGH error codes |
| AC-001-D | CT < lower bound fails with CONTROL_OUT_OF_RANGE_LOW error codes |
| AC-001-E | CT bounds check uses inclusive comparison (>= lower AND <= upper) |
| AC-001-F | Pass when classification is positive AND CT is within bounds |
| AC-001-G | Error codes applied at both well (_WELL) and target (_TARGET) levels |
Decision Table: Classification Check
| TV | classification | well_error | target_error | passed | Covers |
|---|
| TV-001-001 | Negative | FAILED_POS_WELL | FAILED_POS_TARGET | false | AC-001-B, AC-001-G |
| TV-001-002 | Positive | (proceed to CT check) | (proceed to CT check) | (depends) | AC-001-A |
Decision Table: CT Upper Bound Check
Precondition: classification = Positive, config.exists = true
| TV | ct | upper_bound | well_error | target_error | passed | Covers |
|---|
| TV-001-003 | 35 | 30 | CONTROL_OUT_OF_RANGE_HIGH_WELL | CONTROL_OUT_OF_RANGE_HIGH_TARGET | false | AC-001-C, AC-001-G |
| TV-001-004 | 30 | 30 | null | null | (proceed) | AC-001-E (boundary inclusive) |
| TV-001-005 | 29 | 30 | null | null | (proceed) | AC-001-A |
Decision Table: CT Lower Bound Check
Precondition: classification = Positive, config.exists = true, CT <= upper_bound
| TV | ct | lower_bound | well_error | target_error | passed | Covers |
|---|
| TV-001-006 | 15 | 20 | CONTROL_OUT_OF_RANGE_LOW_WELL | CONTROL_OUT_OF_RANGE_LOW_TARGET | false | AC-001-D, AC-001-G |
| TV-001-007 | 20 | 20 | null | null | true | AC-001-E (boundary inclusive) |
| TV-001-008 | 21 | 20 | null | null | true | AC-001-F |
Decision Table: Complete Validation Scenarios
| TV | classification | ct | lower_bound | upper_bound | well_error | target_error | passed | Covers |
|---|
| TV-001-009 | Negative | 25 | 20 | 30 | FAILED_POS_WELL | FAILED_POS_TARGET | false | AC-001-B: Classification checked first |
| TV-001-010 | Positive | 35 | 20 | 30 | CONTROL_OUT_OF_RANGE_HIGH_WELL | CONTROL_OUT_OF_RANGE_HIGH_TARGET | false | AC-001-C: CT above upper |
| TV-001-011 | Positive | 15 | 20 | 30 | CONTROL_OUT_OF_RANGE_LOW_WELL | CONTROL_OUT_OF_RANGE_LOW_TARGET | false | AC-001-D: CT below lower |
| TV-001-012 | Positive | 25 | 20 | 30 | null | null | true | AC-001-F: All conditions pass |
REQ-RULES-CC-002: Set Error When Control Range Configuration Missing
Acceptance Criteria Summary
| AC ID | Description |
|---|
| AC-002-A | Control range settings keyed by role-to-target mapping |
| AC-002-B | CC_LIMITS_MISSED error set when no matching config for observation's mapping |
| AC-002-C | Error set regardless of classification status |
| AC-002-D | Rule shall not attempt CT bound validation when config missing |
| AC-002-E | Rule explicitly fails (no defaults or silent pass) |
Decision Table: Missing Configuration
| TV | config.exists | obs.role_to_target_mapping | classification | well_error | ct_validation_attempted | passed | Covers |
|---|
| TV-002-001 | false | map_B | Positive | CC_LIMITS_MISSED | false | false | AC-002-B, AC-002-C, AC-002-D |
| TV-002-002 | false | map_B | Negative | CC_LIMITS_MISSED | false | false | AC-002-C: Error regardless of classification |
| TV-002-003 | true | map_A | Positive | null | true | (depends) | AC-002-A: Config matched, proceed normally |
| TV-002-004 | true | map_A | Negative | FAILED_POS_WELL | true | false | Normal flow when config exists |
Decision Table: Configuration Lookup Priority
Validates that missing config check happens before any other validation.
| TV | config.exists | classification | ct | expected_error | Covers |
|---|
| TV-002-005 | false | Positive | 25 (valid) | CC_LIMITS_MISSED | AC-002-D: Config checked first |
| TV-002-006 | false | Positive | 100 (invalid) | CC_LIMITS_MISSED | AC-002-E: No CT check attempted |
Traceability to Existing Tests
| Requirement | Jira Tests | Automation Status |
|---|
| REQ-RULES-CC-001 | BT-1333, BT-2119 | Automated |
| REQ-RULES-CC-002 | BT-4167 | Automated |
Gap Analysis
Identified Gaps
| Gap | Requirement | Description | Priority | Owner |
|---|
| None | - | All acceptance criteria covered by test vectors | - | - |
Boundary Value Analysis
| Boundary | Test Vectors | Status |
|---|
| CT = upper_bound (inclusive) | TV-001-004 | Covered |
| CT = lower_bound (inclusive) | TV-001-007 | Covered |
| CT = upper_bound + 1 | TV-001-003 | Covered |
| CT = lower_bound - 1 | TV-001-006 | Covered |