Question: 1 . Testing using whitebox techniques ( 3 0 marks ) Read the following scenario and then answer the questions given: A vending machine dispenses

1. Testing using whitebox techniques (30 marks)
Read the following scenario and then answer the questions given:
A vending machine dispenses either hot or cold drinks. If you choose a hot drink (e.g.
tea or coffee), it asks if you want milk (and adds milk if desired), then it asks if you
want sugar (and adds sugar if required), and finally, your drink is dispensed.
A flow graph for this vending machine might look something like this:
2
a. Using this flow chart, draw a control flow diagram. (Hint: the structure will be
much the same as the above).
b. Using the following tests, what is the statement coverage achieved for each of
the following tests and for both tests together?
Test 1: Dispense a cold drink
Test 2: Dispense a hot drink with milk and lots of sugar
c. Using the same tests as in (b), what is the decision coverage achieved?
d. What additional tests (if any) would be needed to achieve 100% statement
coverage?
e. What additional tests (if any) would be needed to achieve 100% decision
coverage?
f. How many tests are required to achieve 100% path coverage? What are these tests

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!