CSCI 2134 Assignment 3
Due date: 11:59pm, Friday, November 6, 2020, submitted via GitObjectivesPractice debugging code, using a symbolic debugger, and fixing errors.Preparation:Clone the Assignment 3 repositoryhttps://git.cs.dal.ca/courses/2020-fall/csci-2134/assignment3/???.gitwhere ??? is your CSID.Problem StatementTake a piece of buggy code, debug it, and fix it.BackgroundYou have inherited some buggy code for comparing JSON objects. Your boss has fired the previ-ous developer because they did not do any testing and did not fix the bugs! She has hired you todebug and fix the code. She will provide you with some unit tests (some of which fail), sampleinput that exhibits bugginess, and sample output of what should be produced. Your job is to fixthe bugs or explain why they can’t be easily fixed: Both the bugs exhibited by the unit tests andthe ones by the input. Good luck!The code is supposed to determine if two JSON objects are the same. JSON, the (JavaScript ObjectNotation) is a widely-used encoding format that makes it easy to exchange data. JSON is a text-based (human readable) format, which makes it ideal for many applications as well as easy todebug.You will be provided with a full buggy codebase for JSON comparison, a specification, a set of unittests using JUnit5, sample input and expected output. Your job is to identify and fix all the bugs.For this assignment, you will need to research the JSON format on the web. For example:https://www.json.org. A brief summary is provided in the specification, but you are encouragedto do more in-depth research. Two example JSON files t1 (equal) and t2 (not equal) are includedin the repository.Task1. Review the specification (specification.pdf) in the docs directory. You will abso-lutely need to understand it and the code you are debugging. The main method for the pro-gram is in JSim.java. Spend some time tracing through the code and creating a diagramof how the classes and code is put together. This will help you a lot later on!2. Fix all bugs that are identified by the tests generated by the unit tests in the following classes:• ArrayValue.java• ObjectValue.java• Pair.java• PrimitiveValue.java• Value.java3. Create a buglist.txt file in the docs directory. For each bug that you fix add an entryto this file that includes:a. The file/class name where the bug was.b. The method where the bug wasc. The line number(s) where the buggy code wasd. A description of what the bug wase. A description of what the fix was.4. The specification states you can assume the input is correct JSON but this is not always thecase. The previous developer made a set of example input and expected output in the sys-tem_tests directory which have strange results. The code usually exits with an error orException when the input is not correct JSON but in some cases may instead report that acorrect JSON object is equal to an incorrect JSON object. Track down the reason:• Compile and run JSim with each of the 8 input files t1.in, t2.in, … t8.in.• Compare the output with the diff command to the expected output t1.expected, t2.ex-pected, … t8.expected• For each output that differs from the expected output, debug the code and determinethe reason for the mismatch. Fix any identified bugs missed by the unit tests.5. Record the identified bugs causing the code to report a correct JSON object is equal to anincorrect JSON object in buglist.txt. Note: Do not try to make the code handle thesecases. We will do so in Assignment 4.6. Record any other bugs found and fixed from Step 4 in the previously created buglist.txt7. Commit and push back the bug fixes and the buglist.txt file to the remote repository.SubmissionAll fixes and files should be committed and pushed back to the remote Git repository.GradingThe following grading scheme will be used:Task 4/4 3/4 2/4 1/4 0/4Bugs foundunit tests4 to 5 bugs arecorrectly identi-fied and docu-mented.Three (3) bugsare correctlyidentified anddocumented.Two (2) bugsare correctlyidentified anddocumented.One (1) bug is cor-rectly identifiedand documented.Zero (0) bugsare correctlyidentified anddocumented.Bugs fixedunit tests4 to 5 bugs arecorrectly fixed.Three (3) bugsare correctlyfixed.Two (2) bugsare correctlyfixed.One (1) bug is cor-rectly fixed.
辅导案例-CSCI 2134-Assignment 3
最新推荐文章于 2024-08-14 07:25:34 发布