Inf 43: Introduction to Software Engineering

Spring, 2015
Homework 3: Black-Box Testing of ZotMyHealth
Due Tuesday, June 2, 11:55pm (through EEE)  


This assignment is about testing, specifically partitioning the test-input domain for several requirements of your choice.

For this assignment, you are required to plan for testing of the ZotMyHealth system using a "black box" or specification-based testing approach. In particular, you will develop tests for two of the use cases for ZotMyHealth, listed below. (These two use cases were not necessarily given in the interviews, so don't worry if you did not include them in your requirements specification.) You will not execute any test cases since there is no code available. Use the following two use cases for ZotMyHealth as the requirements specification for this assignment.


Use Case 1: Calculate Body Mass Index (BMI)

In this use case, the user asks the system to calculate their BMI. To accomplish this, the user must input three items:

1. The “feet” portion of their height (must be a valid non-negative number, or else the user will get an error message)

2. The “inches” portion of their height (must be a valid non-negative number, or else the user will get an error message)

3. Their weight in pounds (must be a valid non-negative number, or else the user will get an error message)

Once all three items are inputted, the user can ask the system to calculate the BMI. Assume that the user interface does not allow any of these three items to be blank (e.g., the button to calculate BMI is grayed out unless all three items are entered.) (Hint: none of your test cases should include a blank entry!)

The output of this use case would be their BMI as a floating point number with exactly one digit after the decimal point (round to the nearest tenth). The system should calculate BMI using the following formula:

(weight in pounds * 703) / ((height in inches) ^2)

For example, for a 6-foot, 3-inch person with a weight of 215 pounds, the formula would become:


(215 * 703) / (75 ^2) = 151,145 / 5,625 = 26.9


Thus, a BMI of 26.9 would be calculated for these inputs.


*Note: Regardless of what your basis is for a particular test case, all test cases for this use case must consist of all three items (feet, inches, weight)

*Note 2: If the input results in division by 0, “NaN” is displayed as the BMI.


Use Case 2: Get Workout Recommendations

In this use case, the user clicks a button to ask the system to evaluate their workout patterns and give them recommendations for how to be healthier based on these patterns. 

The algorithm for this function should perform as follows:

* If there are less than five consecutive days of workout tracking (whether there are actually workouts recorded on those days or not), they will get an error message. We can call this message ERROR.

* If the user has worked out at least an average of 30 minutes per day over the last five days (including the current day), the system will give them an encouraging message (e.g., “Your workout patterns look good. Keep up the good work!”). We can call this message GOOD_JOB.

* If the user has worked out less than an average of 30 minutes per day over the last five days (including the current day), the system will give them a message that recommends they work out at least 30 minutes per day. We can call this message WORKOUT_MORE).


The input for your test cases is the set of workout data for the past 5 days, where:

-each day can contain 0 or more workouts

-each workout has a name and a duration (in minutes); assume this is always a positive integer


For example, one of my test case inputs might be: 

{Day 1: jogging 30 minutes

Day 2: jogging 20 minutes, yoga 30 minutes 

Day 3: (none)

Day 4: weight lifting 60 minutes 

Day 5: (none)}. 

The expected output of this test case would be WORKOUT_MORE, since the average of the 5 days is only 28 minutes of exercise per day. 


As another example, if the user only started tracking workouts 3 days ago, the test case input might look like:

{Day 1: untracked

Day 2: untracked

Day 3: weight lifting 45 minutes

Day 4: (none)

Day 5: ballet 60 minutes}.

The expected output of this test case would be ERROR, since less than five consecutive days have been tracked.


You will follow the equivalence class partitioning approach to black box testing. For each of these two use cases, determine exactly three bases, making sure that each of them is a reasonable criterion that can be used to divide the domain of possible test cases into interesting subdomains. For each basis, list at least three subdomains and two test cases for each subdomain. (<- DO NOT OVERLOOK THIS REQUIREMENT—YOU WILL LOSE BIG POINTS IF YOU DO!) Make sure your subdomains cover the whole range of possible inputs. You should avoid overlapping your subdomains whenever possible.

Record your test cases in a collection of 6 test matrices. Your homework should start from the Homework 3 template. DO NOT CHANGE THE FORMAT OF THE TESTING MATRIX. You can add/remove space in between the matrices to keep all of each table on one page, and you can add/remove rows (but not columns) from the matrices. No other edits are allowed. If you do, you will be deducted points. (If you see that an edit is necessary, ask me about it first to makes sure that it's ok.)