6CCS3SMT/7CCSMASE
Tutorial 9 (Week 10)
1. We remind you of the design example from the lecture on finite state machines – a vending machine for coffee. In this question, you will design a vending machine for chocolate bars with the following functional specification:
• Release item after receiving 15 cents
o Single coin slot for dimes (10¢) and nickels (5¢) – assuming sensor specifies
coin type
o Machinedoesnotgivechange
• Draw state diagram by considering the below input sequences: o 3nickels
o 2nickels,dime o Nickel,dime
o Dime,nickel
o Twodimes
*Inputs: N, D, reset *Output: Open
In this tutorial, you will create a test suite based on the FSM model of the specification. Using the FSM modelling the vending machine specification (you may use the solution of Tutorial 4), create test suites as follows:
a) a test suite with 100% state coverage
b) a test suite with 100% transition coverage
c) a test suite with 100% boundary loop coverage.
2. What would change if, for example, the machine had had the option to dispense two types of chocolate bar? There would be two buttons to choose a bar (say, one for Mars and one for Snickers), and the machine gives change. Using the FSM model of the enhanced vending machine (you may use the solution of Tutorial 4), modify your test suites from Section 1 to achieve 100% coverage in the enhanced vending machine.