Skip to main content
Version: Next

STD: Repeat Sample Check Rule (WREP)

Version: v1.0.0 Status: Draft SRS Source: docusaurus/docs/srs/rules/rule-repeat-sample.md Rule Name: WREP Domain: RULES-REPEATSAMP


Overview

This document specifies tests for the Repeat Sample Check rule (WREP) using decision tables and test vectors. The rule validates classification and quantitative consistency between repeat samples of the same sample/mix combination.

Rule Characteristics:

  • Pure business logic (no UI)
  • Sequential decision flow: first-time check, classification match, quantitative threshold
  • Single configuration parameter (Log(Quant) threshold)
  • Uses most recent historical sample for comparison

Test Method: TM-API (per Test Plan - Rules use automated API tests)

Automation Status: Automated

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. The decision tables exhaustively cover first-time handling, classification matching, quantitative consistency, boundary conditions, and error paths.


Coverage Summary

REQ IDTitleConditionsTest VectorsCoverageGaps
REQ-RULES-REPEATSAMP-001Validate Repeat Sample Consistency1115100%None

Totals: 1 REQ, 11 Conditions, 15 Test Vectors, 100% Coverage


REQ-RULES-REPEATSAMP-001: Validate Repeat Sample Consistency

Input Variables

VariableTypeValid ValuesDescription
is_first_timebooltrue, falseWhether this sample/mix combination has been tested before
historical_data_availablebooltrue, falseWhether historical data is accessible
current.classificationstringPos, NegCurrent sample classification
previous.classificationstringPos, NegPrevious sample classification (most recent)
current.log_quantfloatnumericLog(Quant) of current sample
previous.log_quantfloatnumericLog(Quant) of previous sample
thresholdfloat0.5 (default)Configured wrep_log_quant_threshold

Output Variables

VariableTypeDescription
resultstringpass, skip, error
error_codestring?WREP_CLASSIFICATION_MISMATCH, WREP_QUANT_THRESHOLD_EXCEEDED, null

Derived Variables

VariableFormulaDescription
log_quant_diffABS(current.log_quant - previous.log_quant)Absolute difference in Log(Quant) values

Decision Table: First-Time Sample Handling

Tests AC: First-time samples bypass validation.

TVis_first_timehistorical_data_availableresulterror_codeCovers
TV-001-001trueN/AskipnullAC: First-time sample bypasses validation
TV-001-002falsefalseskipnullAC: Unavailable history treated as first-time

Decision Table: Classification Matching

Tests AC: Classification mismatch triggers error; matching classifications proceed to next check.

Precondition: is_first_time = false AND historical_data_available = true

TVcurrent.classificationprevious.classificationclassifications_matchresulterror_codeCovers
TV-001-003PosNegfalseerrorWREP_CLASSIFICATION_MISMATCHAC: Classification mismatch
TV-001-004NegPosfalseerrorWREP_CLASSIFICATION_MISMATCHAC: Classification mismatch (reverse)
TV-001-005NegNegtruepassnullAC: Negative match passes (no quant check)
TV-001-006PosPostrue(continue)-AC: Positive match continues to quant check

Decision Table: Quantitative Consistency (Positive Samples)

Tests AC: Log(Quant) difference exceeding threshold triggers error; within threshold passes.

Precondition: is_first_time = false AND historical_data_available = true AND current.classification = Pos AND previous.classification = Pos

TVcurrent.log_quantprevious.log_quantthresholdlog_quant_diffresulterror_codeCovers
TV-001-0073.02.00.51.0errorWREP_QUANT_THRESHOLD_EXCEEDEDAC: Exceeds threshold
TV-001-0083.02.60.50.4passnullAC: Within threshold
TV-001-0093.03.50.50.5passnullAC: Exactly at threshold (boundary)
TV-001-0103.03.5010.50.501errorWREP_QUANT_THRESHOLD_EXCEEDEDAC: Just over threshold (boundary)

Decision Table: Threshold Configuration

Tests AC: System uses configured threshold for comparison.

Precondition: is_first_time = false AND current.classification = Pos AND previous.classification = Pos

TVcurrent.log_quantprevious.log_quantthresholdlog_quant_diffresulterror_codeCovers
TV-001-0113.02.01.51.0passnullAC: Custom threshold - within
TV-001-0123.01.01.52.0errorWREP_QUANT_THRESHOLD_EXCEEDEDAC: Custom threshold - exceeds

Decision Table: Negative Sample Bypass

Tests AC: Quantitative check bypassed for negative samples.

Precondition: is_first_time = false AND classifications_match = true

TVcurrent.classificationprevious.classificationcurrent.log_quantprevious.log_quantquant_check_performedresultCovers
TV-001-013NegNegN/AN/AfalsepassAC: Negative bypasses quant check
TV-001-014PosPos3.02.4truepassAC: Positive performs quant check

Decision Table: History Selection

Tests AC: Most recent sample used when multiple exist.

TVhistory_samplesselected_for_comparisonCovers
TV-001-015[S1(date=2025-01-01, cls=Pos), S2(date=2025-01-15, cls=Neg)]S2AC: Most recent sample selected

End-to-End Scenarios

Scenario Matrix

Complete verification scenarios combining all conditions:

TVis_first_timehist_availcurr.clsprev.clscurr.lqprev.lqthresholdresulterror_code
E2E-001true------skipnull
E2E-002falsefalse-----skipnull
E2E-003falsetruePosNeg---errorWREP_CLASSIFICATION_MISMATCH
E2E-004falsetrueNegNeg---passnull
E2E-005falsetruePosPos3.02.00.5errorWREP_QUANT_THRESHOLD_EXCEEDED
E2E-006falsetruePosPos3.02.80.5passnull

Traceability to Acceptance Criteria

AC CategoryAcceptance CriterionTest Vectors
First-Time HandlingFirst-time sample bypasses validationTV-001-001
First-Time HandlingUnavailable history treated as first-timeTV-001-002
Classification MatchingClassification mismatch triggers errorTV-001-003, TV-001-004
Classification MatchingMatching negative samples passTV-001-005
Quantitative ConsistencyQuant check only for positive samplesTV-001-013, TV-001-014
Quantitative ConsistencyExceeds threshold triggers errorTV-001-007, TV-001-010, TV-001-012
Quantitative ConsistencyWithin threshold passesTV-001-008, TV-001-011
Threshold CalculationUses absolute difference formulaTV-001-007 through TV-001-012
BoundaryExactly at threshold passesTV-001-009
History SelectionMost recent sample usedTV-001-015

Supplementary Gap-Fill Tests

TCDescriptionCovers
TC-REPEATSAMP-G-001AFirst-time Pos sample bypasses repeat sample checkAC: First-time positive sample, no prior history
TC-REPEATSAMP-G-001BFirst-time Neg sample bypasses repeat sample checkAC: First-time negative sample, no prior history
TC-REPEATSAMP-G-002Hardcoded 0.5 threshold triggers WREP error (KCI)AC: Threshold is hardcoded, not configurable
TC-REPEATSAMP-G-003AMultiple historical Pos runs within threshold do not trigger WREPAC: Within-threshold quant diff across history
TC-REPEATSAMP-G-003BMultiple historical Neg runs with matching cls do not trigger WREPAC: Matching negative classifications across history

Gap Analysis

Identified Gaps

GapDescriptionPriorityStatus
NoneAll acceptance criteria covered by test vectors--

Coverage Notes

  • All 11 acceptance criteria from REQ-RULES-REPEATSAMP-001 are covered
  • Boundary conditions at threshold value tested (TV-001-009, TV-001-010)
  • Both directions of classification mismatch tested (Pos/Neg and Neg/Pos)
  • Custom threshold configuration verified (TV-001-011, TV-001-012)
  • Negative sample bypass explicitly verified (TV-001-013)