Peer Code Reviews (7/15/25)

Review: Brandon Woods
General Overview
Brandon’s Hangman implementation is exceptionally clear, well-documented, and efficient. It
demonstrates strong object-oriented design and precise logic flow tailored to assignment
requirements.
Variable Names:
Descriptive and follow conventions: secretWord, remainingGuesses, numberOfHints.
Constant PLACEHOLDER is properly uppercase and meaningful.
No changes needed.
Logic & Efficiency:
chooseWord()): Effective utilization of while loop to avoid repeats.
getHint(): Hint provision optimization with early break.
makeGuess(): Clear logic for Boolean correct/incorrect guesses; proper score keeping.
Good form and logic.
Warnings / Imports:
Unused import of FileNotFoundException (caught generic Exception).
Recommended repair: Remove the import or catch the FileNotFoundException explicitly.
Formatting & Readability:
Properly formatted, thoughtful use of white space, and pretty ASCII section delimiters.
Good inline comments, superb JavaDoc coverage.
Just missing class-level metadata.
In conclusion:
Brandon’s is an excellent implementation: strong, clear, and maintainable. Minor tweaks to
imports and class-level docomments would polish it.

Review: Richard
General Overview:
Richard’s implementation of Hangman is well-reasoned, clean, and nicely OOP-organized. It is
well-documed and well-labeled, so one can easily trace through it. It is test-ready.
Variable Names:
Crisp and intuitive: secretWord, guessedLetters,
Constants and methods named according to Java standards.
No changes needed.
Logic & Efficiency:
chooseWord(): Smart usage of do-while to ensure unique secret words.
getHint(): Appropriate hint decrementing and loop termination after the first found letter.
makeGuess(): Well-handled uppercase conversion, score update, and incorrect letter handling.
Clear, well-structured, and aligned with assignment outcomes.
Warnings / Imports:
All imports are purposeful and actively used.
No issues found.
Formatting & Readability:
Consistent indentation and whitespace.
Balanced inline comments and clear segmentation.
Added personality through ASCII art without losing readability.
Documentation:
Detailed Javadoc on almost every method.
Class header needs completion:
@author [FILL THIS IN]
@since [INSERT THE DATE YOU STARTED WORKING ON THIS]
Add name and start date for full documentation.

Final Reflections:
Richard’s contribution is clean, functional, and well-commented. Nothing but the class level
author & date tags are left for completion.

Journal Entry: Reflecting on the Development of Hangman Game
It was tough but eye-opening to begin working on building the Hangman game. It provided a
good exposure to coding standards, unit testing, and collaborative development.

Improvements and Suggestions
By going through the code, some areas of improvement became apparent. One area of significant
improvement would be to reorganize the code so that the object-oriented concepts are better
adhered to. For instance, separation of concerns through the creation of individual classes for
game logic, word selection, and user interface could yield a more extensible and maintainable
code base. This can be achieved through the Single Responsibility Principle, where each class
can only have one reason for a change.
Additionally, implementing a more robust error handling mechanism would improve the game’s
resilience. Currently, the game might fail silently or behave unexpectedly under certain
conditions. Introducing try-catch blocks and validating user inputs can prevent such issues.

Problems with Unit Tests
Unit testing posed its own set of challenges. The hardest tests to pass were those that involved
the game’s state transitions, such as detecting a win or loss. These tests required careful
manipulation of the game’s internal state to simulate various scenarios, which was timeconsuming and error-prone.
The current tests only concerned themselves with individual methods, validating that they
produced anticipated values. They, though, never tested the game flow nor interactions between
parts. Tests, for instance, never mimicked a complete game session, including several guesses
and subsequent changes to the game state.

Unit Test Enhancement
To enhance the unit tests, I recommend the following:
Comprehensive Coverage: Develop tests that simulate entire game sessions, covering various
scenarios like winning, losing, and invalid inputs.
Mocking Dependencies: Use mocking libraries to mock external object interactions, e.g., file
readers or user inputs, for isolating the game logic during tests.
Boundary Testing: Test edge situations, including repeated guessing, empty inputs, or invalid
characters, to guarantee the game responds well to all possible user interactions.
It would enable more stable and accurate unit tests, thus guaranteeing the game runs correctly
under many different conditions.

Personal Struggles and Team Dynamics
Throughout the development process, I encountered several challenges. Understanding the
intricacies of Java’s object-oriented features, such as inheritance and polymorphism, was initially
difficult. However, through research and practice, I gained a deeper understanding and applied
these concepts effectively in the game.
One of my teammates struggled with implementing the game’s user interface. They found it
challenging to design an intuitive and responsive interface that enhanced the user experience. We
collaborated closely, sharing ideas and resources, which ultimately led to a successful
implementation.
Although some of the coding was obvious, i.e., implementing core game logic, others, i.e.,
intertwining user interface with backend logic, were more difficult. These took careful planning
and coordination to enable smooth interplay between sections.

Victories and Learnings
Despite challenges, there were some successes from the project. Successfully implementing the
logic of the game, including word selecting, guessing, and win/lose determination, was a big
achievement. In addition, having improved the unit tests to handle additional scenarios, the game
became more consistent and more robust.
This project reinforced the importance of modular design, proper testing, and effective teamwork
in the creation of software. It revealed that continuous learning and adapting are essential to
overcome issues and create top-quality software.
Looking back, I understand where I can improve, for instance, by working more on the user
interface and fine-tuning the performance of the game. Yet, the knowledge acquired and the
lessons from this project provide a good foundation for my future work.

Leave a Comment

Your email address will not be published. Required fields are marked *