代写ITECH2309 Assessment Task – Refactoring

- 首页 >> Algorithm 算法

ITECH2309 – Software Engineering
Assessment Task – Refactoring

Overview
For this assessment task, you will use skills developed in tutorial and laboratory classes to document, test and refactor an existing application
This is an individual assessment task, and you must complete the work yourself.
Do not under any circumstances submit the work of somebody else as your own. If you are having trouble with the assignment speak with your course coordinator.

Timelines and Expectations
Percentage Value of Task: 20% Due: Refer to Course Description Minimum time expectation: 20 hrs
Learning Outcomes Assessed
The following course learning outcomes are assessed by completing this assessment task:
•S1. Apply software engineering principles to design and implement software applications
•A1. Write integrated reports, using appropriate models, providing detailed analysis of given textual scenarios.
•A2. Implement software applications, using appropriate software engineering techniques, from a given textual scenario

Assessment Details
This is a simple Java program that models a basic ordering system. There are five classes: Order, Item, Customer, OrderService, and Main.

The Order class represents an order placed by a customer and contains a list of items that the customer has ordered. The calculateTotal() method calculates the total cost of the order based on the prices of the items.
The Item class represents an item that a customer can order. Each item has a name and a price.
The Customer class represents a customer who can place orders. Each customer has a name, an email address, and a list of orders they have placed.
The OrderService class is responsible for managing the orders and customers. It contains a list of customers and provides methods for adding new customers, getting a list of all customers, getting a list of all orders, and calculating the total revenue generated from all orders.
The Main class contains the main() method which creates a new OrderService instance and adds two new customers with their respective orders. Finally, it prints out the total revenue generated from all orders.

This starter application is badly in need of refactoring, and even a casual viewing of the code reveals many examples of “code smells”.
The basic architecture of the system revolves around four classes, with a Main class that manipulates the data and contains some testing code.

Part one – Getting started
Download the base code. In Eclipse, create a new project. You must use Eclipse only.
The following files are included in the base code:
Main.java
Order.java
Item.java
Customer.java
OrderService.java
                Import the files into your project and run it. You should see some test output.
Save a copy of the original output. Your program must continue to generate exactly the same output as you make changes.
Create a report document that you will submit as part of your assignment. Your report must include the outputs described below, plus:
Astatement of completion, indicating which parts of this assignment you have attempted.
A statement of acknowledgement, indicating any assistance you received, who you received it from, and the nature of the assistance. This statement must be included even if you receive no assistance.
A list of references, as applicable

Part two – Familiarity with the code as given
Explore the code and create a UML Class Diagram of the code as provided. You may use draw.io or a different UML diagramming tool.
Your class diagram should include appropriate association connectors, and show private, public, and static members.
Use underline to represent static members.
Include this diagram in your report.

Part three – Code smells
Identify at least four “code smells” in the base code. Use the names as given in the lecture.
Include these in your report, explaining for each:
The name of the code smell,
A snippet of code demonstrating the problem
An explanation of why you think the code has the smell (approx. 50 words per case)
If you use a third-party resource to identify examples of code smells not discussed in class, reference them appropriately.
You may find multiple examples of a single code smell, but your report should not contain four instances of the same problem.
At least two of your identified code smells must require changing the class structure of the code to resolve.

Part four – Refactoring
For each of the code smells you identify above, refactor the code to remove it. Each time you complete a refactoring, run the program to confirm that the program output is the same as the output before refactoring.

Save a zipped copy of your Java files for each code smell you remove by refactoring. Name these zip files appropriately; for example Refactor 1 – Long Method.zip

Part five – Documenting
Create a second UML Class Diagram showing the class structure of your final refactored code. Include this diagram in your report.

Submission
Zip all your work files, preserving the directory structure, and submit via Moodle. Your zip file must contain:
A report document, in Word Document format where possible. PDFs are discouraged unless you are on a non-Windows operating system.
Four (nested) zip files, documenting your progress in refactoring. These must be
numbered and labelled appropriately

Marking Criteria / Rubric
Refer to the attached marking guide.

Feedback
Feedback will be supplied through Moodle. Authoritative results will be published on fdlMarks.
Academic Integrity
To submit your assessment task, you must indicate that you have read and understood, and comply with, the Federation University Australia Academic Integrity and Student Plagiarism policies and procedures (http://policy.federation.edu.au/learning_and_teaching/compliance/academic_integrity/ch02.php).
You must also agree that your work has not been outsourced and is entirely your own except where work quoted is duly acknowledged. Additionally, you must agree that your work has not been submitted for assessment in any other course or program.

This is serious, do not share work with others or ask others to share work with you. If your assignment solution is found on a “class notes” website you risk receiving zero marks for this task.

ITECH2309 – Software Engineering
Marking Guide - Refactoring


CriteriaMaximumObtained
Exploration
•Documentation of existing code as UML Class Diagram
•Description of at least four code smells
- At least two of which require changing class structure to resolve

Refactoring
•Correct and error-free implementation of refactoring of four code smells that changed the class structure
•Documentation of complete refactored code as UML Class Diagram

Quality of written work
•Appropriate use of English and referencing (up to 3 marks deducted)

(-3)
Deductions
•Report includes statement of completion
•Report includes statement of assistance
•Code comments do not align with code implementation

(-1)
(-1)
(-2)
Bonus
•Significant and thoughtful additional work performed to improve the development ergonomics or experience for this code, beyond merely addressing code smells. Document anything extra you do that you think deserves special attention.
3)
Total20

站长地图