STD: QSSC Rule (Quantify Using Stored Standard Curve)
Version: v1.0.0
Status: Draft
SRS Source: docusaurus/docs/srs/rules/rule-qssc.md
Rule Name: QSSC
Domain: RULES-QSSC
Overview
This document specifies tests for the QSSC rule using decision tables and test vectors. The rule calculates quantity values from Cycle Threshold (CT) measurements using stored standard curve parameters, with support for resolution code bypass and error handling for missing configuration.
Rule Characteristics:
- Pure business logic (no UI)
- Three processing paths: resolution code bypass, quantity calculation, error handling
- Exponential formula:
qty = multiplier * 10^((ct - intercept) / slope)
- Precision-sensitive calculations (full CT decimal accuracy required)
Test Method: TM-API (per Test Plan - 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. Precision validation uses specific numeric examples from the SRS to verify calculation accuracy.
Coverage Summary
| REQ ID | Title | Conditions | Test Vectors | Coverage | Gaps |
|---|
| REQ-RULES-QSSC-001 | Resolution Code Status Assignment | 3 | 4 | 100% | None |
| REQ-RULES-QSSC-002 | Quantity Calculation | 8 | 10 | 100% | None |
| REQ-RULES-QSSC-003 | Missing Standards Error | 2 | 4 | 100% | None |
Totals: 3 REQs, 13 Conditions, 18 Test Vectors, 100% Coverage
| Variable | Type | Valid Values | Description |
|---|
well.resolution_codes | array | [], [QSSC], [OTHER] | Resolution codes assigned to well |
resolution_config.lims_status | string | DETECTED, NOT_DETECTED, ... | LIMS status for resolution code |
obs.target | string | Target identifier | Target being quantified |
obs.ct | float | Numeric (full precision) | Cycle threshold value |
quant_settings.slope | float | Numeric (typically negative) | Standard curve slope |
quant_settings.intercept | float | Numeric | Standard curve intercept |
well.quantity_multiplier | float | Positive numeric | Scaling factor for quantity |
quant_settings_exists | bool | true, false | Whether settings exist for target |
Output Variables (Rule-Level)
| Variable | Type | Description |
|---|
well.lims_status | string | LIMS status assigned to well |
well.error_code | string | Error code (e.g., QUANT_STANDARDS_MISSING) |
obs.quantity | float | Calculated quantity value |
calculation_performed | bool | Whether quantity calculation was executed |
REQ-RULES-QSSC-001: Resolution Code Status Assignment
Acceptance Criteria Summary
- AC1: When QSSC resolution code is present, look up LIMS status from configuration
- AC2: Apply configured LIMS status to the well
- AC3: No quantification calculation performed when resolution code handling applies
- AC4: No error set on well when LIMS status successfully assigned
Decision Table: Resolution Code Processing
| TV | well.resolution_codes | resolution_config | expected_lims | calculation_performed | error_set | Covers |
|---|
| TV-001-001 | [QSSC] | lims_status=DETECTED | DETECTED | false | false | AC1, AC2, AC3, AC4 |
| TV-001-002 | [QSSC] | lims_status=NOT_DETECTED | NOT_DETECTED | false | false | AC1, AC2 |
| TV-001-003 | [] | N/A | null | true | N/A | AC3 (inverse - no resolution code) |
| TV-001-004 | [OTHER] | N/A | null | true | N/A | AC3 (non-QSSC resolution code) |
Automation Status: Automated
REQ-RULES-QSSC-002: Quantity Calculation
Acceptance Criteria Summary
- AC1: Retrieve slope and intercept from Calculated Quantification Settings for matching target
- AC2: Apply formula:
quantity = multiplier * pow(10, ((ct - intercept) / slope))
- AC3: Use accurate CT value (not rounded) for calculation
- AC4: Apply well's quantity multiplier to result
- AC5: CT=28.1235, slope=-1, intercept=30, multiplier=1 yields quantity=75.248873017358
- AC6: CT=28.12345678, slope=-1, intercept=30, multiplier=1 yields quantity=75.256361986851
| TV | ct | slope | intercept | multiplier | expected_quantity | Covers |
|---|
| TV-002-001 | 28.1235 | -1 | 30 | 1 | 75.248873017358 | AC2, AC3, AC5 |
| TV-002-002 | 28.12345678 | -1 | 30 | 1 | 75.256361986851 | AC2, AC3, AC6 |
| TV-002-003 | 40 | -1 | 30 | 1 | 0.0000000001 | AC2 (high CT, low qty) |
| TV-002-004 | 36 | 0.123 | 0.234 | 100 | 466 | AC2, AC4 (with multiplier) |
Decision Table: Multiplier Application
| TV | ct | slope | intercept | multiplier | expected_quantity | Covers |
|---|
| TV-002-005 | 30 | -1 | 30 | 1 | 1.0 | AC2, AC4 (boundary: ct=intercept) |
| TV-002-006 | 30 | -1 | 30 | 10 | 10.0 | AC4 (multiplier scaling) |
| TV-002-007 | 30 | -1 | 30 | 0.5 | 0.5 | AC4 (fractional multiplier) |
Decision Table: Parameter Retrieval
| TV | obs.target | quant_settings | slope_used | intercept_used | Covers |
|---|
| TV-002-008 | Target_A | {Target_A: slope=-1, intercept=30} | -1 | 30 | AC1 |
| TV-002-009 | Target_B | {Target_B: slope=-3.5, intercept=42} | -3.5 | 42 | AC1 |
| TV-002-010 | Target_A | {Target_A: s=-1, i=30}, {Target_B: s=-2, i=35} | -1 | 30 | AC1 (correct target selection) |
Automation Status: Automated
REQ-RULES-QSSC-003: Missing Standards Error
Acceptance Criteria Summary
- AC1: Verify Calculated Quantification Setting exists for observation's target before calculation
- AC2: If no matching setting found, set QUANT_STANDARDS_MISSING error on well
- AC3: No quantity calculation attempted when configuration is missing
- AC4: Error retrievable from well for downstream processing
Decision Table: Configuration Validation
| TV | obs.target | quant_settings_exists | expected_error | calculation_attempted | Covers |
|---|
| TV-003-001 | Target_A | false | QUANT_STANDARDS_MISSING | false | AC1, AC2, AC3 |
| TV-003-002 | Target_B | true | null | true | AC1 (inverse - settings exist) |
| TV-003-003 | Target_C | false | QUANT_STANDARDS_MISSING | false | AC2, AC4 (error retrievable) |
| TV-QSSC-GAP-004 | Target (ENT) | false | QUANT_STANDARDS_MISSING | false | AC2, AC3 (missing standards prevents quantity) |
Automation Status: Automated
Rule Precedence Decision Table
The QSSC rule has three mutually exclusive processing paths with defined precedence.
| TV | resolution_code_present | quant_settings_exist | processing_path | output | Covers |
|---|
| TV-PREC-001 | true | true | Resolution Code | LIMS status from config | REQ-001 takes precedence |
| TV-PREC-002 | true | false | Resolution Code | LIMS status from config | REQ-001 takes precedence over error |
| TV-PREC-003 | false | true | Calculation | quantity value | REQ-002 normal path |
| TV-PREC-004 | false | false | Error | QUANT_STANDARDS_MISSING | REQ-003 error path |
Boundary Value Analysis
CT Value Boundaries
| TV | ct_value | description | expected_behavior |
|---|
| TV-BND-001 | 0 | Minimum CT | Valid calculation |
| TV-BND-002 | 45 | High CT (typical max) | Very small quantity |
| TV-BND-003 | 28.123456789012 | High precision CT | Full precision preserved |
Multiplier Boundaries
| TV | multiplier | description | expected_behavior |
|---|
| TV-BND-004 | 0.001 | Very small multiplier | Quantity scaled down |
| TV-BND-005 | 1000 | Large multiplier | Quantity scaled up |
| TV-BND-006 | 1 | Default multiplier | No scaling |
Traceability to Existing Tests
| Requirement | Jira Tests | Status |
|---|
| REQ-RULES-QSSC-001 | None | Gap |
| REQ-RULES-QSSC-002 | BT-5242 (TM-API), BT-5077 (TM-MAN) | Partial |
| REQ-RULES-QSSC-003 | None | Gap |
Test Notes:
- BT-5242: Automated API test covering TV-002-003, TV-002-008, TV-002-009, TV-002-010, TV-PREC-003, TV-BND-006
- BT-5077: Manual test covering TV-002-001, TV-002-002, TV-BND-003 (precision verification)
- BT-3899, BT-4001, BT-5076: Previously listed but not found in test catalogue (removed)
Gap Analysis
Identified Gaps
| Gap | Requirement | Description | Priority | Owner |
|---|
| GAP-001 | REQ-RULES-QSSC-001 | No automated test for resolution code status assignment (TV-001-001 through TV-001-004) | Medium | TBD |
| GAP-002 | REQ-RULES-QSSC-003 | No Jira test ticket for missing standards error handling (TV-003-001 through TV-003-003) | Medium | TBD |
| GAP-003 | REQ-RULES-QSSC-002 | Partial automated coverage - TV-002-005 through TV-002-007 (multiplier boundaries) not covered | Low | TBD |
- GAP-001: Create test ticket covering TV-001-001 through TV-001-004 for resolution code LIMS status assignment
- GAP-002: Create test ticket covering TV-003-001 through TV-003-003 for QUANT_STANDARDS_MISSING error scenarios
- GAP-003: Extend BT-5242 or create new test for multiplier boundary scenarios