Your Galway train booking says ‘Cancelled’. Did the seat go back on sale?
You cancel a seat on a train to Galway. The screen says ‘Booking cancelled’. But when someone else goes to book, is that seat available again? A confirmation is easy to spot. The seat count is where you find out whether the whole action worked.
You’ve already tested small pieces of code on their own. Here, you pass six available seats into a Python helper. It returns seven, as expected. That unit test tells you the arithmetic works in isolation. It doesn’t tell you whether cancelling a booking actually uses the result.
You select ‘Cancel booking’. The booking module records the cancellation, the seat inventory makes the seat available again, and the screen shows a confirmation. When you exercise that user action and check its results against the requirement, you’re doing a function test.
You’ve already checked that the seat-count helper adds one. Now you want to test the cancellation feature against its requirement. Which option checks the two results a user should be able to see? Pick one.
Use a test train with no other bookings or cancellations during the test. Set up an active booking for one seat and record how many seats are available. Before you select ‘Cancel booking’, write down what you expect: ‘Booking cancelled’ and one more available seat.
You start with six available seats and expect seven after cancelling a booking for one seat. Select ‘Cancel booking’. You see ‘Booking cancelled’, as expected, but the count still reads six. Record a fail: six doesn’t match seven, even though the message is correct.
This time you start with twelve available seats and cancel an active booking for one seat. You see ‘Booking cancelled’, and the count changes to fourteen. Compare that with what you expected. What should you record? Pick one.
You might tick ‘pass’ as soon as you see the confirmation. But the screen can show that message even if the seat inventory never updates. To judge the function, compare each actual result with its expected result. One correct result can’t make up for the other.
Suppose your trace shows that the code gets seven from the helper but never saves it. Change the code to save the new count in the seat inventory. Reset the test and rerun it. An immediate pass doesn’t prove the update lasts. Check again in a new session later, with no other changes.
If asked to distinguish the tests, start with scope. A function test checks cancellation: start with a full train, cancel one seat and expect confirmation and one available seat. A system test exercises the complete system: check that another customer can then book that seat and receive a booking confirmation.