Monday, September 29, 2008
Code Coverage Using Emma
Bug Problems with 100% Code Coverage
public Object getTop() throws EmptyStackException {
return this.top();
}
public Object getTop() throws EmptyStackException {
return this.pop();
}
Tuesday, September 23, 2008
Using Ant/QA Tools to Build a Robust Program Package
As programmers there are many tools out there that streamline the writing process and optimize code. Some tools create all in one programming environments to work in (IDE's), some tools help you to build projects, and others do all sort of cool things that clean-up and optimize code. Previous to taking ICS413 I was never exposed to these technologies (apart from IDE's). I never knew the power these sorts of things hold in a programming environment.
- Checkstyle 5 Beta - checks source code mainly for layout issues based on a coding standard.
- PMD 4.2.3 - Checks source code for things like bugs, dead code, overcomplicated expressions, etc.
- JUnit 4.5 - A framework for writing and running automated tests.
- FindBugs 1.3.5 - Uses static analysis of byte code to look for possible bugs.
- Ant 1.7.1 - A Java based build tool. 'Make, but without Makes wrinkles'
export ANT_HOME="/Users/tylerwolff/Documents/ICS/Tools/apache-ant-1.7.1"Luckily a friend in class helped me get to this point. Otherwise I would have been at a loss at what to do. I also needed to change the path to ANT 1.7.1. After I finally managed to finish this all, I ran some tests to see if I had installed everything correctly and it worked just right.
export CHECKSTYLE_HOME="/Users/tylerwolff/Documents/ICS/Tools/checkstyle-5.0-be$
export FINDBUGS_HOME="/Users/tylerwolff/Documents/ICS/Tools/findbugs-1.3.5"
export JUNIT_HOME="/Users/tylerwolff/Documents/ICS/Tools/junit4.5"
export PMD_HOME="/Users/tylerwolff/Documents/ICS/Tools/pmd-4.2.3"
Thoughts on Automated vs. Manual Quality Assurance
When programming it is always hard to get the code looking and working right the first time around. More often than not, we miss the littlest, most minute details in our program code and it fails because of it. Those are the times when it is ultimately useful to get an objective, outside view of your code.
- Checkstyle : 24 errors in MyRuler.java (67 errors total including IBM classes)
- 20 errors due to lines over 100 characters long
- 3 Javadoc errors
- 1 error due to using a import wildcard statement '*'
- PMD: 10 errors in MyRuler.java (36 errors total including IBM classes)
- All priority 3 errors with code suggestions
- FindBugs: 0 errors in MyRuler.java
Sunday, September 14, 2008
Code Ruler Peer Review [Flestado]
When I first opened the MyRuler.java file from Mari-Lee Flestado I did a quick scan over all the code to get an overall impression of it. At first glance I found the code to be clear and organized. I saw lots of clear, logical statements and many single line comments. It took slightly longer to realize the strategy the code implemented but overall I had a really easy time understanding the specifics of the program. Her ruler worked very well for what it was when I tested it out. It implemented exactly what her strategy specifics outlined. When I first started coding out my codeRuler I thought of some of the same strategies she used like creating more knights and peasants when the opposer has more.
CODE/FORMATTING VIOLATIONS FOUND
File | Lines | Violation | Comments |
MyRuler.java | 44, 53, 57, * | EJS-7 | no whitespace included in line between () and { |
MyRuler.java | 38, 79, 87, * | EJS-7 | no blank line between logical sections of code |
MyRuler.java | 1,2,3, * | EJS-8 | Tabs used, not converted to whitespace |
MyRuler.java | 109 | EJS-9 | 'np' is not a meaningful name |
MyRuler.java | 38, 43, 52, * | EJS-37 | comments repeat code, does not add useful information |
MyRuler.java | 105, 110, 120, * | EJS-76 | Expression statements used instead of block statements |
MyRuler.java | 20, 98 | ICS-SE-Java-6 | Does not start with a capital and end with period. Should be a more complete sentence. |
Monday, September 8, 2008
Lessons learned from Code Ruler
What we eventually created did in fact do all these things and more. However, we basically threw out all of the start up code from the IBM site and put in our own codes. We programmed out very efficient peasants who are constantly claiming new lands. We programmed intelligent castles to create what's needed most. Probably the most efficient thing we programmed was the knights. What the knights do is basically gang up on the nearest enemy, be it another enemy knight or castle. Normally it can take them all out. Then it goes for the left over peasants. More details can be found in the code javadoc. The source code and javadocs for our implementation can be found here [tylerwolff-daniel.f.tian.zip].
Opponent Name | Opponent Score | twolff-daniel.f.tian score | Winner |
Split Up Ruler | 70 | 788 | twolff-daniel.f.tian |
split Up Ruler | 86 | 797 | twolff-daniel.f.tian |
Split Up Ruler | 58 | 801 | twolff-daniel.f.tian |
Migrate Ruler | 0 | 864 | twolff-daniel.f.tian |
Migrate Ruler | 0 | 814 | twolff-daniel.f.tian |
Migrate Ruler | 0 | 639 | twolff-daniel.f.tian |
Gang Up Ruler | 84 | 712 | twolff-daniel.f.tian |
Gang Up Ruler | 133 | 739 | twolff-daniel.f.tian |
Gang Up Ruler | 60 | 809 | twolff-daniel.f.tian |
About Me
- Tyler Wolff
- Honolulu, Hawaii, United States
- UH ICS student Visit my Web Portfolio Site at www.tylerwolff.com
Labels
- Ant
- blueMarine
- bugs
- Checkstyle
- code coverage
- codeRuler
- Configuration Management
- Continuous Integration
- development
- Due Dates
- Eclipse
- Elements of Java Style
- Emma
- FindBugs
- FizzBuzz
- Formatting
- game
- gold
- google code
- google project hosting
- group
- hackystat
- httpUnit
- hudson
- IBM
- ICS Industry Day
- Jetty
- JUnit
- Management
- Open Source Software
- PMD
- prime directives
- Quality Assurance
- smartSVN
- software ICU
- Software Review
- Stack
- Strategy
- subversion
- test-driven development
- ulaula
- Web Application
- white box testing
- Wicket