Software Testing

Coffee Vending Machine Test Cases

Coffee Vending Machine Test Cases

This tutorial outlines sample test cases for a simple coffee vending machine. Coffee machine can provide many features for the customer. We will stick to a basic machine in this example.

Machine Components

Let’s look into some of the important Coffee machine components to understand the system better. A better understanding of the system under test yields effective test cases.

  • Machine Body
  • Smart card reader
  • Motor
  • Microcontroller
  • Water heating Unit 
  • Container , etc

The Coffee Vending Machine controller is a Finite State Machine(FSM). Let’s assume the machine is capable of making two coffee recipes by default:

  • Cappuccino( Strong /Regular)
  • Espresso (Strong /Regular)

However, the machine operator can add new coffee recipes to the machine. A coffee recipe consists of recipe name, coffee powder units in table spoons, milk in ml, super in table spoons, and recipe price in dollars.

Coffee Vending Machine Testcases

Use cases

The main actors of the system:

  • Customer
  • Machine operator

 

Coffee Vending Machine

 

Test cases

The main intended purpose of the coffee machine for the customer is to make coffee.

Functional Test Cases

Verify that when user deposits money and select the coffee recipe in the menu, the machine should dispense the selected coffee drink to the customer.

Verify that coffee is not dispensed, when the customer does not enter enough money. The money should be returned to the customer.

Verify that upon insufficient inventory, the machine should display an error message to the customer.

Verify that invalid coins are ejected out to the customer.

Functional testcases in table format:

Test Case ID Test Scenario Test Steps Expected Result
TC01 Power ON Machine Switch on the vending machine Machine should power on and display welcome message
TC02 Select Coffee Option Choose “Coffee” from menu options Machine should display selected coffee option
TC03 Insert Sufficient Coins Insert valid coins as per coffee price Machine should accept coins and update balance
TC04 Insert Insufficient Coins Insert fewer coins than required Machine should show “Insufficient Balance” message
TC05 Dispense Coffee After inserting sufficient coins, press “Start” Machine should dispense hot coffee into cup
TC06 Check Sugar Level Option Select sugar level before making coffee Coffee should be dispensed with chosen sugar level
TC07 Check Milk Option Select milk preference (with/without milk) Coffee should be prepared as per selected option
TC08 Cancel Transaction Insert coins → Press “Cancel” Machine should return inserted coins
TC09 Out of Coffee Powder Try ordering when coffee powder is empty Machine should display “Out of Service” or “Refill Required”
TC10 Check Cup Availability Try ordering when cups are empty Machine should display “No Cups Available” message
TC11 Refund Extra Balance Insert more coins than required Machine should return balance after dispensing coffee
TC12 Machine Timeout Leave machine idle after inserting coins Machine should cancel transaction and return coins after timeout
TC13 Invalid Coin Detection Insert invalid coin Machine should reject coin and return it
TC14 Power OFF Machine Switch off the vending machine Machine should shut down safely

 

GUI Test Cases

Verify the Display Menu options for Cappuccino and Espresso.

Verify that the buttons are working properly.