Sunday, September 16, 2007

10. Stack

Download my Stack file here.


Task 1: Installation

Step 1: Download all tools from Standards: QA Tools page and extract all tools to folder named as tools under i.e. c:/tools/**.
Step 2: Follow the instruction to configure ant standards.
Step 3: Copy "tools.jar" file from "C:\Java\jdk1.6.0_02\lib" to "C:\tools\apache-ant-1.7.0\lib".
Step 4: Set Environment Variables:

(Copy and Paste the following lines on command prompt)
set ANT_HOME=c:\tools\apache-ant-1.7.0
set JAVA_HOME=c:\Java\jdk1.6.0_02
set CHECKSTYLE_HOME=c:\tools\checkstyle-4.3
set JUNIT_HOME=c:\tools\junit4.4
set PMD_HOME=c:\tools\pmd-4.0
set FINDBUGS_HOME=c:\tools\findbugs-1.2.1
set SCLC_HOME=c:\tools\sclc-2.5.525
set EMMA_HOME=c:\tools\emma-2.0.5312
set JAVANCSS_HOME=c:\tools\javancss28.49
set PATH=%PATH%;%ANT_HOME%\bin
set PATH=%PATH%;%JAVA_HOME%\bin
set PATH=%PATH%;%CHECKSTYLE_HOME%
set PATH=%PATH%;%JUNIT_HOME%
set PATH=%PATH%;%PMD_HOME%\bin
set PATH=%PATH%;%FINDBUGS_HOME%\bin
set PATH=%PATH%;%SCLC_HOME%
set PATH=%PATH%;%EMMA_HOME%\lib
set PATH=%PATH%;%JAVANCSS_HOME%

Hit Enter.
I follow the above step to setup that I think success to install ant tool.

Task 2: Use Stack as a Template to create a new Project


Step 1: Create new project and named stack-.
Step 2: Download and extract stack-5.0.909.
Step 3: Open eclipse->File->Import->File System->Browse->(look for extract folder from stack-5.0.909)->OK

Task 3: Fix the problems in Stack-so that "verify" passes the build.


What would I do on this part is try invoke those
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
ant -f sclc.build.xml
and look for error report they generate of each invoke, then follow the error to fix violation and bugs.
Finally, I invoke "ant -f verify.build.xml" that will create a folder named build.

Task 4: Add support for the JavaNCSS static analysis tool to your project.


Here is my javancss.build.xml file

Task 5: Improve coverage.


For this task, the emma report show


name
method, %
block, %
line, %
getTop (): Object0% (0/1)
0% (0/3)
0% (0/1)

I took out
public Object getTop() throws EmptyStackException {
return this.top();
}
from ClearStack, and it improve coverage to 100% only of this file.
But I got many error appear on different file, when I took out the above codes.

No comments: