In this assignment you are required to document, test and refactor an existing C# application. You will be given a copy of an existing C# application which is responsible for setting up fully automated fuel delivery system, this application is badly in need of refactoring and even a casual viewing of the source code reveals many examples of the “code smells” talked about in Fowler’s book.
Your report should be written in the same manner as Fowler has done in the prescribed text - small refactorings with code comparisons and UML diagrams (refer Fowler pp.1-65). Ask your tutor if you have any doubts.
A petrol station is set up for fully automated operation. Drivers swipe their credit card through a reader connected to the pump; the card is verified by communication with a credit company computer; and a fuel limit is established. The driver may then take the fuel required. When fuel delivery is complete and the pump hose is returned to the holster, the driver’s credit card account is debited with the cost of the fuel taken. The credit card is returned after debiting. If the card is invalid, the pump returns it before fuel is dispensed.
The system should provide an unattended fuel delivery service where a specified amount of fuel is delivered to customers. The cost is deducted from the customer’s credit card account.
The sequence of actions to dispense fuel should be: