Skip to main content
Version: 3.0.0

STD: Quantity Standard Validation Rule (QUANT_VALIDATION)

Version: v1.0.0 Status: Draft SRS Source: docusaurus/docs/srs/rules/rule-quant-validation.md Rule Name: QUANT_VALIDATION Domain: RULES-QUANTVAL


Overview

This document specifies tests for the Quantity Standard Validation rule using decision tables and test vectors. The rule validates quantitative standard controls and calculates linear regression parameters for PCR-based sample quantification workflows.

Rule Characteristics:

  • Pure business logic (no UI)
  • Quantity assignment from configuration
  • Observation exclusion filtering
  • Linear regression calculation (gradient, intercept, R2, efficiency)
  • Multi-threshold validation with error generation
  • CT range boundary validation

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-QUANTVAL-001Known Quantity Assignment68100%None
REQ-RULES-QUANTVAL-002Observation Filtering46100%None
REQ-RULES-QUANTVAL-003Linear Regression Calculation56100%None
REQ-RULES-QUANTVAL-004Standard Controls Validation1418100%None
REQ-RULES-QUANTVAL-005CT Range Validation79100%None
REQ-RULES-QUANTVAL-006Error Resolution Support23100%None

Totals: 6 REQs, 38 Conditions, 50 Test Vectors, 100% Coverage


REQ-RULES-QUANTVAL-001: Known Quantity Assignment

Input Variables

VariableTypeValid ValuesDescription
obs.quantityfloat?null, numericQuantity from runfile
obs.targetstringTarget A, Target B, ...Observation target
obs.rolestringRole A, Role B, ...Observation role
obs.role_typestringQuantification, Quantification & PC, ...Role type classification
config.targetstringTarget A, Target B, ...Known Quantity config target
config.rolestringRole A, Role B, ...Known Quantity config role
config.known_quantityfloatnumericConfigured quantity value

Output Variables

VariableTypeDescription
obs.quantityfloat?Assigned quantity value

Decision Table: Quantity Source Priority

TVobs.quantityconfig_existsexpected_quantityCovers
TV-001-001nulltrue (qty=1000)1000AC: Assign from config when runfile lacks quantity
TV-001-002500true (qty=1000)500AC: Runfile quantity takes precedence
TV-001-003nullfalsenullAC: No config match, quantity remains null

Decision Table: Configuration Matching

TVobs.targetobs.roleconfig.targetconfig.rolematchedCovers
TV-001-004Target ARole ATarget ARole AtrueAC: Both target AND role match
TV-001-005Target ARole BTarget ARole AfalseAC: Role mismatch
TV-001-006Target BRole ATarget ARole AfalseAC: Target mismatch

Decision Table: Role Type Handling

TVobs.role_typeexpected_behaviorCovers
TV-001-007Quantification & PCQuantity assignedAC: "Quantification & PC" receives assignment
TV-001-008QuantificationQuantity assignedAC: Standard quantification role

REQ-RULES-QUANTVAL-002: Observation Filtering

Input Variables

VariableTypeValid ValuesDescription
obs.target_typestringIC, Standard, ...Target type classification
obs.classificationstringPositive, Negative, ...Classification result
obs.role_typestringQuantification, Quantification & PC, NTC, ...Role type

Output Variables

VariableTypeDescription
excludedboolWhether observation is excluded from processing
obs.quantityfloat?Remains null if excluded

Decision Table: Exclusion Criteria

TVtarget_typeclassificationrole_typeexcludedCovers
TV-002-001ICPositiveQuantificationtrueAC: IC target excluded
TV-002-002StandardNegativeQuantificationtrueAC: Negative classification excluded
TV-002-003StandardPositiveNTCtrueAC: Non-quantifiable role excluded
TV-002-004StandardPositiveQuantificationfalseAC: Quantifiable observation processed
TV-002-005StandardPositiveQuantification & PCfalseAC: Quantification & PC processed
TV-002-006ICNegativeNTCtrueAC: Multiple exclusion criteria (any triggers)

REQ-RULES-QUANTVAL-003: Linear Regression Calculation

Input Variables

VariableTypeValid ValuesDescription
controlsarrayWell observationsQuantitative control wells
control.quantityfloatnumericControl quantity (log transformed for X)
control.ctfloatnumericControl CT value (Y coordinate)
control.role_typestringQuantification, Quantification & PCRole type

Output Variables

VariableTypeDescription
run_target.gradientfloatSlope of regression line
run_target.interceptfloatY-intercept of regression line
run_target.r2floatSquared Pearson correlation coefficient
run_target.efficiencyfloatPCR efficiency: -1 + 10^(-1/slope)

Decision Table: Regression Calculation

TVcontrolsexpected_gradientexpected_interceptexpected_r2expected_efficiencyCovers
TV-003-001[qty=10000,ct=30], [qty=1000,ct=31]-13419AC: Linear regression from controls
TV-003-002[qty=10000,ct=30], [qty=1000,ct=31], [qty=100,ct=32]-13419AC: Multiple controls

Decision Table: Role Type Inclusion

TVcontrol.role_typeincluded_in_regressionCovers
TV-003-003QuantificationtrueAC: Standard quantification included
TV-003-004Quantification & PCtrueAC: Quantification & PC included
TV-003-005NTCfalseAC: Non-quantifiable excluded
TV-003-006PCfalseAC: PC-only excluded

REQ-RULES-QUANTVAL-004: Standard Controls Validation

Input Variables

VariableTypeValid ValuesDescription
obs.machine_quantityfloat?null, numericQuantity from machine
obs.known_quantityfloat?null, numericQuantity from configuration
control_countint0, 1, 2, ...Unique quantitative controls
config.min_controlsint2 (default), numericMinimum required controls
calculated.r2float0.0-1.0Calculated R2 value
config.min_r2float?null, numericMinimum R2 threshold
calculated.gradientfloatnumericCalculated slope
config.min_slopefloat?null, numericMinimum slope threshold
config.max_slopefloat?null, numericMaximum slope threshold
calculated.efficiencyfloatnumericCalculated efficiency
config.min_efficiencyfloat?null, numericMinimum efficiency threshold
config.max_efficiencyfloat?null, numericMaximum efficiency threshold

Output Variables

VariableTypeDescription
well.error_codestring?Validation error code
regression_storedboolWhether regression parameters stored on run_target

Decision Table: Missing Quantity Validation

TVmachine_quantityknown_quantityerror_codeobs.quantityCovers
TV-004-001nullnullSTANDARD_WITHOUT_QUANTnullAC: Both quantities absent
TV-004-0021000nullnull1000AC: Machine quantity present
TV-004-003null1000null1000AC: Known quantity present

Decision Table: Minimum Controls Validation

TVcontrol_countmin_controlserror_coderegression_storedCovers
TV-004-00412 (default)INSUFFICIENT_STANDARD_CONTROLSfalseAC: Below default minimum
TV-004-00522 (default)nulltrueAC: Meets default minimum
TV-004-00623INSUFFICIENT_STANDARD_CONTROLSfalseAC: Below configured minimum
TV-004-00733nulltrueAC: Meets configured minimum

Decision Table: R2 Validation

TVcalculated.r2config.min_r2error_coderegression_storedCovers
TV-004-0080.9641.0BAD_R2trueAC: R2 below threshold, regression still stored
TV-004-0091.01.0nulltrueAC: R2 meets threshold
TV-004-0100.98nullnulltrueAC: No threshold configured

Decision Table: Gradient Validation

TVcalculated.gradientmin_slopemax_slopeerror_coderegression_storedCovers
TV-004-011-10nullBAD_GRADIENTtrueAC: Below min_slope, regression stored
TV-004-012-1null-2BAD_GRADIENTtrueAC: Above max_slope, regression stored
TV-004-013-1.5-2-1nulltrueAC: Within range

Decision Table: Efficiency Validation

TVcalculated.efficiencymin_efficiencymax_efficiencyerror_coderegression_storedCovers
TV-004-014910nullBAD_EFFICIENCYtrueAC: Below min, regression stored
TV-004-0159null8BAD_EFFICIENCYtrueAC: Above max, regression stored
TV-004-0169810nulltrueAC: Within range

Decision Table: Error Propagation

TVerror_typeapplied_toCovers
TV-004-017BAD_R2All same-target quantitative control wellsAC: Errors propagate to all controls
TV-004-018INSUFFICIENT_STANDARD_CONTROLSAll same-target quantitative control wellsAC: Error propagation

REQ-RULES-QUANTVAL-005: CT Range Validation

Input Variables

VariableTypeValid ValuesDescription
obs.final_ctfloatnumericObservation CT value
config.low_boundfloat?null, numericLower CT limit
config.upper_boundfloat?null, numericUpper CT limit
config_existsbooltrue, falseWhether Curve Control Range Settings exist

Output Variables

VariableTypeDescription
well.error_codestring?STANDARD_OUTSIDE_CT_RANGE or null

Decision Table: CT Boundary Validation

TVfinal_ctlow_boundupper_bounderror_codeCovers
TV-005-001312830STANDARD_OUTSIDE_CT_RANGEAC: CT above upper_bound
TV-005-002302830nullAC: CT equals upper_bound (inclusive)
TV-005-003292830nullAC: CT within range
TV-005-004282830nullAC: CT equals low_bound (inclusive)
TV-005-005272830STANDARD_OUTSIDE_CT_RANGEAC: CT below low_bound

Decision Table: Configuration Absence

TVconfig_existsfinal_cterror_codeCovers
TV-005-006false27nullAC: No config, low CT - no error
TV-005-007false31nullAC: No config, high CT - no error
TV-005-008false29nullAC: No config, normal CT - no error
TV-005-009true29nullAC: Config present, within range

REQ-RULES-QUANTVAL-006: Error Resolution Support

Input Variables

VariableTypeValid ValuesDescription
error_codestringSTANDARD_OUTSIDE_CT_RANGE, STANDARD_WITHOUT_QUANT, ...Error type

Output Variables

VariableTypeDescription
resolvableboolWhether error supports resolution

Decision Table: Error Resolvability

TVerror_coderesolvableresolution_appliedCovers
TV-006-001STANDARD_OUTSIDE_CT_RANGEtrueyesAC: Resolvable error accepts resolution
TV-006-002STANDARD_WITHOUT_QUANTfalseblockedAC: Non-resolvable error prevents resolution
TV-006-003BAD_R2N/AN/AAC: Other errors not specified as resolvable

Traceability to Existing Tests

RequirementJira TestsStatus
REQ-RULES-QUANTVAL-001BT-3452Existing
REQ-RULES-QUANTVAL-002PendingGap
REQ-RULES-QUANTVAL-003PendingGap
REQ-RULES-QUANTVAL-004BT-3527, BT-3529, BT-3530, BT-3531Existing
REQ-RULES-QUANTVAL-005PendingGap
REQ-RULES-QUANTVAL-006PendingGap

Gap Analysis

Identified Gaps

GapRequirementDescriptionPriorityOwner
GAP-001REQ-RULES-QUANTVAL-002No Jira test ticket for observation filteringHighTBD
GAP-002REQ-RULES-QUANTVAL-003No Jira test ticket for regression calculation verificationHighTBD
GAP-003REQ-RULES-QUANTVAL-005No Jira test ticket for CT range validationMediumTBD
GAP-004REQ-RULES-QUANTVAL-006No Jira test ticket for error resolution behaviorLowTBD

Remediation Plan

  1. GAP-001: Create test ticket covering TV-002-001 through TV-002-006 (exclusion criteria)
  2. GAP-002: Create test ticket covering TV-003-001 through TV-003-006 (regression calculation)
  3. GAP-003: Create test ticket covering TV-005-001 through TV-005-009 (CT boundaries)
  4. GAP-004: Create test ticket covering TV-006-001 through TV-006-003 (resolution support)

Automation Status

RequirementStatusNotes
REQ-RULES-QUANTVAL-001AutomatedExisting test BT-3452
REQ-RULES-QUANTVAL-002AutomatedNeeds coverage verification
REQ-RULES-QUANTVAL-003AutomatedNeeds coverage verification
REQ-RULES-QUANTVAL-004AutomatedExisting tests BT-3527, BT-3529, BT-3530, BT-3531
REQ-RULES-QUANTVAL-005AutomatedNeeds test ticket creation
REQ-RULES-QUANTVAL-006AutomatedNeeds test ticket creation