Question: Assignment A BlueJ starter project will be provided to you. It will contain five classes Location, LocationTest, Station, StationTest, and StationDemo. The version of the
Assignment
- A BlueJ starter project will be provided to you. It will contain five classes Location, LocationTest, Station, StationTest, and StationDemo. The version of the classes provided have many of the methods completed to help get you started and provide the syntax and approach to use for the methods you will code. You need to complete and code methods following any guiding comments within the code and meeting requirements described in this write up.
- You must use the provided BlueJ starter project and develop your solution using the BlueJ IDE.
- Do NOT change the name, return type, or parameter order/type of any of the class or test class methods. These are used by Web-CAT to grade your submission, and you will end up losing points if they are changed.
Each class (in this assignment, Station and Location) constructor and method should be tested by a unit test method in the test class (in this assignment, StationTest and LocationTest). Besides serving to verify that your code is accomplishing what you intended, examining the unit test methods will help you understand how the objects should behave (how the class methods create, access, and mutate the object). That is, first writing the test methods helps guide your class coding efforts. Follow these steps to complete this assignment:
-
- Find and correct any syntax errors so that the classes in the project compile cleanly.
- Review the first JUnit test method, completing the code if necessary. Note that proper testing includes making manual calculations to verify that expected values for a method action are equivalent to actual results.
- Once you feel the unit test method is a valid and robust test of the methods expected behavior, review the corresponding class constructor or method and complete the coding if necessary.
- Run the JUnit test for the method. If it does not pass, review and correct the code for this method.
- When the test passes, continue in like manner for the next and subsequent methods, iteratively completing tests and developing your class or classes. All class methods must be tested.
- All classes must compile cleanly.
- Check your programming style using the Check Style tool provided within BlueJ (Tools Checkstyle).
- Document the overall project in the README file as directed in the Action Items for the Lab.
- Submit your completed lab to Web-CAT using BlueJ (Tools Submit) and review the Web-CAT results for errors. Repeat the above steps as needed to resolve any errors.
- The class StationDemo included in the project file demonstrates the use of the Station and Location classes, calling on its constructors and methods and displaying results. While it supports your understanding of the lab, it is not part of the actual solution. You can modify it if that is helpful to you, but the driver class will not be examined by Web-CAT nor graded by your instructor.
- An excel spreadsheet is included in the starter project folder. You can use it to create your test cases for the calcDistance methods. Creating spreadsheets to test complicated calculations is a practice you might want to use in this and future labs.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
