CSCI3901 Lab2-Debugging Solved

30.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: zip solution files instantly, after Payment

Securely Powered by: Secure Checkout

Description

5/5 - (1 vote)

In this lab, you will become familiar with debuggers.

Working individually you will debug a few programs. While the defects in the programs of this lab may not be complicated, use the time to become familiar with how your debugger works before you are faced with complex code.

Do not resort to debugging in this lab using print statements.

Preparation

  • Download java, Ackermann.java, and LinkedListTest.java from Lab 2 in Brightspace

Resources

  • A debugger which allows inspecting variables, breakpoints, stack traces

Procedure

Lab steps

  1. Run HfxDonairExpress on some inputs. You do not need to check invalid input.
  2. Examine the output until you find an incorrect value.
  3. Set a breakpoint at the start of the program.
  4. Select a defect in the program.
  5. Run your program in the debugger and step through the program to identify where the defect happens in the code.
  6. Determine what could fix the defect.
  7. Implement your fix and re-test to ensure that the defect is fixed.
  8. Repeat until no defects remain.

Repeat these steps for Ackermann.java and LinkedListTest.java.

Analysis

What strategy or strategies for debugging are most effective for you?

What makes them effective?

For which conditions of the code will your strategies be effective or ineffective?

How can a debugger support your strategies?

Reporting

  1. In one file, list
    • The cause of the defects that you found.
    • The approach that let you locate the defect.
    • The approximate amount of time it took you to locate the defect.
    • The answers from the questions in the Analysis section of the lab.
  2. Generate a PDF from the document.
  3. Submit the PDF and your Java files in Brightspace in the Lab/Lab 2 section of the course page in Brightspace.
  • Lab_2-c38g2n.zip