Background
You have inherited some buggy code for computing shortest path solutions to the board game
Ticket to Ride. Your boss has fired the previous developer because they did not do any testing
and did not fix the bugs! She has hired you to debug and fix the code. She will provide you with
some unit tests (some of which fail), sample input and sample output of what should be produced.
Your job is to fix the bugs: Both the bugs exhibited by the unit tests and the ones by the
input. Good luck!
You will be provided with a full buggy codebase for JSON comparison, a specification, a set of unit
tests using JUnit5, sample input and expected output. Your job is to identify and fix all the bugs.
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.
0 comments