Sunday, September 16, 2007

Stack - Experience of Ant & QAs

Stack-shaoxuan-5.0.916 is released. Distribution package can be download from stack-shaoxuan-5.0.916.zip.

The goal of this assignment is to learn Ant build system and Open source Java automated quality assurance tools (FindBugs, Checkstyle, PMD, etc). It is an interesting experience.

Task and Problems:
There are five tasks in the assignment. All of them has been completed. I have encountered some problems when installing QA tools and creating JavaNCSS project(Task 1 & 4). The other 3 tasks are easy.
problems in these tasks are mainly because I got my Macbook this week and it is the first time I use the Mac OS. I took a long time to figure out how to set the environment variables when I was trying to install those QA tools. Then when I trying to build the JavaNCSS project, the CLASSPATH thing held me for a while again. But now, when I solved all these task, I learnt things not only about Ant and QA tools, but also Mac OS.
The most important things in these tasks is to setup environment variables for every QA tools. It is significant to make then run right. In Mac, I need to run a terminal and use vi to create/modify a file named .profile in my home directory(where cd ~ will take you to). You cannot see the .profile in Finder, that is the reason why I confused. In the file I put all the definition of all the environment variables. When doing task 4, I got confused with the CLASSPATH because there is not a CLASSPATH definition when typing printenv, but the java compiler runs well. Then I know that it is because JAVA has enhanced in Mac OS and the compiler will search default directory for java classes. I can use CLASSPATH=./:{other directory} to add new destinations to CLASSPATH. But later, I found that the class required by javancss can be defined inside javancss.build.xml. That is a better way and I use it.
When improving the unit tests, I think it is easy that just add lines to test every methods and use the try/catch expressions to test the exceptions.

Impression of Ant and QA tools:
Ant is really a great tool that facilitate the automatic building procedure. Though its command structure is not so easy to learn from the beginning, its power enable us to build however we want to.

Difference between SCLC and JavaNCSS:
Though these two tools are both use to count lines in code files, SCLC count also blank line, which I think is useless, while JavaNCSS counts CCN(Cyclomatic Complexity Number) and average of NCSS, CCN and Javadoc per project/package/class/method, which make sense in knowing about the complex of your code. Therefore, JavaNCSS is what I prefer.

No comments: