Skip to content

Lab-1-9 – Debugging and Javadoc

Objective

  1. Practice working with code written by another developer.
  2. Practice debugging compiler errors, runtime errors, and logic errors. Many of these are common errors that students encounter in Project 1. My hope is that if you solve them here, they will be much easier to solve if you encounter them again in Project 1.
  3. Practice with an application consisting of multiple files to help prepare you for project 1.
  4. Practice writing proper javadoc style comments.

Program Design

Study the following class diagram and sequence diagram of the Trail Guide application. The purpose of this program is to load a CSV file and parse it for trail information. It then outputs the trails to the console.

Class Diagram

This class diagram was build using IntelliJ, so it looks a little different than the Project 1 Class Diagram.


Trail Guide UML

Sequence Diagram

Whoa! What is this? A sequence diagram is a visual representation of the interactions and communication between objects within an application. It illustrates the chronological order of method calls between these objects, helping to visualize the flow of control and data. Sequence diagrams are valuable for designing, documenting, and understanding the behavior and interactions of different applications.

Use the below diagram to help visulize what is happening in the Trail Builder application. Maybe create a sequence diagram for your Analyzer project?

Trail Guide


Instructions

  1. Download the following classes and save them to your labs1 directory.

  2. Download the following file and save it in your projects directory.

  3. When working properly, this program should display the following output:

  4. Currently, the program has several bugs and it does not compile. Your first job is to fix the compiler errors. Work through these one at a time.

  5. After you fix the compiler errors, and you are able to run the program, you will discover some runtime errors. Your next job is to fix those!

  6. After you fix the runtime errors, carefully compare the program output to the screenshot above to make sure the output is correct. If it isn't, there are more bugs to find.

  7. When the program is working properly, it's time to focus on JavaDoc. To begin this portion of the lab, run ant jdoc, examine the warnings and errors, and resolve each one. The image below demonstrates a clean javadoc execution. Use Oracle’s Javadoc Page or another resource of your choosing to research proper javadoc structure.

  8. Once you acheive a clean javadoc execution, review the generated html documentation (it's in projects/docs) to make sure each class and method has well-formed, descriptive javadoc. If a comment is missing, add it. There are a five TODOs in the source code that will guide some of this work. You should answer the five TODO questions in your weekly reflection.

  9. When you are finished, verify there are not any errors or warnings related to these classes when running ant jdoc, and that your program still compiles and executes as expected.

Screenshots

To receive credit for this lab save screenshot(s) in the projects/screenshots/week4 directory.

You may combine the below into one screenshot and name it lab9.png.

  1. Add a fifth trail, named with your name, to trails.txt. If I were completing this, I might add: "Kari Schumacher,Madison,WI,17".
  2. lab9-output.png: The command line output showing all five trails.
  3. lab9-jdoc.png: The command line output when running ant jdoc

Submit Weekly Labs

  1. Add, commit, and push!
  2. Verify all work, including screenshots are visible in GitHub.
  3. Create a new issue in GitHub: "Week 4 ready for review".
  4. Copy the below text and paste it into the "Add a description" textarea. Answer the reflection questions in the space provided.

    @kkschumacher
    
    #### How are you doing? 
    **Are you encountering any issues preventing you from completing this week's assignments? What can I do to better support you this week?**
    
    #### What did you find particularly enlightening this week?
    
    
    #### What challenges (if any) did you encounter in your learning this week?
    
    
    #### What questions (if any) do you have about the material covered this week?
    
    
    #### Answers to the 5 TODO questions located in Lab 9
    
    1. 
    
    2. 
    
    3.
    
    4.
    
    5. 
    
  5. Click "Submit new issue"


Rubric

All of the following must be satisfied to achieve a "Met" status

  • Screenshot should clearly show tests passing.
  • Screenshot should clearly show expected output when running the program (happy path).
  • Code and screenshots are properly named and saved in the correct directory.
  • All lab steps have been accurately and appropriately implemented.
  • Code adheres to the course coding standards.
  • Commit messages are concise, atomic, and effectively describe the change(s) made.
  • JavaDoc documentation is properly implemented, providing clarity and understanding of the code's functionality and usage.
  • External sources (websites, classmates, AI tools, etc), if utilized, are referenced and documented within the code as comments.

Additional Considerations

  • Issue created correctly with thoughtful answers to the reflection questions.
  • JavaDoc questions answered correctly in the issue (5 TODO questions in the code).
  • Screenshot shows Ant jdoc executed with no errors.