10/24/2008

Project Review: DueDates

Overview:

It's always good to review each other. It allows us to take a look at source code of others so that we get new insight. At the same time we also get comments from other developers about what was good or what should be improved. Therefore we did review on our project, DueDates.

Process:

First of all, members of each project made a copy of their source code to "svn/tags/Review-2008-10-20". We did it because this way we can save frozen snapshot of the system. If developers want to update their source code in "trunk", they don't need to wait for reviewers to finish and can always make changes.

Next we started to review source code of other projects. From the project page I went to "Source > Browser" and took a look at "svn/tags/Review-2008-10-20". I will see the code, so if there is something I noticed and I want to make comments, I do it by double-clicking the code so that small section to post will pop up. Then I went to "Changes" which is located right next to "Browse" and clicked the version I reviewed, then left comments there.

Review:

It's really good to know how other developers tried their best for the development. Since we worked on the same problem, we can easily understand the flow of program and what the issue is. Here is something I learned from other projects. One project was showing "Processing..." while they connect to database and get a result. I was thinking the connecting process takes a little long but didn't show any words like this. I think this is very user friendly. Other project was showing menu. It's also nice since as we enhance this project later it will have a lot more capability, and instead of using option we can choose from menu. For my project, I got some comments that I should clean up a bit more, and also some comments that our output of the library information is easily understandable to read.

Conclusion:

Reviewing is a really good way to improve each other. The only con is it takes some time to give out useful comments. I thought Google Code is a very useful tool for this purpose. When I make a review next time, I will take notes of what others were doing and I will try to remember them for future use.

10/20/2008

Creating a project DueDates

Overview:

DueDates is a command base program that allows us to access library database and get information about our own account. I worked with Jeho Jung to enhance this project.

Procedures as a team:

It was challenging to do project with partners since our schedule are different, but we discussed about the project somehow and worked on it step by step. Since there were many things to do, we split work into subproblems and set deadline for each. That way we don't feel too much pressure and we can see if we are on the right track in terms of schedule.

Enhance:

First of all, we worked on formatting output. Since the original project didn't show due date, we added a feature to access it and format using String.format(). It was interesting to know we can use format such as "%1$-15s %2$-70s", which is similar to C language. Then we worked on error handling to check if it shows user friendly message. Lastly we worked on test case to make sure everything works well.

We also worked on writing Wiki page for UserGuide and DeveloperGuide while we enhance DueDates. Those Wiki pages are guide to others and at the same time they are notes for ourselves to remember later.

Conclustion:

Dealing with DueDates was a good review of what we learned so far in software engineering class. Now I'm confident with working on any projects in the world with other developers.

Our project, duedates-green
http://code.google.com/p/duedates-green/

executable jar file
http://duedates-green.googlecode.com/files/DueDates.jar

10/08/2008

Working with other developers on Google Code

This time I will experiment how to work with other developer using Google Code. Since I joined my partner's project stack-klau4, I checked out from https://stack-klau4.googlecode.com/svn/trunk.

After I checked out, I did verify as usual and it passed as I expect. Since there didn't exist any problem, I improved javadoc and committed.

The very important step is to do SVN Update right before I commit, so that if multiple developers made a change to the code it can be merged. Also I need to do verify and it must pass.

TortoiseSVN is a very useful tool that tells me if I made some change to the code. Its interface such as SVN Update or Commit is also easy to understand. It can be invoked from command line and there are more features that I need to explore. I haven't tried other SVN clients but I recommend TortoiseSVN.

With such useful tool, now I got how to work with other developers.

Configuration management

In software engineering configuration management is one of the most important factor. For this time I will experiment SVN to work with other developers.

Initial Setup

I'm Windows user so that I installed TortoiseSVN, which is a client software of SVN. Next I decided where to store all the data, which is called repository. Since TortoiseSVN works with right click, I did it and chose "SVN Check Out" to connect to host. When I do check out, very important thing is to use https instead of http. This allows me to commit after change.

Create a new Google Hosting Project

Next I tried to experiment being an owner of the project, so that I made "stack-yasu" and dicussion list called "stack-yasu-discuss".

http://code.google.com/p/stack-yasu/

http://groups.google.com/group/stack-yasu-discuss

I also checked if codesite-noreply@google.com is working, and it does.
Now I can share my project and take advantage of it when I work with other developers to build a large system.

10/02/2008

StackOverflow

A programming Q&A site called StackOverflow was released. I like this kind of Q&A site and I have been using such website for a while when I cannot solve problems. Sometimes I get answers in 3 minutes and sometimes I don't get any reply, but it is wonderful that I can get right answer without any fee. I also think it's ok to pay if somebody gives me right information that I really want.

When I opened StackOverflow, the first thing I looked for is category. On this website category is called Tags, which can be found on top. When I clicked on that, many different tags can be found. I'm impressed that it has a lot more tags than other websites have. Minor topics such as regex, jquery, and flex were also there.

Make a post

Then I posted a question to see if I can get answers. Right before I make a post, it showed related questions and I thought it was good idea, since they can prevent overlap. My question is about JavaScript, "Can I pass parameter from different page?".

http://stackoverflow.com/questions/163444/can-i-pass-parameter-from-different-page

Surprisingly, I got a reply in 1 minute and got totally 5 replies in 8 minutes. Their answers are very specific and I got how to do it.

Vote and point system

I looked around the website and thought its voting and point system is interesting. If developers think the question is useful, they vote and we can find useful Q&A more easily. For the point system, developers with more points have more authority on this website. I think this is a good idea, but comment also requires people to have 50 points. This has good and bad aspects. With that they are able to prevent spam, but at the same time people who can comment will be a little limited.

Look around

There are a lot of questions that look interesting such as "How many people disable Javascript?" or "How Should a Non-Designer Interview a Web Designer?", and reading those will be more useful than reading ordinary newspaper.

Conclusion

For now StackOverflow doesn't have any ad posted, but since it is useful I think it is ok to put it in the future. It costs for hosting and maintenance, so it can be covered with that. The most impressed thing about this website is that I get quality responses very fast. It makes me think a lot of developers check this website often, and it is also very important thing for this kind of site. I'm glad that I get to know this website and I will use more to improve my technical skill.

http://stackoverflow.com

10/01/2008

Limitations of test coverage

I fixed Stack so that now Emma shows its coverage is 100%. However, some developers say it still possibly have bugs. This time, I try to put a bug in the code and still make it to have 100% coverage.

Insert a bug

After thinking for a while, I found out that I am able to do it by changing "this.top();" to "this.pop();" inside "getTop()". Emma still shows its coverage is 100%, but logically it returns different object.

Conclusion

I successfully inserted a bug in the code, yet Emma shows its coverage is 100%. This means that we are not able to think the code has definitely no bugs even the coverage is 100%. It is true that Emma help us a lot to detect what we didn't test yet or which part possibly have bugs, but we will need to do final check manually in order to make a reliable and secure system.

The code with a bug can be downloaded from here.

Testing with Emma + JUnit

In the previous entry I fixed various errors to pass Checkstyle, FindBugs, JUnit, and PMD, so that I got verified. However, if I take a look at the report of Emma, it says the coverage is still 82% for method, 72% for block, and 80% for line. This time, I will try to fix even more so that its line coverage is going to be 100%.

Adding Test Cases

On the report, red background specifies I haven't tested that part. It was shown that I didn't test methods such as toString, getTop, and etc. To fix it, I wroite a test case for those using methods such as "assertEquals()" or "testIllegalTop()".

While I was writing test cases, I also checked javadoc of JUnit and it helped me understand what the method is doing. There are a lot of methods that look useful, so in the future I will try those to test my code in various ways. On my PC, javadoc was located in the following address.

file:///C:/000/eclipse/tools/junit4.5/javadoc/index.html

Conclusion

Emma is a useful tool that let us know where we didn't test and allows us to fix it. By doing it we are able to improve the quality of the system and make it more reliable.

The fixed code can be downloaded from here.