Tuesday, September 30, 2008

Stack Overflow Review

I recently took a look at http://stackoverflow.com/ which is a site that computer programmers can go to ask for help. I have some thoughts on the site. I thought the reputation and badge system was a very clever way of getting more people to respond to questions and to get good answers out of people. It's a good thing that there's a way to vote on whether the answers are good or bad. The content is provided by the users and there's a system in place to control the chaos of the masses. As for how well the site provides answers, I just stumbled onto this relevant question from the site. In it is a discussion on the quality of the answers. It appears that providing a detailed question will increase the likelihood of having a good answer. The user was annoyed by Google responses he recieved for some of his questions. Seems like the best way to avoid that is to also add to your question what you have tried that didn't work.

In terms of structure this site reminds me of Digg.com and other similar sites. Through OpenID, I used my Blogger website as a login to the site. I'm curious about how it can ensure that I'm the person who I say I am. It would be nice if the questions were placed in categories like C, C++, and Java to give it more of a structure than just relying on tags. It's nice though that the questions can be categorized by newest, hottest, votes , active, unanswered.

Wednesday, September 24, 2008

Using Ant

Introduction

The focus of this assignment was to use QA tools to debug some sample code. For the assignment I used Ant along with Checkstyle, PMD, FindBugs, and JUnit.

Installation

First of all, I downloaded Ant, Findbugs, Checkstyle, JUnit, and PMD along with stack-6.0.911.zip. I unzipped all the files to a single directory. One of the biggest obstacles that I encountered was just installing the tools that I needed. I often found myself googling for instructions. Once I got the first few tools installed the rest of them were easy cause they followed similar steps. Much of it had to do with setting up environmental variables.

QA Testing

Afterwards I ran through the gamut of tools to test that if they all worked. The commands that I used were:
  • ant clean compile
  • ant -f checkstyle.build.xml
  • ant -f dist.build.xml
  • ant -f findbugs.build.xml
  • ant -f javadoc.build.xml
  • ant -f junit.build.xml
  • ant -f pmd.build.xml
Once those ran correctly I opened up Eclipse and started on the process of debugging the Stack project. Fixing the bugs that Checkstyle found were the easiest cause it gave suggestions on what should be changed. Junit found issues relating to how a stack returned the top element. Instead of returning the top element of a stack, the program was returning the bottom element. FindBugs told me to use Integer.valueOf(int) instead of new Integer(int) which I never knew until know that it was an issue. There was a problem with the testIllegalPop() so I removed the try/catch block and added @Test(expected = EmptyStackException.class). PMD told me to add the final keyword to certain variables and I also had to change a few ArrayList to an interface List.

Conclusion

At first I was fustrated at getting all these tools up and running but now after using them I realized that these things will make my life much easier. I wouldn't be surprised if one day I would abhor the thought of not being able to use them in my programming.

Here is a distribution of the project: stack-johnzhou-6.0.924.zip

Wednesday, September 10, 2008

CodeRuler

www2.hawaii.edu/~johnzhou/ICS413/john.km.zhou.rar