Requirement: write a function to change a flat tire. It needs to remove the flat tire and put the spare tire on.
Looks pretty straightforward. We must be done.
Actually, this function is missing a lot of requirements.
- Find safe level place to get out of traffic,
- Put transmission in gear or park turn motor off and set parking brake,
- Activate Hazard lights and place flares to warn other driver,
- Remove jack, lug wrench and spare tire,
- Carefully pry off hub/center cap if necessary to access lug nuts,
- Loosen lug nuts slightly in a crisscross pattern,
- Raise the tire off the ground with the jack and finish removing lug nuts,
- Remove the flat tire and replace it with the spare tire,
- Replace the lug nuts and get them slightly snug,
- Tighten the lug nuts in a crisscross pattern,
- Put tools, hub/center cap, and flat tire back in the car,
- REPAIR/REPLACE FLAT TIRE!
This is a pretty complete procedure to change a flat. There is still a lot missing though. What if the driver do not know how to change a flat. What if the lug nuts won’t loosen. What if the spare is missing or flat.
The point is, replace and install tire is entirely too vague. It would be like going to a restaurant and telling the wait staff that you want “food”.