CST338: Software Design, Week 3
HW01 Reflection: Hangman
What improvements would you make to your code or what was suggested?
Most of the feedback I received was positive, with small suggestions focused on stylistic preferences. One classmate suggested renaming a boolean variable from found to something more descriptive like isFound, which I agree would improve clarity. Another mentioned that using a Random object to select words instead of pulling them in a fixed order would be a better practice. Both of those are good suggestions I’d consider incorporating.
Which unit tests were the hardest to pass?
The hardest part was making sure the output in the console exactly matched the expected test output.
How do the existing tests function and could they be improved?
The tests are very precise and rely heavily on the output format. They’re designed to ensure that not only is the functionality correct, but that the user sees the expected messages in the right order. I don’t think they need to be changed, but I can see how they might be improved by being a little more flexible with minor output formatting differences, especially if the functionality is still correct.
Do the existing unit tests cover the full range of the subclasses?
Yes, they do a good job covering the functionality across the main and supporting classes. The tests touch on guessing logic, score tracking, hint behavior, word selection, and game state display. They make sure the game works from start to finish under various conditions.
How would you change the unit tests?
I wouldn’t change them because I think the precision they require has value. Reading through the tests definitely helped me understand the assignment better and gave me ideas on how to write stronger tests in the future.
What did you struggle with?
Making sure every console output matched exactly was probably the most tedious part. It was easy to overlook small differences, and I had to rerun the tests a lot to catch those minor mismatches.
What did one of your teammates struggle with?
One teammate struggled with making sure the guessed word and guessed letters were consistently shown after each guess. Their game logic worked, but some test cases failed because the output wasn’t complete or wasn’t being printed at the right time.
Was any part of the code a struggle for YOU?
In the beginning, writing the logic for makeGuess() was a little tricky. I had to be careful about how and when to update the guessed word, decrement guesses, and avoid repeat guesses. Once I got that under control, the rest started to fall into place.
Was any part of writing the code easy for YOU?
Setting up the file loading and reading the word list was straightforward for me. I’m comfortable working with files and loops, so that part of the project went smoothly.
What was your biggest HW1 victory?
Getting all the unit tests to pass on the first try after finishing my final edits felt like a huge win. It meant my logic, output, and structure were all in sync, and the time I spent double-checking each piece really paid off.
Comments
Post a Comment