common/Metrology/Measurements.UnitTests/MeasurementResults.feature
2026-04-23 17:50:07 +02:00

298 lines
23 KiB
Gherkin

Feature: MeasurementResults
DUT: Device under test
REF: Reference for measurements, either a weight scale or a REF-meter
[SRS_TBF_COMMON_METRO_001] DUT measured volume calculation
For the Static Start/Stop the measurement-time is out of focus because the REF volume will be obtained
from a weight-scale or a REF meter. Therefore the DUT-volume can be directly calculated using the
difference between the start- and stop-volume taking an overflow into account:
DutVolumeCm [m³] = (DutStopVolumeCm [m³] + DutOverflowVolumeCm [m³]) - DutStartVolumeCm [m³]
[SRS_TBF_COMMON_METRO_002] DUT measured time calculation
For the DUT-time can be directly calculated using the difference between the start- and stop-time given by
the DUT and the overflow time:
DutTimeS [s] = (DutStopTimeS [s] + DutOverflowTimeS [s]) - DutStartTimeS [s]
[SRS_TBF_COMMON_METRO _003] DUT measured flow-rate calculation
For the flow-rate calculation the individual DUT-volume and the DUT-time is being needed:
DutFlowRateQmPh [m³/h] = DutVolumeCm [m³] / DutTimeS [s] * 3600 [s/h]
[SRS_TBF_COMMON_METRO _004] DUT versus REF volume correction
For the Flying Start/ Stop Measurement the REF time is being used to recalculate the volume during
the test time, due to the fact, that the start and stop data record may be delayed by the software program
flow or the unpredictable operational system timing:
CorrDutVolumeCm [m³] = DutFlowRateQmPh [m³/h] * RefTimeS [s] / 3600 [s/h]
[SRS_TBF_COMMON_METRO _005] DUT to REF scale factor calculation
The calibration is being done using the measured DUT-volume of each individual path, the REF-volume, measured
by a weight scale or a REF meter, and for the flying start/stop measurement the timings of the individual
DUT-channel and the precisely timing of the REF system. The absolute values are going to be used to calculate
the unit-less scale factor:
ScaleFactorRefToDut [] = |RefVolumeCm| / |DutVolumeCm|
[SRS_TBF_COMMON_METRO _006] DUT from REF deviation calculation
The deviation at a specific flow rate shall be calculated using the REF and the measured volume. The
deviation calculation shall be based on absolute values to be independent of the direction of the flow rate:
DeviationDutToRefRel [] = (|DutVolumeCm [m³]| - |RefVolumeCm [m³]|) / |RefVolumeCm [m³]|
DeviationDutToRefPer [%] = DeviationDutToRefRel [] * 100%
[SRS_TBF_COMMON_METRO _007] Channel assignment check
It shall be checked if the required and the start- and end-record-channels are identical to avoid comparison
of unequally channels.
#############################################################################################################
Scenario: 1.0_[SRS_TBF_COMMON_METRO_001]_DutVolumeCalculation_VALID_volume
Given Assign measurement values
| Test | DutStartVolumeCm | DutStopVolumeCm | DutStartTimeS | DutStopTimeS | Comment |
| 0 | 0.0 | 6.0 | 0.0 | 180.0 | Positive direction |
| 1 | 0.2 | 6.2 | 0.0 | 180.0 | Offset volume |
| 2 | 0.0 | -6.0 | 0.0 | 180.0 | Negative direction |
| 3 | -0.2 | -6.2 | 0.0 | 180.0 | Offset volume |
| 4 | -0.2 | 5.8 | 0.0 | 180.0 | Zero crossing |
# only start- and stop-records input
When Calculate measurement results - minimal input
Then Test measurement results
# DutVolumeCm [m³] = (DutStopVolumeCm [m³] + DutOverflowVolumeCm [m³]) - DutStartVolumeCm [m³]
| Test | DutVolumeCm | State | Comment |
| 0 | 6.0 | Okay | Positive direction |
| 1 | 6.0 | Okay | Offset volume |
| 2 | -6.0 | Okay | Negative direction |
| 3 | -6.0 | Okay | Offset volume |
| 4 | 6.0 | Okay | Zero crossing |
# -----------------------------------------------------------------------------------------------------------
Scenario: 1.1_[SRS_TBF_COMMON_METRO_001]_DutVolumeCalculation_VALID_volume with overflow
Given Assign measurement values
| Test | DutStartVolumeCm | DutStopVolumeCm | DutStartTimeS | DutStopTimeS | DutOverflowVolumeCm | Comment |
| 0 | 0.0 | 2.0 | 0.0 | 180.0 | 4.0 | Positive direction |
| 1 | 0.2 | 2.2 | 0.0 | 180.0 | 4.0 | Positive direction |
| 2 | 0.0 | -2.0 | 0.0 | 180.0 | -4.0 | Negative direction |
| 3 | -0.2 | -2.2 | 0.0 | 180.0 | -4.0 | Negative direction |
# start-, stop-records and overflow volume input
When Calculate measurement results - over flow volume input
Then Test measurement results
# DutVolumeCm [m³] = (DutStopVolumeCm [m³] + DutOverflowVolumeCm [m³]) - DutStartVolumeCm [m³]
| Test | DutVolumeCm | State | Comment |
| 0 | 6.0 | Okay | Positive direction |
| 1 | 6.0 | Okay | Positive direction |
| 2 | -6.0 | Okay | Negative direction |
| 3 | -6.0 | Okay | Negative direction |
# -----------------------------------------------------------------------------------------------------------
Scenario: 1.2_[SRS_TBF_COMMON_METRO_001]_DutVolumeCalculation_INVALID_volume
Given Assign measurement values
# start- and stop-time needed to avoid abortion due to DutTimeS <= 0
| Test | DutStartVolumeCm | DutStopVolumeCm | DutStartTimeS | DutStopTimeS | DutOverflowVolumeCm | Comment |
| 0 | 0.0 | 0.0 | 0.0 | 180.0 | 0.0 | DUT didn't measure |
# start-, stop-records and overflow volume input
When Calculate measurement results - over flow volume input
Then Test measurement results
# DutVolumeCm [m³] = (DutStopVolumeCm [m³] + DutOverflowVolumeCm [m³]) - DutStartVolumeCm [m³]
| Test | DutVolumeCm | State | Comment |
| 0 | 0.0 | ZeroDutVolume | DUT didn't measure |
#############################################################################################################
Scenario: 2.0_[SRS_TBF_COMMON_METRO_002]_DutTimeCalculation_VALID_time
Given Assign measurement values
| Test | DutStartVolumeCm | DutStopVolumeCm | DutStartTimeS | DutStopTimeS | Comment |
| 0 | 0.0 | 6.0 | 0.0 | 180.0 | Time increasing |
| 1 | 0.0 | 6.0 | 10.0 | 190.0 | Time offset |
# only start- and stop-records input
When Calculate measurement results - minimal input
Then Test measurement results
# DutTimeS [s] = (DutStopTimeS [s] + DutOverflowTimeS [s]) - DutStartTimeS [s]
| Test | DutTimeS | State | Comment |
| 0 | 180.0 | Okay | Time increasing |
| 1 | 180.0 | Okay | Time offset |
# -----------------------------------------------------------------------------------------------------------
Scenario: 2.1_[SRS_TBF_COMMON_METRO_002]_DutTimeCalculation_VALID_time with overflow
Given Assign measurement values
| Test | DutStartVolumeCm | DutStopVolumeCm | DutStartTimeS | DutStopTimeS | DutOverflowTimeS | Comment |
| 0 | 0.0 | 6.0 | 0.0 | 80.0 | 100.0 | Time with overflow |
| 1 | 0.0 | 6.0 | 100.0 | 80.0 | 200.0 | Start time higher |
# start-, stop-records and overflow time input
When Calculate measurement results - over flow time input
Then Test measurement results
# DutTimeS [s] = (DutStopTimeS [s] + DutOverflowTimeS [s]) - DutStartTimeS [s]
| Test | DutTimeS | State | Comment |
| 0 | 180.0 | Okay | Time with overflow |
| 1 | 180.0 | Okay | Start time higher |
# -----------------------------------------------------------------------------------------------------------
Scenario: 2.2_[SRS_TBF_COMMON_METRO_002]_DutTimeCalculation_INVALID_time
Given Assign measurement values
# volumes not needed due to early abortion of execution due to time check <= 0 which is physically impossible
| Test | DutStartTimeS | DutStopTimeS | DutOverflowTimeS | Comment |
| 0 | 0.0 | 0.0 | 0.0 | DUT didn't measure |
| 1 | 100.0 | 80.0 | 0.0 | End time below start time |
| 2 | 0.0 | 80.0 | -100.0 | Negative overflow time |
| 3 | -10.0 | 80.0 | 0.0 | Negative start time |
| 4 | 0.0 | -80.0 | 0.0 | Negative stop time |
| 5 | -100.0 | -80.0 | 0.0 | Negative start and stop time |
# start-, stop-records and overflow time input
When Calculate measurement results - over flow time input
Then Test measurement results
# DutTimeS [s] = (DutStopTimeS [s] + DutOverflowTimeS [s]) - DutStartTimeS [s]
| Test | DutTimeS | State | Comment |
| 0 | 0.0 | ZeroDutTime | DUT didn't measure |
| 1 | -20.0 | InvalidDutTime | End time below start time |
| 2 | -20.0 | InvalidOverFlowTime | Negative overflow time |
| 3 | 90.0 | InvalidDutTime | Negative start time |
| 4 | -80.0 | InvalidDutTime | Negative stop time |
| 5 | 20.0 | InvalidDutTime | Negative start and stop time |
#############################################################################################################
Scenario: 3.0_[SRS_TBF_COMMON_METRO_003]_DutFowRateCalculation_VALID_records with overflow
Given Assign measurement values
| Test | DutStartVolumeCm | DutStopVolumeCm | DutOverflowVolumeCm | DutStartTimeS | DutStopTimeS | DutOverflowTimeS | Comment |
| 0 | 0.0 | 1.8 | 4.2 | 0.0 | 180.0 | 0.0 | Positive direction |
When Calculate measurement results - full input
Then Test measurement results
# DutFlowRateCmPh [m³/h] = DutVolumeCm [m³] / DutTimeS [s] * 3600 [s/h]
| Test | DutVolumeCm | DutTimeS | DutFlowRateCmPh | State | Comment |
| 0 | 6.0 | 180.0 | 120.0 | Okay | Positive direction |
# -----------------------------------------------------------------------------------------------------------
Scenario: 3.1_[SRS_TBF_COMMON_METRO_003]_DutFlowRateCalculation_INVALID_records
Given Assign measurement values
| Test | DutStartVolumeCm | DutStopVolumeCm | DutOverflowVolumeCm | DutStartTimeS | DutStopTimeS | DutOverflowTimeS | Comment |
| 0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | DUT didn't measure |
| 1 | 0.0 | 0.0 | 0.0 | 0.0 | 180.0 | 0.0 | DUT didn't measure |
When Calculate measurement results - full input
Then Test measurement results
# DutFlowRateCmPh [m³/h] = DutVolumeCm [m³] / DutTimeS [s] * 3600 [s/h]
# DutTimeS will be checked first and cause abortion before DutVolumeCm check
| Test | DutVolumeCm | DutTimeS | DutFlowRateCmPh | State | Comment |
| 0 | 0.0 | 0.0 | null | ZeroDutTime | DUT didn't measure |
| 1 | 0.0 | 180.0 | 0.0 | ZeroDutVolume | DUT didn't measure |
#############################################################################################################
Scenario: 4.0_[SRS_TBF_COMMON_METRO_004]_DutVersusRefVolumeCorrection_VALID_Ref time
Given Assign measurement values
# REF-volume is needed to avoid abortion due to REF-volume equals 0.0
| Test | DutStartVolumeCm | DutStopVolumeCm | DutStartTimeS | DutStopTimeS | RefVolumeCm | RefTimeS | Comment |
| 0 | 0.0 | 6.2 | 0.0 | 186.0 | 6.0 | 180.0 | Positive direction |
| 1 | 2.0 | 8.2 | 0.0 | 186.0 | 6.0 | 180.0 | Offset volume |
| 2 | 0.0 | -6.2 | 0.0 | 186.0 | 6.0 | 180.0 | Negative direction |
| 3 | -2.0 | -8.2 | 0.0 | 186.0 | 6.0 | 180.0 | Offset volume |
| 4 | -2.0 | 4.2 | 0.0 | 186.0 | 6.0 | 180.0 | Zero crossing |
When Calculate measurement results - full input
# CorrDutVolumeCm [m³] = DutFlowRateCmPh [m³/h] * RefTimeS [s] / 3600 [s/h]
Then Test measurement results
| Test | DutVolumeCm | DutTimeS | DutFlowRateCmPh | CorrDutVolumeCm | State | Comment |
| 0 | 6.2 | 186.0 | 120.0 | 6.0 | Okay | Positive direction |
| 1 | 6.2 | 186.0 | 120.0 | 6.0 | Okay | Offset volume |
| 2 | -6.2 | 186.0 | -120.0 | -6.0 | Okay | Negative direction |
| 3 | -6.2 | 186.0 | -120.0 | -6.0 | Okay | Offset volume |
| 4 | 6.2 | 186.0 | 120.0 | 6.0 | Okay | Zero crossing |
# -----------------------------------------------------------------------------------------------------------
Scenario: 4.1_[SRS_TBF_COMMON_METRO_004]_DutVersusRefVolumeCorrection_INVALID_Ref time
Given Assign measurement values
# REF-volume is needed to avoid abortion due to zero REF-volume
| Test | DutStartVolumeCm | DutStopVolumeCm | DutStartTimeS | DutStopTimeS | RefVolumeCm | RefTimeS | Comment |
| 0 | 0.0 | 6.2 | 0.0 | 186.0 | 6.0 | 0.0 | REF time zero |
| 1 | 0.0 | 6.2 | 0.0 | 186.0 | 6.0 | -180.0 | REF time invalid |
When Calculate measurement results - full input
# CorrDutVolumeCm [m³] = DutFlowRateCmPh [m³/h] * RefTimeS [s] / 3600 [s/h]
Then Test measurement results
| Test | DutVolumeCm | DutTimeS | DutFlowRateCmPh | CorrDutVolumeCm | State | Comment |
| 0 | 6.2 | 186.0 | 120.0 | 6.2 | ZeroRefTime | REF time zero |
| 1 | 6.2 | 186.0 | 120.0 | 6.2 | InvalidRefTime | REF time invalid |
#############################################################################################################
Scenario: 5.0_[SRS_TBF_COMMON_METRO_005]_DutToRefScaleFactorCalculation_VALID_Ref volume static start stop
Given Assign measurement values
# DUT-time is needed to avoid abortion with zero or invalid meter time even if static start stop is independent
# of DUT- and REF-time, it simply compares the given volumes
| Test | DutStartVolumeCm | DutStopVolumeCm | DutStartTimeS | DutStopTimeS | RefVolumeCm | Comment |
| 0 | 0.0 | 6.0 | 0.0 | 180.0 | 6.0 | Volumes identical |
| 1 | 0.0 | 5.4 | 0.0 | 186.0 | 6.0 | REF volume higher |
| 2 | 0.0 | 6.6 | 0.0 | 190.0 | 6.0 | DUT volume higher |
When Calculate measurement results - ref volume input
# ScaleFactorRefToMeter [] = |RefVolumeCm| / |DutVolumeCm|
Then Test measurement results
| Test | DutVolumeCm | DutTimeS | DutFlowRateCmPh | RefFlowRateCmPh | ScaleFactorRefToDut | State | Comment |
| 0 | 6.0 | 180.0 | 120.0 | null | 1.0 | Okay | Volumes identical |
| 1 | 5.4 | 186.0 | 104.516 | null | 1.1111111 | Okay | REF volume higher |
| 2 | 6.6 | 190.0 | 125.053 | null | 0.9090909 | Okay | DUT volume higher |
# -----------------------------------------------------------------------------------------------------------
Scenario: 5.1_[SRS_TBF_COMMON_METRO_005]_DutToRefScaleFactorCalculation_VALID_Ref time and volume flying start stop
Given Assign measurement values
| Test | DutStartVolumeCm | DutStopVolumeCm | DutStartTimeS | DutStopTimeS | RefVolumeCm | RefTimeS | Comment |
| 0 | 0.0 | 6.2 | 0.0 | 186.0 | 6.0 | 180.0 | Volumes identical |
| 1 | 0.0 | 5.58 | 0.0 | 186.0 | 6.0 | 180.0 | REF volume higher |
| 2 | 0.0 | 6.82 | 0.0 | 186.0 | 6.0 | 180.0 | DUT volume higher |
When Calculate measurement results - full input
# ScaleFactorRefToMeter [] = |RefVolumeCm| / |DutVolumeCm|
Then Test measurement results
| Test | DutVolumeCm | DutTimeS | DutFlowRateCmPh | CorrDutVolumeCm | RefFlowRateCmPh | ScaleFactorRefToDut | State | Comment |
| 0 | 6.2 | 186.0 | 120.0 | 6.0 | 120.0 | 1.0 | Okay | Volumes identical |
| 1 | 5.58 | 186.0 | 108.0 | 5.4 | 120.0 | 1.1111111 | Okay | REF volume higher |
| 2 | 6.82 | 186.0 | 132.0 | 6.6 | 120.0 | 0.9090909 | Okay | DUT volume higher |
# -----------------------------------------------------------------------------------------------------------
Scenario: 5.2_[SRS_TBF_COMMON_METRO_005]_DutToRefScaleFactorCalculation_INVALID_Ref volume
Given Assign measurement values
# DUT-time is needed to avoid abortion with zero or invalid meter time even if static start stop is independent
# of DUT- and REF-time, it simply compares the given volumes
| Test | DutStartVolumeCm | DutStopVolumeCm | DutStartTimeS | DutStopTimeS | RefVolumeCm | Comment |
| 0 | 0.0 | 6.0 | 0.0 | 180.0 | null | REF volume null |
| 1 | 0.0 | 6.0 | 0.0 | 180.0 | 0.0 | REF volume zero |
When Calculate measurement results - ref volume input
# ScaleFactorRefToMeter [] = |RefVolumeCm| / |DutVolumeCm|
# if REF-volume is null, a simple calculation of DUT parameters is executed, therefore the state is "Okay"
Then Test measurement results
| Test | DutVolumeCm | DutTimeS | DutFlowRateCmPh | RefFlowRateCmPh | ScaleFactorRefToDut | State | Comment |
| 0 | 6.0 | 180.0 | 120.0 | null | null | Okay | REF volume null |
| 1 | 6.0 | 180.0 | 120.0 | null | null | ZeroRefVolume | REF volume zero |
#############################################################################################################
Scenario: 6.0_[SRS_TBF_COMMON_METRO_006]_DutFromRefDeviationCalculation_VALID_Ref time and volume flying start stop
Given Assign measurement values
| Test | DutStartVolumeCm | DutStopVolumeCm | DutStartTimeS | DutStopTimeS | RefVolumeCm | RefTimeS | Comment |
| 0 | 0.0 | 6.2 | 0.0 | 186.0 | 6.0 | 180.0 | Volumes identical |
| 1 | 0.0 | 5.58 | 0.0 | 186.0 | 6.0 | 180.0 | REF volume higher |
| 2 | 0.0 | 6.82 | 0.0 | 186.0 | 6.0 | 180.0 | DUT volume higher |
When Calculate measurement results - full input
# DeviationDutToRefRel [] = (|CorrDutVolumeCm [m³]| - |RefVolumeCm [m³]|) / |RefVolumeCm [m³]|
# DeviationDutToRefPer [%] = DeviationDutToRefRel [] * 100%
Then Test measurement results
| Test | DutVolumeCm | DutTimeS | DutFlowRateCmPh | CorrDutVolumeCm | RefFlowRateCmPh | DeviationDutToRefRel | DeviationDutToRefPer | State | Comment |
| 0 | 6.2 | 186.0 | 120.0 | 6.0 | 120.0 | 0.0 | 0.0 | Okay | Volumes identical |
| 1 | 5.58 | 186.0 | 108.0 | 5.4 | 120.0 | -0.1 | -10.0 | Okay | REF volume higher |
| 2 | 6.82 | 186.0 | 132.0 | 6.6 | 120.0 | 0.1 | 10.0 | Okay | DUT volume higher |
# -----------------------------------------------------------------------------------------------------------
Scenario: 6.1_[SRS_TBF_COMMON_METRO_006]_DutFromRefDeviationCalculation_INVALID_Ref volume
Given Assign measurement values
| Test | DutStartVolumeCm | DutStopVolumeCm | DutStartTimeS | DutStopTimeS | RefVolumeCm | Comment |
| 0 | 0.0 | 6.0 | 0.0 | 180.0 | null | REF volume null |
| 1 | 0.0 | 6.0 | 0.0 | 180.0 | 0.0 | REF volume zero |
When Calculate measurement results - full input
# if REF-volume is null, a simple calculation of DUT parameters is executed, therefore the state is "Okay"
Then Test measurement results
| Test | DutVolumeCm | DutTimeS | DutFlowRateCmPh | DeviationDutToRefRel | DeviationDutToRefPer | State | Comment |
| 0 | 6.0 | 180.0 | 120.0 | null | null | Okay | REF volume null |
| 1 | 6.0 | 180.0 | 120.0 | null | null | ZeroRefVolume | REF volume zero |
#############################################################################################################
Scenario: 7.0_[SRS_TBF_COMMON_METRO_007]_ChannelAssignmentCheck_INVALID_channel input
Given Assign measurement values
| Test | StartChannel | EndChannel | RequiredChannel | Comment |
| 0 | 1 | 0 | 0 | Records do not match |
| 1 | 0 | 1 | 0 | Records do not match |
| 2 | 0 | 0 | 1 | Wrong channel required |
When Calculate measurement results - channel input
# Are the StartChannel, EndChannel and RequiredChannels equal?
Then Test measurement results
| Test | State | Comment |
| 0 | WrongChannel | Records do not match |
| 1 | WrongChannel | Records do not match |
| 2 | WrongChannel | Wrong channel required |
############################################################################################################