Explore BrainMass

Testcase Creation (Example: Vending Machine)

Derive test cases from the following informal specifications for a simple vending machine:

Program CoinBox accepts quarters and distributes coffee.

Users may:
- insert a quarter
- ask for a cup of coffee
- ask for quarters to be returned
Coffee costs 2 quarters.

The test cases should cover each transition of the finite state machine at least once.

© BrainMass Inc. brainmass.com June 18, 2018, 6:49 pm ad1c9bdddf

Solution Preview

The vending machine problem is a simple case of an ordinary vending machine.

Assumptions on working of vending machine:
To keep the working simple let us have a following assumptions.
1. If user inserts only 1 quarter and asks for a cup of coffee, the machine returns the quarter.
2. If the user inserts more quarters and orders for coffee any extra quarter(s) should be returned.

The important tests to be performed are:

1. Test the inserted coin is Quarter or not.
2. Test order coffee functionality.
3. Test return 1 quarter functionality
4. Test return 2 quarters functionality
5. Return quarter when user gives only 1 quarter and order for coffee.
6. Return extra quarters.
7. Order for coffee without inserting quarter
8. Request refund without inserting quarter

Test Case: A test ...

Solution Summary

Solution explains the test case creation process taking Vending Machine as an example.