CST338 - Week 12

Week 12 - Code Reviews

    I reviewed my group's HW01: Hangman code. Overall, we did well on this assignment! I think the main issue that I noticed we all had was getting the output to correctly tally the current score. Since the project didn't touch on this, I don't believe it was a priority to make sure the logic for the current score was set up. All of our test code remained the same, so whatever was outputted should be what we created in Hangman.java. All of our formatting was clear, and our javadoc comments provided plenty of information for methods and fields.

Code Review: Camila

+ sufficient comments for explaining code functions, if not a bit overused

+ all variables are descriptive and can understand their function from their name

+ code is efficient 

+ GameLoaderTest.java, HangmanTest.java tests all passed 

-  HangmanTest.java does not output the word being built with guesses

- TODOs are either not removed after completing, or not being addressed

Code Review: Jose

+ code is efficient 

+ GameLoaderTest.java, HangmanTest.java tests all passed 

+ javadoc comments provide context for methods and the variables within them 

~ javadoc comments could provide a bit more context outside of the text provided by the project

Code Review: Stan

+ plenty of comments for explaining code functions. javadoc explains methods and passed in variables well.

+ GameLoaderTest.java, HangmanTest.java tests all passed  

+ GameLoader.java displays word builder, final score. In my own code, I implemented final score incrementing, but I was unsure if  current score was meant to be incrementing instead, and Stan's code was similar. I think current score is meant to be returned after every completed word, and then a final score is tallied when exiting Hangman. I don't count this as a negative.

~  Header javadoc isn't filled out, does not impact code so not a negative in my eyes.

~ code could be more efficient in the chooseWord() while loop: 

if (wasUsed) {
continue;

// If not used, set up the game state for the new word
} else {
    guessedWords.add(word);
    ... etc.
could be instead: 
if (!wasUsed) {
    guessedWords.add(word);
    ... etc.

Code Review: My own code's reviews, summarized

    I did not implement the random word chosen correctly in chooseWord() - Stan pointed this out. I was wondering why the same words were being chosen in tests, but didn't have enough time to properly fix this error. 

Improvements and Reflections 

  1. My improvements would be to implement a working chooseWord() method, that way the words chosen will actually be random from the file. 
  2. The hardest unit test for me was to get the hintTest to work correctly. The loop to check if the guessed letters contained any of the secret word's letters was not implemented correctly, so the number of guesses was decrementing multiple times incorrectly. I had to review the code lines one-by-one to figure out the issue and fix it.
  3. I think the existing tests could be improved by showing the current score, showing a check for a hint being used, and running additional tests for chooseWord() to ensure that it chooses words randomly.
  4. Following the javadoc instructions was easy for me, but the part I struggled with was getting the tests to work properly, like the hintTest I mentioned earlier.
  5. One of my teammates struggled with the output for the guessed word. I 
  6. I struggled a fair bit with getting the tests to work, and chooseWord() is technically not implemented properly.
  7. Writing the code to get started was easy - there were some things I had to review to understand, like how to read data from a file.
  8. The biggest victory was getting the hintTest to work properly! That had me relieved to know it worked after attempting to fix it for an hour.

Isopod Update: Rare white shark sighting! They burrow in the soil so it is rare to see them. My local pet supply store also has isopod food in stock now, so I don't have to order them online!

Comments

Popular posts from this blog

CST300 - Week 4

CST300 - Week 2

CST300 - Week 5