Skip to content

Lab 3 - More TDD

Objective

More practice with TDD!

Tip

  1. Use the command $ ant build_labs to compile and build the class.
  2. Use the command $ ant run_tests_lab3 to test the class.
  3. Use the script $ ./runLabs1.sh <class name> sometext to run the class.
  4. To pass a String to your class, add an additional parameter to your runLabs1.sh so that the script looks something like: java -classpath lib/java112Labs.jar java112.labs1.$1 $2

    $1 is the parameter for the name of the class you want to run.

    $2 is the first String that will be passed to the main method of your program.
    You can add another parameters, $3, when you want to pass two Strings to your main method.


Instructions

  1. Run the tests.
  2. Write enough code to fix the first failure. Don't worry about the other failures yet, just do one at a time.
  3. Compile.
  4. Repeat steps 1-3 until all tests pass.
  5. Add, commit, and push often!
  6. Once you see this you can start to run the lab:
    student@matcUbuntu:~//projects$ ant run_tests_lab3
    Buildfile: /home/student/projects/build.xml
    
    run_tests_lab3:
        [junit] Running java112.tests.LabThreeTest
        [junit] Tests run: 9, Failures: 0, Errors: 0, Time elapsed: 0.053 sec
    

Screenshots

  • Save screenshot(s) in the projects/screenshots/week2 directory.
  • You may combine the below into one screenshot and name it lab3.png.

    1. lab3-tests.png: The command line output showing all unit tests passing.
    2. lab3-happyPath.png: The command line output when running your program's "happy path".
    3. lab3-errorHandling.png: The command line output demonstrating the error handling in your program.

Submit Weekly Labs

Since this is the last lab of week 2, there are a couple extra steps to "submit" everything:

1. Add, commit, and push!

  1. Add, commit, and push! Refer back to Lab 2.1 if you forgot how to do this.
  2. Verify all work, including screenshots are visible in GitHub. Be sure to go to GitHub.com and make sure everything is there. If you can't see your work at GitHub.com, neither can your instructor!

2. Create a GitHub Issue

Now it's time to notify your instructor that your weekly work is complete.

  1. Go to your repository in GitHub.com, click on Issues, and then New issue.
  2. For the issue title, use: "Week 2 ready for review".

3. Add Weekly Reflection

  1. Copy the below text (there is a copy icon in the upper-right of the textarea) and paste it into the "Add a description" textarea of the GitHub issue.

    @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?
    
    
    #### Based on the "grade bundles" What grade are you aiming for in this class? What Challenge(s) are you hoping to complete?
    
  2. In the GitHub issue, write your answers to the reflection questions.

  3. 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).
  • Screenshot should clearly show any error conditions handled by the program code.
  • 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.