Sunday, December 9, 2007

33.PrimeDirectivesRedux

1. Interactive Development Environments (Eclipse, VisualStudio, etc.)
An IDE for developer to read code clearly and provide syntax error notification, auto connect wrong syntax. Reduce code mistake of developer made . For Eclipse is integrate junit test that provide test result for developer, so IDE would be Prime Directive 3.

2. Coding Standards and Coding Standards Compliance Tools (Checkstyle, etc.)
Each developer has their coding standards, but some of them may using a same language, so how can we make code organize and follow the same rules when coding. checkstyle provide test for checking it have a same documentation style. Since, checkstyle has standardize the code that would be Prime Directive 3.

3. Build Systems (Ant, Make, etc.)
Build system provide one step testing for developer that to build entire project include code testing and code compile. Also it is a great tools when developer developing a big project, it could be gather all source file and compile at one time. Seem build system is only for developer, so it would be Prime Directive 3.

4. Automated Quality Assurance Tools (PMD and FindBugs, etc.)
Automated Quality Assurance Tools will find some code invalidation which the developer didn't realize or aware on it. This tool make the code standardize, for small project this tool is passive, because who care about Automated Quality of "Hello world" program, but it is helpful of build a large project, same with above tools it related to coding that's mean related to develop, so this is Prime Directive 3.

5. Black and White Box Testing
Black box testing seem to be relate to developer and user, because sometime developer cannot find bugs after release the system, but user can do it. Also, black box testing has not relate to coding or viewing code, so black box testing is Prime Directive 2 and 3.
White box testing is only for developer who read the code to evaluate what good or bad in code. so it may be Prime Directive 3.

6. Automated Testing Tools (JUnit, HttpUnit, etc.)
Automated Testing is developer write some code to test the system status, it is work or not. which situation may crash the system which may not etc. Running this tool may test the system coverage status, then provide result to developer how to improve their code. so it is Prime Directive 3.

7. Configuration Management (CVS, SVN, etc.)
For the big project, we require many developer to build the system build how can they marge their codes when they are works alone, so Configuration Management tool can provide a feature about keep track every single time who change the code.
so this one is Prime Directive 3.

8. Issue Driven Project Management
When every developer work on their own part that they have to commit their work so how can they organize their work, so that Issue Driven Project Management can help them to solve this kind of problem, it is a documentation of which part they working on. It only develop can access to make issue statement so it is Prime Directive 3.

9. Use Cases
Use Case is a fundamental design for user guide, it is a documentation of how to fulfill the user requirement when the system released. It related to general system design, so it is Prime Directive 1.

10. Software Review
Software Review can be other developer who working on the same project but they work on different way or other developer who familiar with this area or user who want to give some feedback about system operation, then they may do software review. So it is Prime Directive 2 and 3.

11. Agile Methods (XP, Scrum, etc.)
Agile Methods is two or more developer coding on one computer that is the way to communicate with each other, also talk about how to make the system work better. It is Prime Directive 3

12. Open Source Licenses (GPL, CPL, etc.)
Open Source Licenses is free charge product and we can download it from web and get fully support. Since everyone can download the distribution online, so it is Prime Directive 2.

13. Online Hosting Services (Google Project Hosting, SourceForge, etc.)
Online Hosting Services provide a free storage and workspace to developer to build their own project or company project that share out to world for someone who interested with to download the distribution. Since most of then using this Online Hosting Services is developer, so it is Prime Directive 3.

Myisern 2.0 Review

Reviewed Team: myisern-pink
Source Code: Here


Tool installation : (for me only)

-Apache Derby database.

-Environment variable "DERBY_HOME"

Testing :

verify.build.xml -- fail
Stop at junit test, since it got an error on testLoginActionBean and testLogoutActionBean.
Please see the error below:

junit.build.xml -- fail








checkstyle.build.xml -- Okey
findbugs.build.xml -- Okey
pmd.build.xml -- Okey
emma.build.xml -- sametime is work, sometime it doesn't
[concat] Emma Coverage summary
[concat] class: 67% (10/15)
[concat] method: 30% (76/256)
[concat] block: 32% (3843/11954)
[concat] line: 32% (860.4/2730)
The only problem is when I run junit firsta and run emma right after that the heap space must running out, then I need to restart Tomcat again to run emma. I try many time and many time it happen. The emma test I did successful is running checkstyle, findbugs, pmd for each single time then I run emma after that is successful, but not run junit in front of emma.
I think there are some improvement for on make junit test first, then worry about emma coverage after that, since your coverage is too lower, so I think you need write some test case for improve that.
Black Box Perspective:
For basic operation, add, edit and delete has success operated.
There are few thing I suggest to add on your project:
-I suggest that add some back button or redirect link to previous page when you finish each operation.
-Add some description on first or main page.
-Add picture on researcher page.
-Add confirmation message on delete operation.
-Make edit operation as separate page.
White Box Perspective:
The code look organize, and create different action files.
What I suggest is make some derby test case, and collaboration, organization and researcher action bean test case too.
I think if you make some improvement on this area that it can be bring up emma coverage, by that time, make sure no error on test case, otherwise it won't pass junit test and httpunit test.
Break da buggah:
when I logout system, then I use back button on browser that still can access any item on the page. I think you need to work a little bit more on session register. To block access without logon to system.
Summary and Lessons Learned:
implement Java derby is totally different to implement PHP + MySQL. For my own, MySQL is better than derby, since it use common SQL statement for insert, update and delete. But I learn a lot in this project is not about this, is how to use framework to test PHP project, the stuff we learn for entire semester is really apply to other language and make more easy to test where we doing wrong. It is helpful for implement framework to other different language like ASP.NET, PHP, Ruby etc.

Thursday, November 15, 2007

29.MyIsern-1.3-review

Reviewed Team: myisern-1-green
Source Code: Here

Installation Review:
-There are no problem to run "ant -f verify.build.xml".
-WAR file can be generate.
-Be able to import project to eclipse.
-No error appear on eclipse.

Tool Execution:
Junit - OKey! Successful run all the test.
-Enable to see a status, when it run.

Checkstyle - OKey!

Emma - Okey!
emma.echo: [xslt] Processing C:\svn-google\myisern-1-green\build\emma\coverage.xml toC:\svn-google\myisern-1-green\build\emma\coverage.brief.txt
[xslt] Loading stylesheet C:\svn-google\myisern-1-green\lib\emma\hackystat.emma.xsl
[concat] Emma Coverage summary
[concat] class: 68% (17/25)
[concat] method: 57% (123/217)
[concat] block: 81% (5713/7044)
[concat] line: 80% (1315.7/1645)

Verify - Okey! Successful run all the test.
BUILD SUCCESSFUL

Code Format and Conventions Review:
File Line# violation Comment
No Violation Found!

The emma coverage is look not enough, I think you need to write a little bit more code on test case that bring up the emma coverage.

Black Box Perspective:
For LOGIN Page:
Enter username and password to test is it point to right page, or insert either one wrong input to test the page will display right error message.

For ADD Page:
Is the data will extract to right xml file and return message to user.
Do the page show all the field for each attributes.
Is the page had error handing.

For EDIT Page:
Is the show all the data of that attributes?
Is the page will point to right page when user click on submit button.
Is the page had error handing?

White Box Perspective:
White box testing include two parts, one is testing the system file which is myisern. Emma coverage will show the result of which parts the system do not cover. the other part is testing over the web, this test is only testing the web connection between the system and web server, also you need to write some code to cover all the web action.
For this case, your emma coverage no bad, but still need some to cover each requirement.

Break da buggah:
In this case, the first page is not a login page.
If I enter nothing in ADD page it will point it to web server error page, which is not successful to add data, and edit page too.

User Interface review:
Your system successful run on tomcat web server, and can be display each page.
Your had pretty nice user interface, clearly display the information on each page.

Summary and Lessons Learned:
What I learn on this assignment is transfer everythings into web interface, and it is very challenge on create user interface by using JSP which is totally new language, and I need to learn how to they implement to current system.

Monday, November 5, 2007

26.StackStripesExtension

Here is my code StackStripes.


From task 1 to 3 is very easy to do, just setup the Tomcat Web Server and run it. But the difficult parts increase Emma coverage to 100% that I spend about 2 to 3 hours to bring up the coverage. Also, I spend 1 to 2 hours on making Double it button work.
For the Emma testing, I think many people have a same problem that Emma test cannot be build successful, same time its work and same time it didn't work, so I figure out by reading some post on the discussion post, and know we have to make sure JUnit run successfully then Emma should be work. Otherwise, it come out an error about coverage.ec file not exist.
After fixed this problem, I bring the Emma coverage, and make it as 100%. Now, for my final application that my Emma coverage is 100%.
This is a good exercise to practice how to use JSP and Servlets. How are they work?

25.WebAppQuestions

1.Explain in your own words the meaning of the web "request-response cycle".
As I known, request is like a message that sent from client web browser, and response is the server who received the message and feedback to client. So “request-response cycle” is a term of client-server.

2.Explain how servlets facilitate processing of the request-response cycle.
Servlets is API software that listen a request and base on request to create a response.

3.How do you login to the Tomcat Manager?
First, make sure tomcat is running, then create an account name and password by modify “tomcat-user.xml” file. Then, go to browse and type “localhost:8080”, go to Tomcat Manager by using the username and password that created before.

4.What is the Tomcat Manager used for in the StackStripes application?
Since, we need to run an application on tomcat web server, so we need to get authorize on web server to make the application run, so we need tomcat manager to communicate between application and web server.

5.What is the directory and file layout of an installed web application like StackStripes? (This is NOT the same as the directory and file layout of the StackStripes distribution!)
In StackStripes directory it include a folder call “web”, under that folder is web page for JSP, also it had a folder call WEB-INF, it include a stripe library that the system need these when compile with stripes.

6.How do you build a war directory structure in Ant? Where is this accomplished in the StackStripes application?
To build a war directory structure in Ant we need tomcat manager to compile the whole java file and they make a war file (this file same with jar file). Tomcat will use this file to execute the application.
In StackStripes application we run tomcat.build.xml that will do the above process to make a war file and deploy on tomcat web server, then show the application on web browser.

7.How do you install a war directory in a running Tomcat server? What information does the Ant task need to accomplish this?
When Tomcat server running we can use Tomcat Manager to install a war directory. In Ant, we need to run tomcat.build.xml to build war directory.

8.What is the "Model2" architecture? What are its advantages?
Model 2 is combine servlets and JSP together, it’s make the application server more dynamic. The advantages of model 2 is separate process request and respond action, servlets will control all process and send to JSP to respond client side.

9.What are JSP pages? How are they related to servlets?
JSP is Java Server Page is able to receive client request and respond to client, which is able to interact between server and client. JSP is compiled into java servlets by JSP compiler.

10.Why is there a delay when retrieving a JSP page for the first time? Where is the Java code for that page stored?
When JSP received a request then servlets will compile the application, we know compile java application that the system will send a lot of compiled data back to client side, so it may take a long time for first time. The java code will store it at the browser cache.

11.What are JSTL tags? Why are they useful? What is an example JSTL tag from the StackStripes system?
JSTL tags is able to call the library from JSP. JSTL can do some code programming code on HTML code i.e. call FOR loop in HTML. The example on StackStripes is .

12.What are Stripes tags? Why are they useful? What is an example Stripes tag from the StackStripes system?
Stripes tags are the tags to let JSP recognize which parts need to compile by JSP. If don’t have Stripes tags that JSP won’t be know which components of HTML will send the request to JSP, and JSP won’t be able to compile. For example, all PHP code is within a beckets <$PHP$> outside of this beckets is normal HTML code. There is an example on StackStripes application.

13.What is HttpUnit? How is it different from JUnit? Why is it useful? What is an example use of HttpUnit from the StackStripes system?
HttpUnit is test java application through the internet protocol and create a test result. JUnit is only test java application in local system and HttpUnit that able to test request and respond from java application server. If without HttpUnit that it won’t be able to test web feature, which is web form button, server connection and web application. Here is an example of HttpUnit on StackStripes WebResponse response = conversation.getResponse(Url);


14.What needed to be changed in order to implement the Double It button? What didn't need to be changed? What did you learn about the MVC design pattern from this exercise?
To implement Double it button that need to change the form ID name and value that display string on Double it button. It didn’t need to change is the HTML tag for create button. Http form is user interface for people easy to interact with the application. If no MVC that user may not be interact with application.

15.What are the equivalence classes that need to be tested for the Double It button?
The goal for Double it button is duplicate default value into stack, so to test Double it button that must be push one value into stack, if the double it button is work, it may have two equal value in the stack.

16.Provide two screen images of your new StackStripes application with the Double It button, one showing the page before and one showing the page after hitting the "Double It" button.
Before hitting the “Double it” button that it will show double it button on the page, then after hitting Double it button it will direct to java stack application and duplicate value into stack and send it back to original page, and then iterator to display what value into stack.




17.What is the singleton design pattern? What is an example of its use in StackStripes? Why is it needed?
Singleton design pattern is makes many process into one instance or object. An example of its use in StackStripes is
public static synchronized StackModel getInstance() {
return StackModel.theInstance;
}
It operates more efficiently when only one or a few objects exist.

18.Some of the StackStripes tests exercise code on the "server side", while others exercise code on the "client" side. Which test classes exercise code on the "server", and which exercise code on the "client"? How does Emma deal with this to create appropriate coverage data?
The TestStackActionBean code is on the server side and the StackActionBean code is on client side, because the TestStackActionBean code is use HttpUnit to go through internet protocol to test the code, and use JUnit to test StackActionBean in local system. Emma only deal with which method in these code are execute or not to create appropriate coverage data, so if one of exercise code doesn’t execute, the emma coverage will not be 100%.

19.Running 'ant -f junit.build.xml' results in the following target invocations: tomcat.check, tomcat.undeploy, compile, war, tomcat.deploy, junit.tool, junit.report, junit. Explain what each of these targets do.
Tomcat.check – To check the connection of Tomcat web server, make sure Tomcat is running or not.
tomcat.undeploy – Undeploy application on Tomcat Web Server
compile – Compile application on Tomcat Web Server
war – Servlets base on java files and deploy it as an archive file for web call war.
tomcat.deploy - Deploys application on Tomcat Web Server.
junit.tool – Testing application by using test case.
junit.report – Generate test report return what error occur in code.
junit – To run the test case and test the application.

20.(Optional) If you have experience using one or more other web application frameworks, discuss your initial reactions to Stripes. How is it similar, or different, or better, or worse than your previous experience?



Monday, October 22, 2007

21.MyISERN-1.2

Team: MyISERN-1-Gold
Wiki: http://code.google.com/p/myisern-1-gold/w/list
Source: HERE

Task 1:
First, we re-organize our MyISERN 1.1 file and divide all method into different files. This is what we do on first meeting. Why are we divide all method into different files, because we reallize that there are a lot of thing will increment on MyISERN 1.2, so we cannot put everything into one single class, if we do that, it may mess up our code later on. So, now is easy to modify our code, becasue each class hold it's function, for example, print class would print all data from XML file.

Second, we talk about what kind of thing would be increment on MyISERN 1.2 . We planning to put all add function to one class, and start implement code on function "add researcher" because once we finish "add researcher" after that may very easy, since it is a same idea for organization and collaboration. Next step is create a menu for let user choose. We have no problem up to this point. But the big challenge is coming, that is data entry.

Task 2:
This part of assignment it seem to be very easy to do, but it is not. One reason is too much data we need to entry. Second reason is we need to enter those data step by step. So we use another way to input data to XML file. We edit the XML manually, not go through the system. Then the problem is come out, because the XML format must be match the format that the system required, if not. It won't be pass the verify and cannot read the xml file. So this is the problem of those we got. We spend almost 4 to 5 hour to redo all the xml file into right format that can be read by the system, otherwise the researcher, organization, collaboration table won't be print out properly.

Task 3:
This task is the almost easy part of this assignment. And everybody could see our progress throught this powerpoint slide show.

What do I learn:
I learn some more java skill on exporting text to XML file, and I thought it may be useful for future. Also, the term work is very important, we rely on each other, share knowlegde to each others.

19.UseCaseSpecification

To view our use case: http://code.google.com/p/myisern-1-gold/w/list

What do I learned:
I feel write a use case is very difficult, because I need to go through each detail on the project and divide it to different part, then think about what would happen working on this project. Finally write a scenario for each session. Describe what should we do or what feature may appear on the system.

I create our use case by using template from web, so the template provide a table that list all important things on most use case would appear. I just based on the note that I took on class and come up this user case. Of course, I am not the one that come up the whole use case. Me and my groupmate do it together.

Use case is important that it is a demo of how to use or understand what is the system doing, what value I input and what is the system would respond. Just like a procedure, it guide the user to use the system step by step. let user to understand how to use the system as well.

Tuesday, October 16, 2007

22.MyISERN-1.1.Review

Reviewed Author: Michal Zielinski
Source Code: Here

Installation Review:
-There are no problem to run "ANT".
-JAR file can be generate.
-Be able to import project to eclipse.
-No error appear on eclipse.

Tool Execution:
Junit - OKey! Successful run all the test.
-Enable to see a print out table of information from XML file, when it run.

Checkstyle - OKey!
checkstyle.tool:
-Created dir: C:\svn-google\myisern\build\checkstyle
-Running Checkstyle 4.3 on 10 files

PMD - Okey!
pmd.tool:
-Created dir: C:\svn-google\myisern\build\pmd
-No problems found!

FindBugs - Okey!
findbugs.tool:
-Created dir: C:\svn-google\myisern\build\findbugs-Running FindBugs...
-Output saved to C:\svn-google\myisern\build\findbugs/findbugs.xml

Emma - Okey!
Emma Coverage summary
class: 100% (9/9)
method: 100% (41/41)
block: 92% (2798/3039)
line: 91% (459/507)
It seem pretty good for emme coverage, it cover all class and method but some line of code didn't cover, it still okey. If you want to improve your coverage that you need to worry about some code such as try & catch, loop and some import function. It may cause your coverage not reach to 100%.

Verify - Okey! Successful run all the test.
BUILD SUCCESSFUL

Code Format and Conventions Review:
FileLine# violationComment
No Violation Found!


So far has no error appear up to this point, next going to test is command line argument.

Black Box Perspective:
It is not doing well this part, since user does not know what format of argument they should put in, so it is the best way to print out what command line with no argument input to system, then user will understand how to access the system. So, I am a user in this case and I going to use your system, but I suppose know nothing about this system, so I have no idea how to access this system to get information that what I want. Therefore, I cannot do test on this part.

White Box Perspective:
Since, I can read your code and understand what are you doing on your code, then I run the system and put arguments on it to test it work.
On the other hand, your emme report you have
class: 100% (9/9)
method: 100% (41/41)
block: 92% (2798/3039)
line: 91% (459/507)
that mean some of block is not covered, the major result is on validation of argument that you need to use alot of error check things, but these error check will make some code cannot be cover, because error check including a lot of if statement, so these statement will block some conidition never exist will cause so code never be execute, then coverage will never be 100%.

Break da buggah:
In this case, it cannot break the system, if you have well error checking, but I found some condition that will break the system. when I input command "-listOrganizations -collaborationLevelEquals " that I put MAX_VALUE on argument will cause the system break.

Summary and Lessons Learned:
I read through your code and I really like you applet table, you make a table as applet and pop up by execute the system. It is a little off track to use applet print out table, but it is good to reference for me that how to write applet in java.

Sunday, October 14, 2007

18. MyISERN-1.1

Group: myisern-1-gold

The source code can be downloaded from here.
--------------------------------------------------------------

Objective:
Three task on this assignment:
1. Build command line that user can access the database.
2. Make unique ID and error check on loading database.
3. Make test case to bring up emma coverage.

Progress:
On first meeting, we come up three major task that same with above. Before each of us work on different area, after finish our part then combine it together at the end, but we found that don't work very well, so this time we change everyone work on same task, then choose the better one. This method can fill up our weakness, three brain thinking is better then one brain.


On second meeting, we got stuck on task 2, we have no idea how to check duplicate unique ID that many question pop up in our mind, how to we keep check the checked unique ID? Where to store checked unique ID? Store it into array? Then, we post question on disuession, hope someone can help. We put away the error checking thigs and start work on command line argument. This is a easy part on this assignment, but we got stuck again, we cannot test command line without unique ID arguments, so we have to get back to work on unique ID & error checking stuff. Finally, we make it by read the disuession post. After that "life is easy", we finish up all the thing on time. but a little bit thing not good is emme coverage are not all 100%.

For my own view, overall of this assignment are good and I am happy to work with our partner, everytime we change some new that we will announce each other, then commit to server. So far I enjoy working in this group.

What do I learn?
I learn planning our work before we get start, otherwise we may not success on this assignment. Since, everythings could happen, so if we not do well planning before start that the worse is we need to start it over again when getting problem.

Tuesday, October 9, 2007

16. MyIsernReview

Reviewed Author: Edward Kim
Source Code: Here

Installation Review:
First, I run the project in command line and it compile in "ANT" with no error. It passed all test and also build a jar file for execute application.
Second, I import the project to eclipse and run project into eclipse, it print out valid data in table.

Tool Execution:
---------------
Junit - OKey! Successful run all the test.
-Enable to see a print out table of information from XML file, when it run.

---------------
Checkstyle - OKey!
checkstyle.tool:
-Created dir: D:\ICS413\Myisern1.0\myisern-xml-1.0.1007\build\checkstyle
-Running Checkstyle 4.3 on 2 files

---------------
PMD - Okey!
pmd.tool:
-Created dir: D:\ICS413\Myisern1.0\myisern-xml-1.0.1007\build\pmd
-No problems found!

---------------
FindBugs - Okey!
findbugs.tool:
-Created dir: D:\ICS413\Myisern1.0\myisern-xml-1.0.1007\build\findbugs
-Running FindBugs...
-Output saved to D:\ICS413\Myisern1.0\myisern-xml-1.0.1007\build\findbugs/findbugs.xml

---------------
Emma - Okey!
Emma Coverage summary
class: 100% (1/1)
method: 90% (9/10)
block: 98% (497/508)
line: 96% (104/108)
You have some code didn't cover in "printTable" method, and you call "printTable" method in main, then it only have 90% coverage in method.

---------------
Verify - Okey! Successful run all the test.
BUILD SUCCESSFUL

After done verify project that I invoke the command line use "ant jar" to generate the jar file, then I run "java -jar myisern-1-green.jar" that it print a table from xml file. Up to this point, everything is okey which it pass verify all test and the application can be run as command line.

Code Format and Conventions Review:
FileLine# violationComment
MyIsernXmlLoader.java 149,166,*EJS-9Use meaningful names
MyIsernXmlLoader.java 124,180,*EJS-7Only put white space to delineate method, but it is notthe methods


Black Box Perspective:
In this case, the black box perspective is simple, because we only expect the application print out a table contain valid information, so there are no argument input to command line. We only type "java -jar myisern-1-green.jar" to run an application and print out table. I tested it and return reasonable outcome that the black box test is pass.

White Box Perspective:
I read through your code and found out something that I thing it could be improve your EMMA coverage in order to 100%. Since, your coverage is nearly 100%:
class: 100% (1/1)
method: 90% (9/10)
block: 98% (497/508)
line: 96% (104/108)
but it didn't mean your code is bad. It could be improve a little bit more, I read your code and see you put everything on one method and invoke it in main, so it is not testing detail inside the method, I suggest you to seperate your print method by each types of xml file, then I can invoke each types print method on test case then it can see which is not coverage.

Break da buggah:
For black box perspective, there are no chance to break the system, no matter you input any argument, it still return valid result.
For white box perspective, it must happen to break the system by insert another location of xml file, and you didn't do any error checking to due with this situation, then it will break the system.

Summary and Lessons Learned:
I learned to see the emme result coverage is not exactly need to be 100%, in other word, emme coverage result return 100% is not mean pass the test fully, all code can coverage, but it only invoke main to test case. It is not tested in detail, so that emme have 100% coverage is mean not "really" good on testing.

Sunday, October 7, 2007

15. MyISERN-1.0

Group: myisern-1-gold

The source code can be downloaded from here.
--------------------------------------------------------------

Objective:
Manipulate XML in Java, understand how JAXB work and manipulate XML in Java. Practice Scrum methodology.

Progress:
JAXB is powerful, it done 90% of those code, and we only need to do is finish up the rest of 10% code.
First, our group meet together read and understand what is the code do. Once we figure out the given code implementation, then everythings is easy start to this point.

Second, start implement code to get data from XML file by using JAXB generated code, we spend a little bit time to implement code, since we understand the given code before, so that's make more easy.

Third, we can print out all data from XML file, then we start testing our code by using junit, pmd, checkstyle, findbugs and emma to see it can pass these tests. we try to insert and take out some code to make emma test be 100% coverage. There some problem generate, we need to generate JAR file when compile the project, since this is a command line application, we must generate JAR file to make application run as command line.

Fourth, we finalize our project, and solve the problem of generate JAR file by change some code on build.xml file.

What do I learn in this assignment?
In this assignment I learn group work, participation and practice Scrum method. This is a good chance for me to learn how to work with other people, no matter how profess you are, you only human that mean your skill is limited, so you need other people help, that you must work together, especially programming. This is a good for me to practice work with someone else.

14. CM.Practice

Project Page
Disuess Page
SVN Page


I feel this assignement is really useful, it is a totally new thing for me. Before, I don't know "Google" is really powerful, it can host the project related to subversion. This assignment help me to understand how to setup project in google.


Subversion part is very easy to do, the only thing to do is download and install, then it can be use, In windows XP, we can choose using command line or right click the mouse to check out the subversion. Create a new folder and download the code from google project website then we will see the mark on each file.


Google hosting part is little bit hard to do, I need to spend a hour to figure out the setup progress. I am following the lecture note to setup the google hosting, but the lecture note slide is unclear. If Philip can improve those lecture note quality would be much batter.


What I learn in this assignment is google project hosting, it is useful in my future, because google project can host any source code and commited by subversion. Also, this is a good time for me to experience how to use subversion and google project hosting.

Monday, October 1, 2007

12.WebSpiderReview

Reviewed Author:
Jon Lao

Installation Review:

I try to run the program in command line but it doesn't work, it has an exception about wrong argument position when Itype default command "java -jar webspider.jar -totallinks http://www.hackystat.org/ 100", Then, I trace the code and see it is not support command line argument, which is cannot use command line to start run the program.

Tool Execution:

Junit - Okey! All test pass.
-------------------------------
Checkstyle
- Fail!
The most reason why fail testing on checkstyle is missing javadoc comment and unclear comment.
-------------------------------
PMD - Fail! Found 8 problems
edu\hawaii\webspider\WebSpiderExample

323_Avoid using implementation types like 'LinkedList'; use the interface instead
270getTotalLinksAvoid reassigning parameters such as 'Url'
398getTotalLinksAn empty statement (semicolon) not part of a loop
3110getMostPopularAn empty statement (semicolon) not part of a loop
3120getLogAvoid using implementation types like 'LinkedList'; use the interface instead
3136checkArgumentsAvoid calling toString() on String objects; this is unnecessary
3139checkArgumentsAvoid calling toString() on String objects; this is unnecessary.


Total number of violations for this class: 7
-------------------------------
FindBugs - Fail!

CorrectnessWarnings1
PerformanceWarnings2
DodgyWarnings1
Total_4


Correctness Warnings
GC com.meterware.httpunit.WebLink is incompatible with expected argument type
java.lang.String in edu.hawaii.webspider.WebSpiderExample.getTotalLinks(String, int)
Bug type GC_UNRELATED_TYPES

Performance Warnings
Dm Method edu.hawaii.webspider.WebSpiderExample.checkArguments(String[]) invokes toString() method on a String
Bug type DM_STRING_TOSTRING
Dm Method edu.hawaii.webspider.WebSpiderExample.getLog(LinkedList) invokes toString()method on a String
Bug type DM_STRING_TOSTRING

Dodgy Warnings
REC Exception is caught when Exception is not thrown in
edu.hawaii.webspider.WebSpiderExample.getTotalLinks(String, int)
-------------------------------
Emma - Okey! Successful run all the test
Emma Coverage summary
class: 100% (1/1)
method: 88% (7/8)
block: 94% (171/181)
line: 90% (43/48)
each type is near 100%. For "method", it get 88% becasue it include one blank method that do nothing with this method.
-------------------------------
Verify - Fail!
Since, checkstyle test is fail before, so that verify.build.xml was stop executed where it got error on checkstyle.
-------------------------------
Dist - Okey!
It successful generate file to C:\eclipse\webspider-rong\build\dist\webspider-rong-1.0.930.zip.
Also, it generate "webspider.jar" at C:\eclipse\webspider-rong, but I cannot successful run the program.

Execution:

I type in default command "java -jar webspider.jar -totallinks http://www.hackystat.org/ 100", but it doesn't run properly.and I try to not input argument, it return right exception message. I try different combination
Code Format and Conventions Review


FileLine# violationComment
WebSpiderExample.java 70,79EJS-25Avoid using uppercase at first letter of each subsequent
WebSpiderExample.java 70,95 EJS-25Avoid using lowercase at firstword
WebSpiderExample.java 75,80,89EJS-9Use meaningful names
WebSpiderExample.java 59EJS-7Only put white space to delineate method, but it is notthe methods



Black Box Perspective:

In this case, the black box perspective that I expect is input something argument and return a reasonable answer.For example, I type this command line "java -jar webspider.jar -totallinks http://www.hackystat.org 100"to run the program with some default argument, that I expect it will return a number of link for the website I type in.If the result is not a number or equal less than zero, that's mean something wrong inside the program.

I tried to not input "-logging" argument in command line that it return error.It's run when I turn on log mode, but return 0 link for default URL, which mean it didn't search for links.

I think Jon's program could allow no page number input that still can show the result. If not input page number thatthe program would find all link until it reach a empty link page.Other black box test case is input a large number at page argument and would crush the program.

White Box Perspective:

I go through Jon's code and see his did not finished getMostPopular method, so that only 88% method coverage in emma reportEmma report also show try and catch statement did not cover in checkArguments method. The main result why the emma reportdid not get 100% because he did not finished getMostPopular method, so most of code cannot coverage.

Break da buggah:

For jon's program, I tried input 9999999999 value to page number, it return 0 link and argument format is invalid.If I input URL that contain javascript, the program will be crush, because it is no try and catch exception implemented.If I not input logging argument, that it return an error.

Summary and Lessons Learned:

For this assignment, I feel my webspider program not doing well after I saw somebody codes, and I found that I spend most oftime on small parts program, and I ignored whole part of program, which is code style, good comment, detail test case and the design of program. These all thing together will make a good program. In this assignment, I learned to be a good programmerthat may need different perspective, because program is a public source that people can use it, and other programmer would read our code, so everytime I write program that need to think about this condition, then start make my program, that could improve the quality of my future software systems.

Wednesday, September 26, 2007

11. Webspider Extension

My second version here


First addition, I add method morePopular() in my new version Webspider. Before for I did make that part, and this time I inspired the code from "Chiao-Fen" and "Jon Lao" to make both method work.


Second addition, I add logging parameter and import logging from java utility. When insert "-logging" argument in command line, it will switch to log mode, otherwise turn to normal.


There are something I cannot made it is test case, I try to create one but it turn out a lot of exception on eclipse that I have no idea how to fix it.

Monday, September 24, 2007

11. Webspider

11. WebSpider


Here is my file


My opinion about this assignment is difficult, hard, complicated, challenging.......
but I like the algorithm of search web link inside web link. It is a good chance to practice our algorithm since we study ICS 311. I didn't finish about this assignment yet, becasue I took a lot of time to figure out how to avoid infinite loop when reach "home" link. The ANT is very good, it help compile, package and build all in one step, we didn't need compile file by file, but the harder part is setting up ANT.

In the assignment, I only finish task 0 and 1, and I cannot get my most popular page working, also logging, and I didn't implement logging. First, I try to use recursive to loop back and forward to search number of link, but it only work with no "home" direct page inside of each link, so I come up use two for loop to control the page and link that I found.

I hope we can have more time to improve this assignment.

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.

Wednesday, September 5, 2007

08.CodeRulerRedux

My code ruler file: here


In part one, we only implement the movement of my knigths, follow and capture enemies, these basic function.


My part 1 result is:
Round1 Round2 Round3:
JeffreyLam/Split-up 514/782 586/785 540/591
JeffreyLam/Gang-up 355/101 711/32 480/78
JeffreyLam/Migrate 627/41 458/16 663/50



My part 2 result is:
Round1 Round2 Round3:
Jeffrey-PhuocLe/Split-up 64/846 122/778 99/368
Jeffrey-PhuocLe/Gang-up 472/530 94/540 95/572
Jeffrey-PhuocLe/Migrate 142/13 123/93 199/19



Compare to two result there are no big different on it, but I learned how to organize the code setting, I made some change on knigth movement that control knigth priority. But I didn't change my strategy that no bigger different on my both result.
Actually, there are three components that we need to care in this game programming is controlling our knigth, peasant and castle. Also, I learned more JAVA coding and style on this game.

Friday, August 31, 2007

07.CodeRulerReview

Reviewer: Jeffrey Lam
Author of code: Ka Yee Leung


I'm going to reveiw Ka Yee Leung's source code. These are few code violation appare in your source code. The violation problem is around formating convention and naming convention. The following table shows the detail of the violation located.

FileLineViolationComments
MyRuler.java81,83,85,*EJS- 9Use meaningful name
MyRuler.java22EJS- 35Use documentation comments to describe the programming interface, not standardcomments.
MyRuler.java136EJS- 5Newline after end brackets

Wednesday, August 29, 2007

05.CodeRuler

Finally finished. This is my source code
Here


Strategy:
My Knight will split out to catch the enemies and take over their base,
and then my knight will generate many new Knight to take over the rest of enemy base.


Here is my result:

Round1Round2Round3
Jeffrey/Split-up514/782586/785540/591
Jeffrey/Gang-up355/101711/32480/78
Jeffrey/Migrate627/41458/16663/50

I have hard time to make knight move to a direction that what I want and I spend a lot of time on this part


The most important of winning the game is controling your knight movement, if we can group all Knight together and head them to attack one of each enemies castle, then I think the result score would be higher.

Monday, August 27, 2007

OSS Expreience

Overview:

Freecol is like a chess that each player have to do some task for each turn, so player need to think more then that before they move each task. The system is developed by members Richard Roy who is Editorial/Content Writer, and developed with many other developer. The system is java-based, and downloaded from http://sourceforge.net/projects/freecol.

Prime Directive 1:

When accomplish task, system does not have to include every sound, that is the error. But overall is good, the artwork use 2D platform, move is smooth and toolbar is easy to use,very simple, easy to understand.

Here include the manual that explain very detail about the game development and how to play the game.

Prime Directive 2:

This game including a installer ".exe" file to install the game that suit to every PC. Also, its provide a ".jar" file for programmer to development. It has a installer for sourse code that make more easy for everybody.

Prime Directive 3:

This system only include manual about the part of game functions, but it not include the design documentation for other developer. It include the comment in source code. Also, it documented what did they updated for each version.

http://sourceforge.net/project/showfiles.php?group_id=43225&package_id=35488

Tuesday, August 21, 2007

FizzBuzz Assignment

The following codes is my FizzBuzz implementation.

public class FizzBuzz {
public static void main(String[] args) {
int x = 1;
while(x<=100){ if(x%3 == 0){ System.out.print("Fizz\n"); } else if(x%5 == 0){ System.out.print("Buzz\n"); } else if((x%3 == 0) && (x%5 == 0)){ System.out.print("FizzBuzz\n"); } else{ System.out.print(x + "\n"); } x++; } } }

I took one and half hours to finish to implement.
First, I make sure that I can print out numbers from 1 to 100 by using while loop and then debug and run.
Second, I test run IF statment and bound to print multiple of 3 and 5 and then debug and run.
Third, since I implemented the multiple of 3 and 5, then I print the rest of slot as numbers and then debug and run.
I think the most important things is make sure debug and run when did any on each step of implementation, it's help to decrease error appear on large program.