Wednesday, September 30, 2009

SideStep Steps up with Better QA

After suffering a tragic defeat at the Robocode Tournament last week. I was determine to return victorious for the next tournament. As you all know, my robot (SideStep) was able to consistently beat all but one of the 8 sample robots, which was pretty good. But ironically, most of my classmates modeled their robots off that ONE robot(Walls) that it can't beat. Hence forcing me to revise my robot....

Luckily this week we're learning about Quality Assurance using Ant and Ivy build system. These build system are great tools for almost any programmer. It consolidate a bunch of automated quality tools such as Checkstyle, FindBugs, and PMD all in one. Using these tools will cut out a lot of time spend searching for errors in your code and proof reading for formatting errors.

To perform the automated quality assurance on our project we had to invoke the following commands:

  • ant -f checkstyle.build.xml
  • ant -f pmd.build.xml
  • ant -f findbugs.build.xml

After running these commands, checkstyle was the only one that returned with errors.

Missing package-info-.java file. line 0 (1 error)
Missing a Javadoc comment. (5 error)
*After fixing errors above*
First sentence should end with a period. (1 error)
Expected @param tag for "robotDistance". (1 error)

Most of the error were in the javadoc comments, since none of my previous course ever stress on it. I've never ran into a missing package-info-.java file error before and had no clue what it is. After looking at the sample project giving by our professor, I realized that I was missing a package.html file which I later created and the error was fixed.

These tools helped my immensely because I was constantly hacking up my codes conducting trail and error in attempt to beat Walls. After many fail attempts I've realize why I was losing to it. It was because I would use up all my energy moving and firing it ending up being disabled. I didn't work to change the movement or velocity because that was the bread and butter of my robot. So I decide to lower the firepower of the bullets, and voila. Walls ends up being disabled before mine does and it becomes a sitting duck.

Now, I'll just wait patiently to see what improvements the my "Walls" competition made.
If you want to see source code, you can click SideStep v. 1.1.

0 comments:

Post a Comment