CSCI 5308 Assignment 1 Solved

35.00 $

Category:

Description

5/5 - (1 vote)

Objectives

  • Practice developing effective unit tests
  • Practice implementing unit tests with JUnit
  • Practice working with TDD Preparation:

Problem Statement

You have three main tasks in this assignment:

  • Create a set of unit tests using for the provided classes which are already developed
  • The correctness of the code using your unit tests and if you find any bug fix it.
  • Use TDD to design unit tests and develop the parts of code that are missing, use the specification on the comments to do this.

Background

You have inherited some buggy and incomplete code for computing shortest path solutions to the board game Ticket to Ride. The previous developer left the company, so it is your job to finish the software. Your boss has hired you to write a comprehensive set of tests for part of the codebase.

 

Given a game board of rail segments and a list of routes (pairs of cities), the code is supposed to compute the total cost of building a network between the given routes, assuming that the shortest distance for each route is chosen. This can be computed by computing shortest paths for each route using Dijkstra’s shortest path algorithm.

 

You will be provided with a partial codebase for distance computation, a specification, some JUnit5 test class, and a list of classes for which you are to create unit tests.  Your job is to create the test suite, identify and fix the bugs (if any) and finish the methods not implemented in the classes.

Task

  1. Read the specification of what the code is supposed to do in docs/specification.pdf
  2. Create a set of unit tests using JUnit5 using the provided classes. Remember that each class needs to have its own test class, with several tests to check the implemented methods.
    • java
    • java
    • java
  3. Implement a separate test class for each of the above target classes. Some sample empty tests and real tests have been provided. For each test class
    1. Create as many tests for each method of each class as needed. But remember, each method must have at least one unit test.
    2. Each test should provide an appropriate message if it fails.
    3. Use good formatting and documentation in your tests, just like for any source code.
  4. All the test classes should compile and be runnable in IntelliJ. If your test classes do not compile, you will receive 0 on the assignment.
  5. Record all detected errors in a file called txt in the docs directory. Each error should have the following information:
    1. Class name
    2. Method name
    3. Test name that caught the error
    4. Message that the test method generated

 

  • Assignment1-rz5gqe.zip