Reference no: EM132310483
JAVA Assignment -
1. JUnit tests - You are given an API for two classes to be used in a mobile navigation app which plans bus journeys taken by users. The first, TravelStop, represents the location of bus stops. The second, RoutePlanner, allows a start and end location to be specified (these may be selected by the user from a map, but we are not concerned with how that happens), and optionally, a desired leaving time and arrival time.
'Skeleton' classes, with Javadoc documentation, are provided.
A .zip file containing the provided code can be attached.
Tasks -
a. In your report, identify at least two preconditions and two postconditions of methods in the TravelStop and RoutePlanner classes. (Half a page, maximum.)
b. Describe a process for identifying test cases for the classes - what techniques would you use? - and your reasoning process for identifying at least two test cases for each class. Describe what sort of tests they are - are they unit tests, integration tests, or system tests, for instance? (Two pages, maximum.)
c. Identify three further test cases for each class, but you need only give a brief rationale - you need not give your reasonings process in detail. (Two pages, maximum.)
d. Implement five of your tests as JUnit tests, in the test class skeletons provided. Your tests should be given meaningful names, should include explanatory comments explaining their purpose, and any details of how they operate. You do not necessarily need to fill in or use the stub methods provided in the classes; delete any you do not use.
e. Discuss how you would decide when you have written enough tests for the two classes, and how you might identify any further tests that are needed. (One page, maximum.)
2. Alloy model - For this portion of the project, you will need to write an Alloy model for use in specifying the RoutePlanner system.
Tasks -
Write code for signatures and facts which will do the following:
- Declare the existence of a "travel stop" type.
- Declare the existence of a "route" type, which consists of an ordered sequence of travel stops.
- Declare the existence of a "time" type, representing time of day.
We will assume that routes always represent routes suggested by a planner app (rather than simply "possible" routes).
Include an assertion that a route from starting stop A to ending stop B has exactly the same number of items in it as the reverse trip.
Include an assertion that a route from any stop to itself consists of only one stop.
Include explanatory comments in your model code.
Report requirements - Your report should be in PDF format. Any diagrams, charts or tables used must be legible and large enough to read.
Attachment:- Assignment Files.rar