Friday, October 24, 2008

Review Other Group's Code

DueDate Project - Review
DueDate project is currently developing by many groups. I and my partner have been developing the project from last week. The detail of the project is described here. This week, we are assigned to review other group so that we can interact with other group members.

What I Learned From The Review
This was not the first time to review other people's code, however, at this time I had much more chances to learn about the tools for review other project. The first thing I did for the review was make our project on google to be ready for review from other group members. We copied our original source codes into the tag directory for this step. By doing this, I and my partner can keep developing our project without worry other people. After that I started to review other groups' project. During the reviews on the other group's work, I realized that why the wiki pages and JavaDoc are so important to satisfy the prime objective 2 and 3. Fortunately, all groups that I reviewed had pretty well written javaDocs and wiki pages on google project and this helped me to understand their code easier and faster.
On the other hand, our group has six reviewer and we got many advices and comments from them. It was so good to show our work to other people so that we can get useful thoughts and advices because it will save us a lot time to fix our source by ourselves.

Conclusion
I learned and found many good things from reviewing other groups' project for the same project. I was also exciting to find various approaches and solutions to the same problem that I had hard time to solve.

Monday, October 20, 2008

Developing DueDate Project Using Google Project

At this time, I and my partner Yasuyuki Kaneshige worked on a team project called "DueDates". DueDates get information from UH library site and displays information about checkout items from the library. This was my actual first team project that requires a lot participation from and interaction between the group members. There are two downloadable version of project that one for User and the other one for the other developers.
Related Links:
Google Project address: http://code.google.com/p/duedates-green/
DueDate-green project executable jar file: http://duedates-green.googlecode.com/files/DueDates.jar
DueDate-green Project Developer Version:
http://duedates-green.googlecode.com/files/DueDates-1.0.1020.zip


For the pair programming, it was pretty hard to set up a meeting time for everyday. We could start pair programming after 2 days passed from the project released.
The preparation of the project also took more time than we thought. It was pretty challenge to me to set up correct classpaths in the build.xml. The new thing that I found through this project was that how the Google Project is efficient for the online based group development programming. Google Project has many tools and I liked the tools called Wiki and Issue. Wiki helps developers to write a instruction of the project more faster. Also, Issue tool helps developers to interact with other developers more efficiently.

For the programming part, I had hard time to figure out how to run the project with the eclipse because our classpath did not work perpectly. To solve this program I set up a class path in the 'Run Configuration'. By run the program on the eclipse, I could save a lot time to spent to type in the command.

Tips for the Pair Programming
Bring your eclipse in your Laptop and eclipse in your pocket for the pair programming!

Tuesday, October 7, 2008

Working with a partner on Google Code.

Invite a Member Into Google Project
For how to create and use Google Projects, please see last posting. With Google project, the owner of the project can invite other member into the project using e-mail address. The invited person will become a member of the project once the person accept the request. After became a member of a project, all members can check out the source code and commit after they fixed the code. Owner can setup a

Download Partner's Code and Build
There is one important thing that we working on a team project using SVN client that we always need to check the source code passes the verify tests. This need to be done before commit a project and after updated a project. In this way, each members can start their improving of the project without worrying about other member's mistake. The owner of the project can also setup a mailing lists so that all group members will be notified when there is a new commit of the project or issues. To test the partner's project, I checked out a project from my partner's Google Project. After Downloaded, I ran "ant -f verify.build.xml" on his project but the build was not successful because there were some errors from checkstyle. Thus, I contacted to my partner and asked him to fix the original source code. He fixed his little mistake in a minute and I was notified by e-mail when he committed newer version of the project. I know this will be happen every day in programming job and this was really good experience for me as a programmer. After I finished my small improvements on the project, I checked "ant -f verify.build.xml" passes and committed my project. My Partner Tyler Wolff's project can be downloaded from http://code.google.com/p/stack-tylerwolff/

SVN Update
Before start the improving on the downloaded project, there is one more important thing to do that we need to update the directory so that make sure we have newest version of the project. Since I setup a mailing list with my project on Google, I also notified by e-mail when my partner committed my project. So, I updated my project directory using Tortose SVN client and ran verify and it passed. I could figure out what he changed by watching his commit message. My project located at http://code.google.com/p/stack-jeho/

Exploring the Google Hosting with SVN

About code.google.com
Google provides a great open source development environment to users with free cost. Google also provides SVN server, Mailing lists, and Issue tracker. In order to access to SVN server, we need to install a SVN client program that will works on our operating system. SVN client program is so useful and powerful when we need to work on a network-based team project.

How to Install an SVN Client?
SVN Client can be downloaded from below depends on the operating system.

For Windows: http://tortoisesvn.net/downloads
For Mac: http://www.syntevo.com/smartsvn/download.html

I am a Window user, so I downloaded tortoiseSVN and all installation went smoothly. However, after the installation, tortoiseSVN requests users to restart the computer because the tortoiseSVN is a shell extension that means it is integrated into the Windows explorer. To use tortoiseSVN, we can open a Windows Explorer and right-click on any folder we like to bring up the context.

How to Modify an Existing Google Project?
In order to check out a project from Google Project, we need to be a member of a project at code.google.com. We can see a "SVN Check out" menu after open a Windows Explorer and right-click on any folder. The address I used to download the stack projece was http://code.google.com/p/stack-johnson/. After the Check out, the first thing we need to do is that make sure that the "verify" target passes. If the "verify" target passes, we are ready to fix the project. From given project, I found few checkstyle errors and fixed it. After the improving the original project, we need to "verify" target still passes so that other project members can keep developing after we commit the improved project.

How to Create a new Google Hosting Project?
In order to create a project on code.google.com, we need to have a Google account. Creating a new Google Hosting is easy to follow and pretty straightforward. We need to decide a project name, summary for the project, description, source code licence and Labels when we create a new project. After the creating a new project on Google, we can invite another member to the project. we can also using mailing lists when there is new commit or issue changes.

Wednesday, October 1, 2008

Exploring the limitations of test coverage

Emma is a program coverage tool that can generate HTML based test coverage reports as part of our build system. JUnit test class checks the expected output and actural output of the original program. We can make more stable and solid program using both Emma and JUnit tools. However, is it possible a program has a bug but it still passes JUnit tests and also it has 100% coverage? You can find the answer below.

A BUG that inserted into Stack.java
I have been fixed the original Stack project so that the program passes all the automated QA tools and has 100% of coverage. My fixed Stack project, which has 100% coverage can be downloaded from here. I fixed toString() method that originally convert all elements in the stack into a string. the code I inserted is

return "[Stack [1, 2, 3]]";
This line simply return the string '[stack [1, 2, 3]]' no matter what is inside the stack. My JUnit test class checks toString() method after pushing 1, 2, 3. Therefore, there will be no error in JUnit test and coverage is still 100%.

Writing a new test case to catch the bug
In order to find the bug in the source program, I had to fix the test cases so that JUnit reports the error. The fixed case is

@Test
public void testToString() {
Stack stack = new Stack();
stack.push(one);
stack.push(two);
stack.push(three);
stack.push(four);
assertEquals("Testing stack toString", "[Stack [1, 2, 3, 4]]",stack.toString());
}

This test case failed because the actural output "[Stack [1, 2, 3]]" did not match to expected out put "[Stack [1, 2, 3, 4]". This source can be downloaded from http://www2.hawaii.edu/~jeho/ICS413/stack-JUnit-Lab-jeho-6.0.930.zip

Lessons from Emma and JUnit
Although Emma and JUnit are great tools to find bugs and check expected out put of the source code, there still a posiblities that a code has logical bugs but can pass those tools. Therefore both Automated and Manual QA are still important and need to be checked together.