Monday, September 15, 2008

Code Review - Code Ruler

Purpose
To identifying violations of Java coding and documentation standards.
To look at how the code perform the task in efficient and effective manner.

Reviewed code - Mari-Lee Flestado

FileLinesViolationComments
MyRuler.java1ICS-SE-Java-2Used wildcards"*" in import statements.
MyRuler.java95EJS-5Code has wrong indent for "}"
MyRuler.java12,13,14,*EJS-8Used "hard" tabs.
MyRuler.java109, 119EJS-9Did not use meaningful name
MyRuler.java91EJS-61Used end-line Comment


Summary
The entire documentation was understandable enough, except some missing JavaDocs for class and methods. During the excution of the CodeRuler, it constantly throws ArrayIndexOutOfBoundsException when the ruler has no castles. This is because the code tries to command to a castles which is not exists. Her strategy for peasants was same as mine which find a random direction for the next move and this works fine in the competition. Her strategy for knights has a small logical error that all knights actually try to only attack enemy's castles which she was not intended to. This is because there are three commands to each knight in one turn. Therefore, the program always try to run the last command to the knights which attack the enemies' castle. Overall, other than the issues with some logical errors, the code was readable and easy to understand.

Link to Mari-Lee Flestado's code
http://www2.hawaii.edu/~flestado/marilee.zip

Link to Mari-Lee Flestado's Blog
http://mari-leeflestado.blogspot.com/

No comments: