Unit Test Plan: MAP Calculation, Categorization, and Validation

Verified

Added on  2023/01/23

|7
|1168
|65
Report
AI Summary
This report presents a comprehensive set of test plans designed to evaluate the functionality and robustness of a Mean Arterial Pressure (MAP) calculation system. The tests cover various aspects, including the calculation of MAP based on Systolic Blood Pressure (SBP) and Diastolic Blood Pressure (DBP) values, the categorization of MAP values into low, normal, and high ranges, and data validation to ensure the integrity of the input. The report details test cases with different input values, including boundary and error conditions like negative values and scenarios where DBP exceeds SBP. It also demonstrates the system's error handling capabilities, such as prompting the user for valid input when data validation fails. The test results are presented with screenshots, showcasing the expected and actual outputs, and highlighting the system's ability to handle various test scenarios, including complete test runs with multiple records, and edge cases. The report also includes the limitations of the current implementation, such as the precision of the MAP value and the number of records that can be processed.
Document Page
ASSIGNMENT 1
STUDENT NAME:
STUDENT ID:
UNIT NAME:
UNIT CODE:
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
TEST PLANS
Map Calculation and Categorization
MAP = (1.0 / 3.0 * sbp) + (2.0 / 3.0 * dbp);
1. Map Test Plan
TEST ID INPUT OUTPUT
SBP DBP MAP VALUE CATEGORY
EXPECTED ACTUAL
1 60 40 46.7 46.67 low
2 100 70 80.0 80.0 normal
3 180 120 140.0 140.0 high
4 120 300 - - -
5 -100
100
70 Prompt for positive SBP / DBP value
80.0 ( 80.0 is map value after -100 is changed to 100)
normal
HIGHEST MAP VALUE: 140.0 140
LOWEST MAP VALUE: 46.7 46.7
AVERAGE MAP VALUE: (46.7 + 80.0 + 140.0 + 80.0) / 4
= 86.7
86.7
Note: divided by 4, not 5, as one record was skipped
NOTE:
Given that the provided DBP value (300) is greater than SBP value (120),
An appropriate error message is to be displayed to the user and NO processing is performed for that
particular record. In the MAP Test Plan table above, test ID: 4 capture this aspect. As the map value
and category are not computed, hyphens (-) have been used to fill the cells as not Output data is
available.
User Input Data Types Validation
Given that the provided input value is not of expected data type, display an error message then
prompt for the same data again, without having to start afresh. Also, data validation has been made
to ensure that no negative values are excepted where they should not. Test ID 5 in the Test Results
sections demonstrates this.
Useful information for Test Plan Generation
Normal Pressure Range
sbp 90 – 120
dbp 60 – 80
MAP 70 – 100
Since MAP Value is calculated from the values of SBP and DBP,
MAP’s normal pressure range is thus used to categorize MAP values.
MAP Values below 70 are dimmed as “low”, those higher than 100 as “high”, while anything else
falls under “normal”.
Document Page
TEST RESULTS
Two make test results easy to follow along; screenshots with minimal number of records have been
used. Even then, the last two screenshots capture the complete and comprehensive test results.
For tests with one record, the lowest value MAP value, Highest MAP value and Average happen to
be the same. While this might seem strange at first, it is logically correct that the highest MAP value
also happens to be the lowest MAP value. This happens either when only one record is provided, or
when the provided records yield the same MAP value. The latter is however rare.
TEST ID 1: MAP values categorized as ‘low’
When the resulting MAP value is below 70, it is categorized as being “low”
TEST ID 2: MAP values categorized as ‘normal’
When the resulting MAP value falls between 70 and 100, it is categorized as being “normal”
TEST ID 1: MAP values categorized as ‘low’
TEST ID 2: MAP values categorized as ‘normal’
Document Page
TEST ID 3: MAP values categorized as ‘high’
The MAP value is categorized as “high” if it is greater than 100.
TEST ID 4: When DBP Value is Greater Than SBP
Given that the provided value for DBP is greater than or equal to that of SBP, then an error message
is displayed to the user, and that record is skipped. Test ID 6 captures this behavior in a more vivid
way when compare to test id 4. The reason this is: as test 4 is to compute one record, skipping it
means that the program comes to an end. As this can easily be misinterpreted to mean that the
program exists when DPB is greater than SBP, the test plan was redesigned to include at least
another record after the one that requires skipping. (See Test ID 6)
TEST ID 3: MAP values categorized as ‘high’
TEST ID 4: When DBP Value is Greater Than SBP
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
TEST ID 5: Negative Pressure Values
Validation meant to ensure that SBP and DBP values are neither of undesired type nor negative.
When this happens, the user is prompted to enter that value again, until a valid value has been
provided. This saves the user from having to redo everything from scratch every time a mistake has
been made when providing the records.
TEST ID 5: Negative Pressure Values
Document Page
TEST ID 6: Complete Test Run
This test result is a combination of all previous small tests, run in a continuous manner.
It captures all the main functionality requirements, along with some of the data validation features
taken to improve on user experience and error handlings. As the results were a bit long for one
screenshot, two screenshots (part 1&2) have been included.
Part 1 of 2: TEST ID 6: Complete Test Run Part 2 of 2: TEST ID 6: Complete Test Run
Document Page
Limitation:
The precision of the MAP value is to one decimal place both for individual record output and for
the summary output too.
When calculating the Average MAP value, the values used are all to one decimal place. These
values are to one decimal place as the implementation of value method within the MAPCalculator
class returns the MAP value to one decimal place.
At the moment, the calculation for the lowest MAP value, Highest MAP value and the Average
MAP value is done within the main method.
I feel the program would have been more modular and easier to maintain in the future, if this
functionality was to be transferred into the MAPCalculator class as a Method, like the way the
category method works.
When the DBP value is greater than or equal to that of SBP, the record is ignored.
Thus, when calculating MAP average value, any ignored / skipped record is not included. This is
achieved using a separate counter called processedRecords that get incremented if and only if the
provided record passes all the validation rules.
Number of Records is currently limited to 10. The user is prompted to rectify the provided value
when it exceeds the expected maxNumOfRecords or when is below 1
As there is data structure to track all existing Record Identifiers, it is possible to have records with a
duplicate identifier.
chevron_up_icon
1 out of 7
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]