Sunday, September 30, 2007

12.WebSpiderReview

  • Reviewer: Chiao-Fen Zielinski-Liu
  • Author: Marcius, Bagwan
  • Installation Review:
    • When I tried to download the webspider zip file from Marcius's blog, I found the webspider jar file. Even though I could download the jar file successfully, I did not have all the information I needed to complete this assignment. This was the initial problem that I encountered. Therefore, I informed the author to send me the webspider zip file. On Saturday morning, he sent me the “webspider-marcius-1.0.928” zip file.
    • After I received the “webspider-marcius-1.0.928” zip file “, I was able to download it successfully. It was not difficult for me to figure out how to run the code because it took me only a few minutes to complete the installation review.
    • Here are details about JUnit, Checkstyle, PMD, FindBugs, Emma and Verify.


Tasks Available
Results
JUnit
No
No test cases
Checkstyle
yes
No errors, No warnings
PMD
yes
No errors, No warnings
FindBugs
yes
2 high priority warnings
Emma
No
Failed
Verify
No
Failed

    • I could invoke "ant jar" to build a webspider.jar file.
    • I could not invoke "java -jar webspider-marcius.jar -totallinks http://www.hackystat.org 100" because the author did not rename the webspider.jar to the webspider-marcius.jar. However, I was able to invoke "java -jar webspider.jar -totallinks http://www.hackystat.org 100", but it did not return the expected results. Instead, it generated some messages (see break da buggsh).
  • Code Format and Conventions Review:
    • After checking the code format and conventions, I have only found two violations.

File
Line(s)
Violation
Comments
WebSpiderExample.java
110
EJS-35
No documentation comments for the getLinkStats() interface
WebSpiderExample.java121
EJS-24
The method isEmpty() is undefined for the type String

  • Test case review: since the TestWebSpiderExample.java is missing, I would suggest the author to write test cases for a black box perspective, a white box perspective and a break da buggah.
    • Black box perspective: it is a testing where testers try to invoke the program with inputs to which they know the corresponded outputs without knowing the flow of execution. Whether the input is a value or a sequence, the testers should test the code with a max, a min, an illegal, an empty, and a typical value or sequence.
    • White box perspective: in this testing process, the testers know how the system is implemented including data flow, control flow, information flow, coding practices, and exception and error handling.
    • Break da buggah: no matter how I tested his code, it always generated the five lines of message as presented below. Then, it stopped without returning the number of total links or the most popular website.
      • The intial url is:
      • The maximum links to follow is :
      • Next Link to crawl (getNumLinks) :
      • Next Link to crawl (getNumLinks) :
      • Proper URL not specified.
  • Summary and Lessons Learned:
    • The author has a very good knowledge about the Java code format and conventions. I think this is what I need to improve.
    • Since the author did not write any test cases, I was so frustrated because I could not perform the black box perspective, the white box perspective and the break da buggah, fully.
    • I have gained more understanding about the difference between black box testing and white box testing.
    • Now I understand how hard it is for professors to grade assignments that are incomplete.

Wednesday, September 26, 2007

Extra Credit !!!

First, I tried to run "http://www.myspace.com/shakadownstreet" with my code. After I hit the enter key, the screen was filled of some codes that I do not understand and some details why it failed to run myspace. After a closer look, I found out it complained about Javascript. Therefore, I asked my team member if he had the same problem when he ran myspace with his code on Monday. Then, I found out he had the same situation and he also gave me a hint about httpunitoptions. My next question was how to disable the Javascript. Then, I took a look on httpunitoptions. One that with "setScriptingEnabled(boolean scriptingEnabled)" is able to set Javascript false. After trying in my code, no more Javascript exception is listed. This is my suggestion for the extra credit.

11.WebSpider - Revised Version

  • What I did:
    • The pmd test was not successfully built on Monday, because it complained about "ArrayList" interface. Therefore, I used the extra time to check this issue in the text book "JAVA". It suggests to use "List" instead of "ArrayList". Then, pmd now is built successfully.
    • The task 3 is completed. I decided to use "System.out.println" for logging, because the print lines were already in my code. However, I have tried to look up logging online and in the textbook. I believe I will need more time to figure it out.

Monday, September 24, 2007

11.WebSpider

  • My thoughts:
    • I think this assignment is very challenging. If I would start this assignment earlier, I believe I could accomplish all the tasks. However, I have accomplished the task 0, 1, 2 and a little bit of 3. Why do I say:”a little of 3”? Because I always insert “System.out.println” to understand what my program is doing when I program. I like the idea of extra credits. Hopefully, there will be another one soon.
  • What I learned:
    • I am pretty sure that I have gained more experience in "Ant". Ant is very useful when codes have some errors, because Ant is able to generate reports. Then, programmers can have some ideas what goes wrong and where the errors are.

    • JUnit tests in Eclipse, I like to run JUnit tests in Eclipse because I am able to see the testing process. Since Eclipse is a colorful Java application, I can easily recognize whether my tests fail or not. However, there were several times that I received “BUILD SUCCESSFUL” on console but not in Eclipse when running the same codes. Hence, I will suggest running JUnit in both Eclipse and console.
    • I was not able to accomplish the task 3 fully, because I did not have enough time since I started this assignment a little bit late, and I spent a lot of time on the task 1. When I got into the task 1, I could not figure out what went wrong since I was sure that my algorithm was not bad. After I inserted “System.out.println” in the code, I found some links were unable to connect. I realized that I should add try-catch to prevent this kind of errors. Furthermore, some infinite loops took me hours to solve. I hope that I will be able to accomplish all tasks on the next assignments.

    • I am pleased that I was able to write all the test cases. Among JUnit, Checkstyle, PMD, FindBugs, and JavaDoc, PMD still has two warnings. Hence, I am able to run verify successfully. In addition, the emma coverage is 100%, 100%, 92%, and 92%.

Sunday, September 16, 2007

10.Stack

  • Which of the five tasks were you able to complete successfully? If you were unable to complete them all, why not?
    • Luckily, I was able to complete the five tasks successfully. However, "Task 4: Add support for the JavaNCSS static analysis tool to your project" took me hours to complete, because I had a hard time to create the javancss.build.xml even though I was looking at the other *.build.xml. The other tasks were pretty straightforward, because I was able to find solutions from the reports, eclipse, and Google.
  • What problems did you run into, and how did you resolve them?
    • Most of time I resolved the problems by looking for the solutions from the Ant, Checkstyle, JUnit, PMD, FindBugs, SCLC, and Emma home page , checking the error reports or searching online. The problems that I remember the most are:
      • When I invoked the "ant -f sclc.build.xml", it failed and generated an error message about Perl. Then, I found out I had to download and install Perl from the SCLC home page.
      • I did encounter some warnings when I invoked the "ant -f verify.build.xml". Since the Ant would list where the errors were, I was able to invoke the Ant command with the specified warnings to generate the error report. Hence, I could easily know where to check and fix the problems.
      • When I created the javancss.build.xml file, I ran into several problems. First, I opened the other *.build.xml files and read them. Second, I started to generate the javancss.build.xml file by coping and renaming what was in the pmd.build.xml file. I still encountered some problems when I tried to test the command "ant -f javancss.build.xml. Then, I discussed with my team member. I found that we both had the same problem, so we decided to read what was available at JavaNCSS Ant Task and also searched online. Finally, we resolved the problems.
  • What is your impression of Ant?
    • First, it reminds me of the "Make" experience that I have learned in ICS212.
    • My impression of Ant is to save time on compiling. We have to create a file with all the involved property names and import files in it. Then, we only have to invoke one line of code to run through what is needed to be compiled. Ant will tell us what goes wrong, then we will be able to fix the errors in an efficient time.
  • Are there standards that we are using that you do not understand the motivation for?
    • After completing all the tasks, I have gained more understanding with Ant, JUnit, PMD, FindBugs, Checkstyle, SCLC, and Emma. I also realized why I need these tools. These tools provide programmers with a clear error report, then programmers can easily follow and fix the error.
  • What is the difference between SCLC and JavaNCSS, and which counting tool do u prefer?
    • After I ran both "ant -f javancss.build.xml" and "ant -f sclc.build.xml", I found out that the javancss generated a "JavaNCSS Analysis" html page and the sclc only showed the report on the console. While JavaNCSS is focusing more on packages, objects, functions, and Javadoc, sclc focuses on lines, blank lines, comments, NCSL, and TPtoks. It seems to me that the format of the JavaNCSS analysis report is more user friendly. Since JavaNCSS focuses more on packages, objects, functions, and Javadoc, therefore I believe these are what I need to know as a programmer. I will prefer JavaNCSS to be my counting tool.

Wednesday, September 5, 2007

08.CodeRulerRedux

  • Team Members: Michal Zielinski & Chiao-Fen Zielinski-Liu
  • Strategy:
    • While our knights are sent to capture the other castles, our peasants are divided into four groups to claim land from four different squares. Once our knights have captured all other castles, they will capture the other peasants. Once the other peasants have been captured, our knights will capture the other knights. As soon as our knights have captured all castles, all peasants, and all knights, more peasants will be produce to claim the rest of land which has not been claimed.
  • Results:

Result 1Result 2Result 3
michalz-chiaofen vs. migrate ruler
854 - 0
782 - 184
725 -256
michalz-chiaofen vs. gang up ruler
827 - 1
784 - 140
733 - 230
michalz-chiaofen vs. split up ruler
833 - 0
553 - 399
748 - 182
  • Lessons Learned:
    1. After I reviewed Jared's code, I decided to show his code to my team member, Michal. Jared's code inspired us to send our peasants to claim land more efficiently. Hence, Michal and I coded our peasants into four groups, and then send them to four different points to claim land. This strategy can prevent our peasants to be captured quickly from the gang up and migrate rulers.
    2. This time Michal and I spent more time on our code, because we would like to win each battle. Therefore, our code has less redundant code than the version 1.0 and our code is more sophisticated. Our results are much better than previous results.
    3. "The Elements of Java Style" gives me ideas about Java documentation and coding standards. When I tried to apply those standards in the code, most of time I could find the topic related to what I needed. However, if more examples were included, this book would be more hopeful.