Use Approval testing to get test coverage of some existing code
The aim of the exercise is to build automated tests for a supermarket cash register using approval testing.
The supermarket has a catalog with different types of products (rice, apples, milk, toothbrushes,…). Each product has a price, and the total price of the shopping cart is the total of all the prices of the items. You get a receipt that details the items you’ve bought, the total price and any discounts that were applied.
The supermarket runs special deals, e.g.
Buy two toothbrushes, get one free. Normal toothbrush price is €0.99
20% discount on apples, normal price €1.99 per kilo.
Create some test cases with approval testing and aim to get good coverage of the special deal price calculations.
In order to do this exercise you will need to have a programming environment on your machine for Java, C#, Typescript, Ruby or Python, and preferably also a code coverage tool.