Skip to main content
Version: 3.0.0

STD: Quantity Weight Rule (QTYWEIGHT)

Version: v1.0.0 Status: Draft SRS Source: docusaurus/docs/srs/rules/rule-quantity-weight.md Rule Name: TISSUE_WEIGHT Domain: RULES-QTYWEIGHT


Overview

This document specifies tests for the Quantity Weight rule using decision tables and test vectors. The rule normalizes observation quantities by dividing by twice the tissue weight value during run analysis.

Rule Characteristics:

  • Pure business logic (no UI)
  • Simple guard clause logic (null/zero/non-numeric checks)
  • Fixed formula with no configurable parameters
  • Error generation for malformed input

Test Method: TM-API (per Test Plan Section 3.3 - 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. This format enables exhaustive condition coverage while remaining concise and auditable.


Coverage Summary

REQ IDTitleConditionsTest VectorsCoverageGaps
REQ-RULES-QTYWEIGHT-001Normalize Quantity Using Tissue Weight58100%None
REQ-RULES-QTYWEIGHT-002Generate Error for Invalid Tissue Weight23100%None

Totals: 2 REQs, 7 Conditions, 11 Test Vectors, 100% Coverage


REQ-RULES-QTYWEIGHT-001: Normalize Quantity Using Tissue Weight

Input Variables

VariableTypeValid ValuesDescription
well.tissue_weightstring/float/nullnull, "0", 0, positive numeric, non-numeric stringTissue weight property from well
obs.quantityfloat/nullnull, any numericObservation quantity to normalize

Output Variables

VariableTypeDescription
obs.quantityfloat/nullNormalized quantity (or unchanged if skipped)
rule_executedboolWhether calculation was performed

Decision Table: Guard Clause - Tissue Weight Null

TVtissue_weightquantityexpected_quantityrule_executedCovers
TV-001-001null100100falseAC: Tissue weight null - skip, preserve quantity

Decision Table: Guard Clause - Tissue Weight Zero

TVtissue_weightquantityexpected_quantityrule_executedCovers
TV-001-0020100100falseAC: Tissue weight zero - skip, preserve quantity
TV-001-0030.05050falseAC: Tissue weight zero (float) - skip

Decision Table: Guard Clause - Quantity Null

TVtissue_weightquantityexpected_quantityrule_executedCovers
TV-001-0040.1nullnullfalseAC: Quantity null - skip, preserve null

Decision Table: Valid Calculation

TVtissue_weightquantityexpected_quantitycalculationCovers
TV-001-0050.1100500100 / (2 x 0.1) = 500AC: Valid inputs - calculate normalized quantity
TV-001-0060.5200200200 / (2 x 0.5) = 200AC: Different values - formula applied
TV-001-0071.010050100 / (2 x 1.0) = 50AC: Tissue weight = 1 - halves quantity
TV-001-0080.25102010 / (2 x 0.25) = 20AC: Small values - precision preserved

Decision Table: Boundary Values

TVtissue_weightquantityexpected_quantityrule_executedCovers
TV-001-0090.0011500trueAC: Very small tissue weight
TV-001-01010010005trueAC: Large tissue weight

REQ-RULES-QTYWEIGHT-002: Generate Error for Invalid Tissue Weight

Input Variables

VariableTypeValid ValuesDescription
well.tissue_weightstringNon-numeric string (e.g., "ab", "test")Invalid tissue weight value

Output Variables

VariableTypeDescription
well.error_codestringINVALID_TISSUE_WEIGHT error code
error_levelstringWell (error applied at well level)

Decision Table: Non-Numeric Tissue Weight

TVtissue_weightexpected_errorerror_levelCovers
TV-002-001"ab"INVALID_TISSUE_WEIGHTWellAC: Non-numeric string - error generated
TV-002-002"test123"INVALID_TISSUE_WEIGHTWellAC: Alphanumeric string - error generated
TV-002-003" "INVALID_TISSUE_WEIGHTWellAC: Whitespace - error generated

Decision Table: Distinction Between Skip and Error

This table clarifies the boundary between REQ-001 (skip) and REQ-002 (error) behaviors:

TVtissue_weightbehaviorreasonCovers
TV-CROSS-001nullskipMissing data - not malformedREQ-001 AC
TV-CROSS-0020skipZero value - division undefinedREQ-001 AC
TV-CROSS-003"ab"errorMalformed data - requires correctionREQ-002 AC
TV-CROSS-004"0.5"calculateNumeric string - validREQ-001 AC
TV-CROSS-0050.5calculateNumeric value - validREQ-001 AC

Traceability to Existing Tests

RequirementJira TestsStatus
REQ-RULES-QTYWEIGHT-001BT-5243Existing
REQ-RULES-QTYWEIGHT-002BT-4167Existing

Gap Analysis

Identified Gaps

GapRequirementDescriptionPriorityOwner
None-All acceptance criteria covered by test vectors--

Coverage Notes

  • All guard clause conditions have dedicated test vectors
  • Calculation formula verified with multiple input combinations
  • Boundary values tested (very small and large tissue weights)
  • Error vs skip distinction explicitly tested
  • Existing Jira test tickets provide traceability