STD: Unexpected Fluorescence Rule (UNEXPFL)
Version: v1.0.0 Status: Draft SRS Source:
docusaurus/docs/srs/rules/rule-unexpected-fl.mdRule Name: UNEXPECTED_FL Domain: RULES-UNEXPFL
Overview
This document specifies tests for the Unexpected Fluorescence rule using decision tables and test vectors. The rule validates well fluorescence readings against configured maximum thresholds and assigns appropriate error codes when readings exceed thresholds or when configuration is missing.
Rule Characteristics:
- Pure business logic (no UI)
- Configuration validation (null check)
- Conditional calculation (Rox normalization)
- Threshold comparison
Test Method: TM-API (per Test Plan §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 ID | Title | Conditions | Test Vectors | Coverage | Gaps |
|---|---|---|---|---|---|
| REQ-RULES-UNEXPFL-001 | Validate Well Fluorescence Against Maximum Thresholds | 8 | 12 | 100% | None |
Totals: 1 REQ, 8 Conditions, 12 Test Vectors, 100% Coverage
REQ-RULES-UNEXPFL-001: Validate Well Fluorescence Against Maximum Thresholds
Input Variables
| Variable | Type | Valid Values | Description |
|---|---|---|---|
config.maximum_fl | float? | null, numeric | Maximum fluorescence threshold per target |
config.rox_normalization | bool | true, false | Whether Rox normalization is enabled for the target |
obs.readings | array | numeric values | Raw fluorescence readings from observation |
obs.rox_values | array | numeric values | Rox reference values (when normalization enabled) |
Output Variables
| Variable | Type | Description |
|---|---|---|
well.error_code | string? | UNEXPECTED_FL, MAXIMUM_FLUORESCENCE_MISSED, or null (success) |
rule_result | string | success, error |
Decision Table: Configuration Check
Tests the system behavior when maximum_fl configuration is present or missing.
| TV | config.maximum_fl | expected_error_code | rule_result | Covers |
|---|---|---|---|---|
| TV-001-001 | null | MAXIMUM_FLUORESCENCE_MISSED | error | AC: Config null → MAXIMUM_FLUORESCENCE_MISSED |
| TV-001-002 | 1000 | (depends on threshold) | (continues) | AC: Config present → evaluate |
Decision Table: Threshold Comparison (No Rox Normalization)
Tests threshold comparison when Rox normalization is disabled.
| TV | config.maximum_fl | config.rox_normalization | obs.max_fl | expected_error_code | rule_result | Covers |
|---|---|---|---|---|---|---|
| TV-001-003 | 1000 | false | 1001 | UNEXPECTED_FL | error | AC: Max Fl exceeds threshold |
| TV-001-004 | 1000 | false | 1000 | null | success | AC: Max Fl equals threshold (boundary) |
| TV-001-005 | 1000 | false | 999 | null | success | AC: Max Fl below threshold |
| TV-001-006 | 1000 | false | 0 | null | success | AC: Min boundary (zero) |
Decision Table: Threshold Comparison (With Rox Normalization)
Tests threshold comparison when Rox normalization is enabled. Max Fl must be calculated AFTER Rox divide is applied.
| TV | config.maximum_fl | config.rox_normalization | raw_max_fl | rox_divisor | normalized_max_fl | expected_error_code | rule_result | Covers |
|---|---|---|---|---|---|---|---|---|
| TV-001-007 | 500 | true | 1000 | 2 | 500 | null | success | AC: Normalized equals threshold (boundary) |
| TV-001-008 | 500 | true | 1002 | 2 | 501 | UNEXPECTED_FL | error | AC: Normalized exceeds threshold |
| TV-001-009 | 500 | true | 998 | 2 | 499 | null | success | AC: Normalized below threshold |
Decision Table: Rox Normalization Calculation Order
Verifies that Rox divide is applied BEFORE max Fl calculation, not after.
| TV | raw_readings | rox_values | config.maximum_fl | expected_behavior | Covers |
|---|---|---|---|---|---|
| TV-001-010 | [100, 200, 300] | [1, 2, 3] | 100 | Max of [100/1, 200/2, 300/3] = 100 | AC: Rox divide applied before max calculation |
Decision Table: End-to-End Scenarios
Complete scenarios combining configuration check, normalization, and threshold comparison.
| TV | config.maximum_fl | config.rox_normalization | obs.readings | expected_error_code | rule_result | Covers |
|---|---|---|---|---|---|---|
| TV-001-011 | null | false | [500, 600] | MAXIMUM_FLUORESCENCE_MISSED | error | AC: Missing config, no normalization |
| TV-001-012 | null | true | [500, 600] | MAXIMUM_FLUORESCENCE_MISSED | error | AC: Missing config, normalization enabled (config check first) |
Automation Status
| REQ ID | Test Vectors | Automation Status | Notes |
|---|---|---|---|
| REQ-RULES-UNEXPFL-001 | TV-001-001 to TV-001-012 | Automated | Data-driven parameterized tests |
Traceability to Existing Tests
| Requirement | Jira Tests | Status |
|---|---|---|
| REQ-RULES-UNEXPFL-001 | BT-2554, BT-4167 | Existing |
Gap Analysis
Identified Gaps
| Gap | Requirement | Description | Priority | Owner |
|---|---|---|---|---|
| None | - | All acceptance criteria covered by test vectors | - | - |
Validation Notes
-
BT-4154 Behavior Change: Test vector TV-001-001 specifically validates the updated behavior where null configuration produces MAXIMUM_FLUORESCENCE_MISSED error instead of silently skipping the rule.
-
Rox Normalization Order: Test vectors TV-001-007 through TV-001-010 verify that Rox divide is applied to readings before calculating max Fl, not after.
-
Boundary Testing: Vectors TV-001-004 and TV-001-007 test the exact boundary condition (max_fl equals threshold), which per the AC should NOT trigger an error (only exceeds triggers error).