Lab 3 - More TDD
Objective
More practice with TDD!
Terminal Commands
- Compile & Build
$ ant build_labs - Run Tests
$ ant run_tests_lab3 - Run Lab
$ ./runLabs1.sh <class name> sometext
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
- Run the tests.
- Write enough code to fix the first failure. Don't worry about the other failures yet, just do one at a time.
- Compile.
- Repeat steps 1-3 until all tests pass.
- Add, commit, and push often!
- 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/week2directory. -
You may combine the below into one screenshot and name it
lab3.png.lab3-tests.png: The command line output showing all unit tests passing.lab3-happyPath.png: The command line output when running your program's "happy path".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!
- Add, commit, and push! Refer back to Lab 2.1 if you forgot how to do this.
- 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.
Watch: Creating GitHub Issues
- Go to your repository in GitHub.com, click on Issues, and then New issue.
- Select 00 Weekly Labs Ready for Review.
- Enter the title: Week 2 Labs
Do not click Create yet
3. Enter Your Reflection
- In the body of the GitHub issue, write your answers to the reflection questions. You may choose to type directly in the issue, or write in another document and copy/paste it into the issue once complete. You will be asked the same four question each week with the labs.
- Now Click Create.
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.