Analyze source code and develop comprehensive unit test

Assignment Help Computer Engineering
Reference no: EM131981472

Assignment:

You are required to document, test and refactor an existing C# application, which is responsible for taking bookings for a theatre booking system. The current application this application is badly in need of refactoring and even a casual viewing of the source code reveals many examples of the "code smells" discussed by Fowler.

Learning Outcome Assessed

The following course learning outcomes are assessed by completing this assessment:

i) Explain the significance of detailed project planning and control, good communication and documentation and the use of appropriate tools in order to provide a quality product

ii) Discriminate between software engineering and programming, and thus the distinction between a software configuration and a program.

iii) Analyze source code and develop comprehensive unit test suites.

iv) Operate CASE software to document the design of a piece of software.

iv) Apply refactoring to identify poor programming practice in existing source code and improve its structure and readability

Introduction:

You are required to document, test and refactor an existing application. You will be given a copy of an existing C# application which is responsible for taking bookings for a theater, this application is badly in need of refactoring and even a casual viewing of the source code reveals many examples of the "code smells" discussed by Fowler.

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, M., & Beck, K. (2000).

Refactoring : improving the design of existing code. Reading, MA: Addison-Wesley. pp. 1-65). Ask your tutor if you have any doubts.

Notes about the assignment

• Theatres have three sections: stalls, dress circle and balcony

• Each theatre section has a number of rows and each section row has the same number of seats.

• Each section has a different price per seat, Stalls $30.00, Dress circle $50.00, Balcony $90.00

• Customers must register with the system prior to placing a booking (Customers must present credit card information when registering)

• Customers may be members or nonmembers of the "Theatre Club"

o Non-members pay full price per seat

o Members fall into three categories: bronze, silver and gold. Bronze, Silver and Gold members are entitled to a discount of 10%, 20% and 30%, respectively off their booking.

• The system will automatically reserve a given number of seats in a requested section

o The seats are booked in the first row of a section which is found to have the number of requested seats free adjacent to each other.

o The application searches a section from the first row working backwards towards the last row until it finds the requested number of seats.

o There is no facility to book a particular seat.

• The system can potentially manage many theatres, each theatre has a number of theatre bookings (events) and each theatre booking has a number of customer bookings.

• Customers can currently only make a single booking for each event.

Requirements:

Report detailing any "code smells" present in the code and how you intend to refactor them out of the code

• A refactored version of the system eliminating all identified code smells

• A class diagram illustrating the initial code and another class diagram illustrating the final refactored code (including all relevant dependencies)

• Sequence Diagram: Calculation of Charges (represent the calls made by the refactored system when calculating the charges for a booking)

• Sequence Diagram: Booking Seats (represent the calls made by the refactored system when booking seats in response to a reservation)

• A sequence diagram illustrating how the final refactored system processes a new booking

• Extensive NUnit tests for the methods Calculation of Charges and Booking of Seats

• Add a loyalty rewards system. That theater is running a new promotion to include more members. If a Gold member includes his/her friend as the new member of the Theater, s/he (Gold member) will receive a further 15% in next booking. This numbers are 10% and 5% for silver and bronze members, respectively.

• The existing application doesn't allow to book any particular seat. Include an appropriate method in your code base so that only the Gold members can book a particular seat. If that particular seats is not available, the user may try for more 2 time to select another seat. However, when all the chances are gone, that booking will be performed in usual system.

• Your report should identify any of Fowler's "Bad Smells" in the code, and which refactorings you performed to improve the application's design. Refactor the code using the textbook and the refactoring example from the lectures as a guide. The resultant code should be generally free from Fowler's "code smells", this will become obvious when you start writing your NUnit tests and documenting the refactored system in UML.

Attachment:- Assignment-Code-Base.zip

Reference no: EM131981472

Questions Cloud

What is the purpose of municipal bonds-corporate bonds : What is the purpose of municipal bonds? How are they different from corporate bonds, i.e. taxation and risk?
Provide a brief summary of your chosen project : Describe at least three (3) key milestones and /or deliverables for your project.Provide a brief summary of your chosen project.
Explain the development stages of teams : Similarities and differences between face-to-face teams and virtual teams. Factors in virtual teams that result in success and inhibit success.
Compute the present value of the pension fund liabilities : Compute the present value of the pension fund's liabilities, by setting up a portfolio of zero coupon bonds that delivers exactly the cash flows required,
Analyze source code and develop comprehensive unit test : Analyze source code and develop comprehensive unit test suites. Operate CASE software to document the design of a piece of software.
Conduct a job analysis of customer service representative : Your company prides itself on providing high-quality products and services. The Customer Service department is integral to the success of the company.
Describe how people form opinions of others : Describe how people form opinions of others and respond to others' opinions of them. Analyze how to explain one's own behavior and the behavior of others.
Indifferent between these two investment opportunities : Calculate the rate that you would need to earn on the one-year security next year to be indifferent between these two investment opportunities.
Explain trading securities : Explain trading securities ( debt v/s equity). Give 1 example of debt and 1 of equity securities?

Reviews

Write a Review

Computer Engineering Questions & Answers

  What is the contribution of natural convection of heat loss

A 2-m-diameter thin-walled stainless steel spherical tank is filled with chemicals undergoing a reaction. The reaction releases heat through the tank.

  Explain why the algorithm produces the correct result

Exercise an iterative way of generating all permutations of the sequence (0, 1, . . . , n - 1). Explain why the algorithm produces the correct result.

  How much dough mix and topping mix are leftover

Bryant's Pizza, Inc. is a producer of frozen pizza products. The company makes a net income of $1.00 for each regular pizza and $1.50 for each deluxe pizza produced. How much dough mix and topping mix are leftover

  Draw a k-map for a function in two variables

What are the minterms represented by cells adjacent to this cell?

  Construct the binary search tree

Construct the binary search tree for the following input stream, assuming no balancing or pivoting is done: Frodo, Bilbo, Smaug, Gandalf, Wormtongue, Denethor, Sauron, Galadriel, Aragorn.

  Prepare a class diagram to illustrate your computer class

Prepare a class diagram to illustrate your Computer class. Prepare the source code that implements your Computer class.

  Provide to string methods for the choice question classes

Add a method add Text to the Question superclass and provide a different implementation. Provide to String methods for the Question and Choice Question classes.

  Create an application with four classes

Create an application with four classes. Three of the classes should contain data and behavior characteristics for circle, rectangle, and cylinder.

  how to make financial projections for alternative solutions

The executive committee decided that steps must be taken to increase the accuracy of the financial projections so they will more closely match the results that are achieved.

  Explain how bar code readers work

How does the use of online transaction processing (OLTP) improve the timeliness of online real-time processing?- Explain how bar code readers work.

  Educating about computer viruses and malware

The University of Calgary provides a senior-level computer science course known as, “Computer Viruses and Malware.” The course taught the students how to write the viruses, worms, and Trojan Horses. It also describes the history of the computer vi..

  Make java class that creates an array of integers

Write down a Java class that creates an array of integers, fills it with values, prints the unsorted values, sorts the values into ascending order, and finally prints the sorted values.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd