Monday, November 3, 2008

"Behind the dark clouds there is a sun that still shinning."









Darker Days


Me and the rest of the purple team pretty much meet at least an hour or so everyday except for the weekends because some of us has to go to work and do some other personal matters. So on weekends we just communicated through Google chat. This second version of doing the project seemed a lot harder than the first one. Because we have to build more classes and test cases for each class. On top of that, we also stumble upon problems on the .classpath file, every time I tried to compile and run the program on eclipse it would just crash.

Therefore, we ended up editing the .classpath file and fixing the build class path on eclipse. While I had that particular problem on eclipse I just pretty much did my compiling and running on DOS prompt. In addition, there are also a lot of pressure in our group especially in getting things done in certain ways. If someone forget to verify and when you tried to run the build on your program it fails and because of that someone can just assume that you broke the build.

Shinny Days

Despite everything we've been through we got everything done. We also updated our wikis (Homepage, DeveloperGuide and UserGuide) and checked all the Javadoc documentations. Last time we got deducted some points because of not having enough sample input and output on our UserGuide so I added some screen shots and better sample output for the program.

Saturday, November 1, 2008

Code Review: Second Time Around

We've been given a second opportunity to improve our DueDates project and of course, that accompanied by double effort and double work to be done. We did a review on the duedates-blue team.

















Their homepage and wikis (DeveloperGuide and UserGuide) were very detailed and informative. The output formatting of their program is really nice though they only used a basic formatting as oppose to using the String format with field and width precisions. In addition, they didn't really implement a lot testing cases and if they did, that will probably help to raise the emma coverage on their program. My additional review for the blue team is located here.

_______________________________________________________________

Our DueDates program was reviewed by duedates-violet They stated on their review that they weren't able to pass "ant -f verify.build.xml" on the first attempt. Also, due to time constraint they weren't able to really look at and test all the functions of the additional classes that we implemented. However, they did their best to give us constructive criticism such as needing to do a little clean up on our comment tags so that we won't be having errors in running PMD and checkstyle. Finally, they liked the improvement on our wikis (DeveloperGuide and UserGuide) that included with screenshots and more enlightening guide.

_______________________________________________________________


Overview:

Everyone works hard on this phase of the project. My team and I meet each other everyday except on weekends because of work and personal matter. We did our best to review and comment on the blue team's project and it's up to them whether to disregard it or at least consider it. And the violet's review on our project are quite helpful and something to consider and look forward to.

Thursday, October 23, 2008

Project Review

Ups and Downs

Examining different codes from various people helps me to broaden my knowledge about programming. The people who reviewed our code were kaneshige, shum, leung, ly, reeves and tian. All of them who reviewed our code gave some constructive criticisms on how they like our javadocs, test cases and the print out of the stack trace but at the same time they also pointed out some things that can be improve such as meaningful comments, user guide output example and fix build failed because of the missing "xbean.jar".

The DueDates project codes that I reviewed are the following:

First, the duedates-violet used few abstract classes and they implemented those really well. The only thing though I tried to run the verify but their program had couple checkstyle problems. Then, I also tried to run their program on the command line using my own information (id and lastname) with valid and invalid inputs but it only prints out a stack trace on both conditions.
Second, upon reviewing the duedates-red project code it was very neat, it has a nice output formatting and it prints out the correct error message. The only thing that they didn't have are test cases and their program didn't really check for invalid inputs. Finally, the last thing I reviewed is the duedates-yellow and they have the best output formatting that I've seen so far. Their program also output the right error message for valid and invalid inputs but their user manual didn't really have detailed information guide for external users in downloading and running the program.


Overview

By checking out or doing some reviews on other people's projects helped me on how to become a better programmer in the future. I have seen some really good program codes that I think will really help us to get some ideas from. And receiving those feedback from other peers on how to improve our project were very helpful. We are currently working on how to develop a better detailed user guide, meaningful comments and trying to analyze on how to fix the build.xml file that contains the error about the "xbean.jar".





Sunday, October 19, 2008

DueDates Project


DueDates-Purple Team

_____________________________________________________________________

Duedates is an application that keeps track of borrowed items (books, DVD, video, etc.) from the library. There are three members in our group: me, John Ancheta and Daniel Arakaki. Doing the duedates project with them was very interesting and helpful. From the very first day that the project was assigned, all the three of us met outside and discuss the days and times that we have to meet to accomplish the project. Therefore, we agreed to meet from Monday to Friday for at least 1-2 hours. And for the weekends, some of us has to go to work and take care of some other things, so we didn't agree to meet on Saturday and Sunday and we just decided to communicate through google chat and email.

I don't have a lot of experience using Subversion so John, who has the most experience really walk us through it in every step of the way. Especially, when I was having so much problems on SVN update and errors on Eclipse jars, he was there telling us not to give up because everything is going to be okay.

_____________________________________________________________________

Project Assigned


The part of the project that was assigned to me was the "UserGuide.wiki". The User guide was created in order for the "everyday user" to be able to comprehend the downloading and installation instructions in layman's terms, whereby making the installation of the program much easier. Here is the link for the user guide. Then, the Homepage was assigned to Daniel and the DeveloperGuide.wiki was assigned to John.

In addition, Daniel did most of the coding on the test cases for TestDueDates.java. I did a little bit of coding some methods on the DueDates.java and 1-2 test cases. And John was the one who gave us hints on how to complete our own assigned task and oversees if we are having problems accomplishing those particular tasks. Finally, he also fixed some errors on most of the codes and made sure that we understand what we were doing on the project.

_____________________________________________________________________

Overview


I have learned so much things on this project especially using Google Project Hosting and SVN. We had so much problems on Eclipse jars and on top of that we have different operating systems. So what does work on the other member's OS it doesn't work on the other one. Despite of everything happened we were still able to accomplish our project because of team work, sharing ideas and determination.

Here is our DueDates Distribution file: DueDates-1.0.1019.zip

Wednesday, October 8, 2008

SVN and Google Project Hosting with a partner


"The greatest good you can do for another is not just to share your riches but to reveal to him his own. "


In this week's second homework we are going to do a collaboration in software development by editing a partner's project on their stack implementation using SVN and Google Project Hosting. We didn't have a lot of time to do a side-by-side programming so we decided to just communicate through Google Chat.
______________________________________________________________________

Experience:

I did not really do a lot of heads up on this homework and I missed the class where they discuss about on how to use SVN Google Project Hosting. Therefore, I just installed the TortoiseSVN client on my laptop before the lab in the class and haven't gotten a chance to navigate through it. So, when I got home I was about to teach myself and try to remember what my partner[Ancheta] did on the previous homework. But I never got a chance to because we started chatting and he asked me some questions whether I am able to do a particular task.

Afterward, he downloaded, verified and modified my stack project default folder from build/classes/ to bin/ . Then, he sent me a confirmation that he made a commit (repository revision) on my project. Finally, I checked and verified (ant -f verify.build.xml) everything
____________________________________________________________________

Downloading partner's code and build:

I had a problem when I was editing my partner's project because I downloaded it from the incorrect location and when I tried to import it into Eclipse it got froze. So, when I told him that I was having a problem he pretty much walk me through it but that took a while because we are not sitting side-by-side to see each others screen so he can have a better look at what is going on. Nevertheless, we solved that particular problem so I downloaded his "stack-jnancheta" project on my desktop and verified it. Then, I changed the default output folder from build/classes/ to bin/. At the end, I commit the changes and an email was sent for confirmation.
____________________________________________________________________

Overview:


I love learning from other people especially when they share their wits with humility and shows an appreciation to their partner. My partner was really helpful and knowledgeable about using the SVN and Google Project Hosting. Although sometimes he works so fast and he wants everything to be done right on the spot but I understand because "time is gold". Using SVN and Google Project Hosting in an open source application is very convenient. As soon as you made the changes on a project it is available for a review right away by someone remotely.



Tuesday, October 7, 2008

TortoiseSVN and Google Project Hosting

Google is not only one of the best search engine but also offer hosting open source projects for free namely the server -- Subversion(SVN), issue tracker, and mailing list. And to be able to use all of these features we have to install the TortoiseSVN client. So I installed the TortoiseSVN client and it was pretty straightforward.

SVN is a revision control system that maintains current and past versions of source code files, documentation, and web pages. In addition, SVN has three top level directories:
  • trunk/ -- which represents the 'main line' of project development
  • branches / -- contains subdirectories that holds the copy of the project
  • tags/ -- contains subdirectories that each has the snapshot of the project which represents the record configuration of the project.
____________________________________________________________________
Modifying the existing Google Project:

I haven't gone far in modifying the existing google project. So since my partner John Ancheta already finished his homework he just pretty much helped me to accomplish this part of the homework.

First, we checkout the file that is located at http://code.google.com/p/stack- johnson/. Then, we run the "verify" target (ant -f verify.build.xml) and everything was all good. Then, we have to improve the project and we did this by putting additional test and run the "verify" target again and everything passes. Finally, we commit the change on the project to the repository.
____________________________________________________________________

Creating new Project:

In creating a new Google Hosting Project we have to obtain an SVN password first (like one of the SVN screenshot SAMPLE below).










____________________________________________________________________

Next, we added the instructor's email, which is "philipmjohnson@gmail.com" as an additional owner so he will be able to review our project setup. I also added my partner's email "jnancheta@gmail.com" on my member list. Then, we define "stack-flestado-discuss" in the discussion list and add the "codesite-noreply@google.com" as a list member. Later, we specified the trunk directory:

https://.googlecode.com/svn/trunk/













Afterward, we did "SVN checkout" this is where you have to enter your repository URL (as shown below) and then entered gmail username and SVN password.












Next,we populate the trunk directory and added the files, then finally we did a commit (red ! indicates that the directory has been modified not committed) and all files should be now in the directory.
___________________________________________________________________

Overview:

Doing this particular task helps me to understand more about SVN and Google Project Hosting. The offered features and convenience of Google Project Hosting for open source projects is really good. All the modifications or updates is need to keep track especially for problem issues.



Wednesday, October 1, 2008

Testing Stack using Emma and Junit

Testing a program or a software probably is the most tedious thing that a programmer does. But without thouroughly testing a program you will never know the importance of effort and time that you dedicated to finish the program. When me and my partner [Vincent] was starting to invoke the ant -f emma.build.xml in the class we stumbled upon on some errors on the emma.tool. And I was asking my partner what might be the problem but he didn't know either because he didn't even install Emma on his computer yet. In addition, I had a very slow and old laptop to run all these programs so it's not really helping me at all either. Therefore, I installed and set the path all the programs that I need in my new laptop and everything is much better. So I run the ant -f emma.build.xml on my revised Stack program and here is my coverage summary. The method, block and line is pretty low so we have to improve the line coverage to 100%.

[concat] Emma Coverage summary
[concat] class: 100% (3/3)
[concat] method: 73% (8/11)
[concat] block: 69% (65/94)
[concat] line: 75% (15/20)

The first thing I did was add some testing to my TestClearStack.java.
____________________________________________________________________

/**
* Test the top of stack.
* Should use JUnit 4 exception annotation!
*
* @throws EmptyStackException if the stack is empty during the test process.
*/
@Test
public void testGetTop() throws EmptyStackException {
ClearStack stack = new ClearStack();
stack.push(two);
stack.push(three);
assertEquals("The top of stack is two", three, stack.getTop());
}

/**
* Test illegal empty of the stack.
* Should use JUnit 4 exception annotation!
*
* @throws EmptyStackException if the stack is empty during the process.
*/
@Test
public void testIllegalEmpty() throws EmptyStackException {
ClearStack stack = new ClearStack();
stack.push(one);
stack.isEmpty();
assertEquals("The stack is not empty", false, stack.isEmpty());
}

/**
* Test if the stack is empty.
* Should use JUnit 4 exception annotation!
*
*/
@Test
public void testLegalEmpty() {
ClearStack stack = new ClearStack();
stack.isEmpty();
assertEquals("The stack is empty", true, stack.isEmpty());
stack.push(two);
assertEquals("The stack is empty", false, stack.isEmpty());

}

************************************************
TestStack.java
************************************************
/**
* Test illegal getTop() of the stack.
*
* @exception EmptyStackException If errors during stack processing.
*/
@Test
public void testIllegalTop() throws EmptyStackException {
Stack stack = new Stack();
try {
stack.top();
fail("Top of empty stack did not generate exception.");
}
catch (EmptyStackException e) {
System.out.println(e);
}

}

/**
* Test legal get top of empty stack.
* Should use JUnit 4 exception annotation!
*
* @throws EmptyStackException if the stack is empty during the process.
*/
@Test
public void testLegalGetTop() throws EmptyStackException {
Stack stack = new Stack();
stack.push(two);
stack.push(three);
assertEquals("The top of stack is three", three, stack.top());
stack.pop();
assertEquals("The top of stack is two", two, stack.top());

}

/**
* Test legal pop of the stack.
* Should use JUnit 4 exception annotation!
*
* @throws EmptyStackException if the stack is empty during the process.
*/
@Test
public void testPop() throws EmptyStackException {
Stack stack = new Stack();
stack.push(two);
stack.push(three);
assertEquals("Testing pop of the top of the stack", three, stack.pop());
assertEquals("Testing pop of the top of the stack", two, stack.pop());
}

________________________________________________________________

When I added those test cases I obtained this coverage summary:

[concat] Emma Coverage summary
[concat] class: 100% (3/3)
[concat] method: 100% (11/11)
[concat] block: 100% (94/94)
[concat] line: 100% (20/20)

Here's the link for my final Stack build:
http://www2.hawaii.edu/~flestado/stack-flestado-final-build-6.0.1006.zip

Conclusion:

The most important thing that I've learned in implementing different
test cases to improve the Emma coverage summary is doing thoroughly testing
and implementing the correct result assertion. For some reason every time I run
my JUnit test it gives some kind of "RemoteRunnerError, etc.". Therefore, I have
to actually "Clean" it first for my test to be able to run correctly. Adding some sort
of test cases into my TestStack.java and TestClearStack.java helped to improve my
Emma coverage summary. The only main thing that the Emma is detecting is how
many test case methods you implement but you can actually put those test cases in
one method except that it doesn't really increase the coverage summary.