November 17, 2025 CST338 Wk03 Learning Journal: HW 1 Code Review
Morgan Beebe
Nov 17, 2025
CST338
Wk03 Learning Journal: HW 1 Code Review
I reviewed France, Lee, Ashley, Bryan, and Alexander.
My feedback:
Overall the variable names are solid but could be more clear. For example in line 73, a Random object is defined to the variable name rng, instead it makes more sense to use the variable name random or randomObject. If we used a RandomGenerator object then rng would be the best choice.
Everyone seemed to struggle with constant JavaDoc comments.
What improvements would you make to your code/what was suggested?
I need to work on naming methods and using random().
Which unit tests were the hardest to pass?
getHint() was probably the hardest to figure out. gameWinTest() was also hard if it kept giving wrong output, took me a while to figure out.
How do the existing tests function and could they be improved?
HangmanTest checks for file reading, word loading, game state, losing and winning logic, hints decreasing. GameLoaderTest checks for input, running Hangman menu, invalid or valid input, winning and returning correct score. Could be improved with printing less to the console so it is easier to check for errors. Coult add a test for duplicate guesses.
Do the existing unit tests cover the full range of the sub classes?
Covers most of Hangman and all of GameLoader. Could test for gameLoop multiple games or other menu items like zz exit. Could also check for exact printed messages.
How would you change the unit tests?
Add tests for gameLoop with multiple games, zz exit, exact printed text, duplicate guesses, if file is loaded, short words, repeated letters.
Keep in mind I do not want them to change but this doesn't mean I think they are perfect. Reading through the tests is a good way to learn what the code should do. Thinking about how to test the code is a good way to learn how to make tests.
What did you struggle with?
Trying to make my output match the expected output was the biggest challenge. Exact spacing, mixing up letters in strings and catching them, what order to print in.
What did one of your teammates struggle with?
One of my teammates had difficulty matching the java class to the assignment specifications and created Hangman as a whole program instead of a class.
Was any part of the code a struggle for YOU?
The code wasn't the struggle, the matching output was more for me. Having too many or too few } when I’m adding and polishing methods.
Was any part of writing the code easy for YOU?
Once the skeleton was figured out, it wasn't too difficult to code. The easiest part was setting up constructors and getters and setters now that you showed us how to just right click and generate.
What was your biggest HW1 victory?
Getting all the tests to pass was my biggest victory.
Comments
Post a Comment