Sunday, September 16, 2007

10. Stack

Summary: I think this was our first 'serious' project in this class. Luckily a lot of the difficulties were overcome since we had everything pre-packaged for us in a handy ZIP file.

Which of the five tasks were you able to complete successfully? All.


What problems did you run into, and how did you resolve them. What is your impression of Ant?

I'll cover this for each part.

Task 1: Installation - A recurring theme of these open source tools is that they don't have the usual setup procedures that I'm used to. Because of this, that is part of the reason I'm starting to see as to why these tools aren't mainstream, at least not yet.

Aside from that, the process was generally straightforward - download the package, unzip to a directory, update environment variable, test if its installed correctly with the build.xml in the stack package. The only other difficulty involved PMD version available, since the tools page stated 3.7, whilst the PMD sourceforge page only had 4.0 and 3.9 available to download.

Task 2: Creating the project - Straightforward.

Task 3: Fixing verify.build.xml errors - Nothing too difficult. It did scare me for a while about how when I would save files it would sometimes state that certain classes couldn't be found - I initially thought this was because I renamed an existing project and it would cause me to change class names to be the same as the project. Luckily that isn't what needed to be done - I just had to remake the project.

Also, I was surprised by some of the things pointed out by the tools - I would never think of using the cached instances rather than creating a new Integer object for values from -128 to 127.

Task 4: Writing an Ant script for JavaNCSS - This is the portion I had the most difficult with. I think this is largely due to me not knowing how Java too well - and how the tools (jar, javac, ant, etc) look for their files. The Ant script documentation was helpful; however; the following errors came up at one point when 'testing' the script:

- Main class javancss.JavancssAntTask could not be found

fixed by adding javancss.jar to classpath; then a similar error came up for ccl.jar. Eventually I just put all the JAR files in the classpath separating them with semicolons; Brian did suggest a better way using wildcard modifiers.

- Parse error

... mainly due to not using the correct syntax for the source input files.

3 days later and 4 headaches later, it works.

Task 5: Code Coverage - Was easy compared to task 4, although I didn't notice some tasks involved ClearStack rather than Stack, and so I ended up writing two new test cases.


Are there standards that we are using that you don't understand the motivation for?

The only standard I find questionable is the one involving the asterisk in package declarations - if we are using the entire package, why is it wrong to do so?


What is the difference between SCLC and JavaNCSS, and which counting tool do you prefer?

SCLC looks more general (e.g. it supports multiple types of files), while JavaNCSS is specifically geared towards Java. I think this is a question of which you'd prefer between a specialized knife or a swiss army knife. I personally would take the specialized knife in this case; however, for my own everyday use (e.g. outside of specific Java-specific programming) I would probably prefer SCLC, since I rarely do Java development outside of this class.


My code: http://www2.hawaii.edu/~wongandr/stack-5.0.916.zip

1 comment:

Philip Johnson said...

Please make the link to your code a link. :-)