Reference no: EM132548020
ITECH2309 Software Engineering - Federation University Australia
Case Study: Over The Moo
Question
Answer this question based on the information provided in your case study.
Extract Method is a refactoring used to remove several bad code smells. For this question, you will be demonstrating how to use the Extract Method for a small section of code to generate a sales invoice for your case study. Use Eclipse to write the code for both parts a) and b).
a) Write a method to generate a sales invoice for your case study. This method needs to include a code bad smell that you will later remove in part b using Extract Method. Note that this only needs to be a small example - just one method, and you can make up names for parts of code that would exist outside your method as long as the names clearly reflect what the object would do. The sales invoice needs to include a company header, purchaser details (name and delivery address), the contents of a shopping cart and the total value of the shopping cart.
Copy this code into a Microsoft Word document (or similar), with a heading to clearly identify that this is your answer to part a.
b) Rewrite the method to remove the bad code smell using Extract Method. Copy your rewritten code into the same Microsoft Word document, with a heading to clearly identify that this is your answer to part b.
Save your document as a .pdf file and upload it as part of your answer. Other file types will not be accepted.
c) Write a description of the code you have written for both parts a) and b). This needs to identify the bad code smell you have included and explain the process you have followed to remove the bad code smell from your code implementing the Extract Method refactoring.
Attachment:- case study - over the moo.rar