Skip to main content
Version: 3.0.0

STD: Threshold Rule (THRESH)

Version: v1.0.0 Status: Draft SRS Source: docusaurus/docs/srs/rules/rule-threshold.md Rule Name: THRESHOLD Domain: RULES-THRESH


Overview

This document specifies tests for the THRESHOLD rule using decision tables and test vectors. The rule validates that threshold values recorded in runfiles match the expected threshold values specified in mix setup configuration, raising errors when mismatches are detected or when threshold configuration is missing.

Rule Characteristics:

  • Pure business logic (no UI)
  • Exact comparison (runfile threshold == expected threshold)
  • Permanent error persistence (non-resolvable)
  • Missing configuration detection (THRESHOLD_MISSED)

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-THRESH-001Validate Threshold Value715100%None
REQ-RULES-THRESH-002Persist Threshold Errors46100%None
REQ-RULES-THRESH-003Missing Configuration Detection34100%None

Totals: 3 REQs, 14 Conditions, 25 Test Vectors, 100% Coverage


Input Variables

VariableTypeValid ValuesDescription
obs.thresholdfloatnumericRunfile threshold value from observation
config.target_thresholdfloat?null, numericExpected threshold from mix setup configuration
target.expected_thresholdint0-1000 (passive), 0-100000000 (non-passive)Expected threshold from target configuration import
target.is_passivebooltrue, falseWhether target is passive type
well.errorsarray[], [THRESHOLD], [THRESHOLD_MISSED]Current well error codes
well.observationsarrayobservation recordsObservations associated with well

Output Variables

VariableTypeDescription
obs.error_codestring?Error code applied to observation (THRESHOLD)
well.error_codestring?Error code applied to well (THRESHOLD_MISSED)
error.resolvableboolWhether the error can be resolved (always false for THRESHOLD errors)
obs.threshold_retainedfloatOriginal threshold value retained after re-analysis

REQ-RULES-THRESH-001: Validate Threshold Value

Acceptance Criteria Mapping

AC IDAcceptance CriterionTest Vectors
AC-001-1Threshold mismatch raises THRESHOLD errorTV-001-001, TV-001-002
AC-001-2Threshold match results in no errorTV-001-003, TV-001-004
AC-001-3Comparison is exact (equal)TV-001-005, TV-001-006
AC-001-4Rule evaluates per observationTV-001-001 through TV-001-006
AC-001-5Threshold retrieved from target.expected_threshold via config importTV-001-010
AC-001-6Passive target expected_threshold range 0-1000TV-001-011, TV-001-012, TV-001-013
AC-001-7Non-passive target expected_threshold range 0-100000000TV-001-014, TV-001-015

Decision Table: Threshold Validation

TVconfig.target_thresholdobs.thresholdmatcherror_codeCovers
TV-001-001100.0100.0truenullAC: Exact match, no error
TV-001-002100.099.0falseTHRESHOLDAC: Mismatch, error raised
TV-001-003100.0101.0falseTHRESHOLDAC: Mismatch above expected
TV-001-00450.550.5truenullAC: Decimal match
TV-001-00550.550.500001falseTHRESHOLDAC: Near-miss (exact comparison)
TV-001-0060.00.0truenullAC: Zero threshold match

Decision Table: Per-Observation Evaluation

TVobservation_countobs_1.thresholdobs_2.thresholdconfig.targetobs_1.errorobs_2.errorCovers
TV-001-0072100.0100.0100.0nullnullAC: Both match
TV-001-0082100.099.0100.0nullTHRESHOLDAC: Independent evaluation
TV-001-009299.099.0100.0THRESHOLDTHRESHOLDAC: Both fail

Decision Table: Configuration Source

TVtarget.expected_thresholdconfig_import_performedconfig.target_thresholdCovers
TV-001-010500true500AC: Threshold retrieved from target config import

Decision Table: Passive Target Range Validation

TVtarget.is_passivetarget.expected_thresholdvalidation_resulterrorCovers
TV-001-011true1000validnullAC: Passive upper boundary valid
TV-001-012true1001invalidVALIDATION_ERRORAC: Passive exceeds upper range
TV-001-013true-1invalidVALIDATION_ERRORAC: Passive below lower range

Decision Table: Non-Passive Target Range Validation

TVtarget.is_passivetarget.expected_thresholdvalidation_resulterrorCovers
TV-001-014false100000000validnullAC: Non-passive upper boundary valid
TV-001-015false100000001invalidVALIDATION_ERRORAC: Non-passive exceeds upper range

REQ-RULES-THRESH-002: Persist Threshold Errors

Acceptance Criteria Mapping

AC IDAcceptance CriterionTest Vectors
AC-002-1THRESHOLD error is not resolvable via UITV-002-001
AC-002-2Error cannot be removed from wellTV-002-002
AC-002-3Re-analysis retains threshold errorTV-002-003, TV-002-004
AC-002-4Original threshold retained for re-analysisTV-002-005, TV-002-006

Decision Table: Error Resolution Blocking

TVwell.errorsresolution_attemptresolution_blockederror_persistsCovers
TV-002-001[THRESHOLD]resolve_errortruetrueAC: Resolution blocked
TV-002-002[THRESHOLD]remove_errortruetrueAC: Removal blocked

Decision Table: Re-Analysis Behavior

TVinitial_errorreanalysis_performedfinal_errororiginal_threshold_retainedCovers
TV-002-003THRESHOLDtrueTHRESHOLDtrueAC: Error persists
TV-002-004THRESHOLD_MISSEDtrueTHRESHOLD_MISSEDtrueAC: MISSED error persists
TV-002-005THRESHOLDtrueTHRESHOLDtrueAC: Original value used
TV-002-006nulltruenulltrueAC: No error to persist

REQ-RULES-THRESH-003: Missing Configuration Detection

Acceptance Criteria Mapping

AC IDAcceptance CriterionTest Vectors
AC-003-1targetThreshold = null triggers THRESHOLD_MISSEDTV-003-001
AC-003-2Error applied at well levelTV-003-002, TV-003-003
AC-003-3Configuration check precedes validationTV-003-004

Decision Table: Missing Configuration Detection

TVconfig.target_thresholdobs.thresholderror_codeerror_levelCovers
TV-003-001null100.0THRESHOLD_MISSEDwellAC: Missing config detected
TV-003-002null50.0THRESHOLD_MISSEDwellAC: Error at well level
TV-003-003undefined100.0THRESHOLD_MISSEDwellAC: Undefined treated as null
TV-003-004100.0100.0nulln/aAC: Config present, no MISSED error

Decision Table: Configuration Check Precedence

TVconfig.target_thresholdobs.thresholdchecked_firstresultCovers
TV-003-005null99.0config_presentTHRESHOLD_MISSEDAC: Missing config checked first
TV-003-006100.099.0config_presentTHRESHOLDAC: With config, proceeds to validation

Traceability to Existing Tests

RequirementJira TestsAutomation Status
REQ-RULES-THRESH-001BT-5172Automated (v3 config)
REQ-RULES-THRESH-002BT-1629Manual (reanalysis persistence test)
REQ-RULES-THRESH-003BT-1437Automated

Gap Analysis

Identified Gaps

GapRequirementDescriptionPriorityOwner
None-All requirements have associated test coverage--

Boundary Value Coverage

BoundaryTest VectorStatus
Exact matchTV-001-001, TV-001-004Covered
Near-miss valuesTV-001-005Covered
Zero thresholdTV-001-006Covered
Null configurationTV-003-001, TV-003-003Covered
Multiple observationsTV-001-007 through TV-001-009Covered
Passive range upper boundary (1000)TV-001-011Covered
Passive range exceeded (1001)TV-001-012Covered
Passive range below minimum (-1)TV-001-013Covered
Non-passive range upper boundary (100000000)TV-001-014Covered
Non-passive range exceeded (100000001)TV-001-015Covered