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.





Wednesday, September 24, 2008

11.Stack

____________________________________________________
GOAL:

To be able to get familiarize ourselves with the Ant build
system, open source automated quality assurance tools like
FindBugs, PMD, an
d CheckStyle, and build system structure.


TASK 1:


First, installing all the tools namely Ant, JUnit, PMD, FindBugs, and Checkstyle was easy . However, we have to set up all the Environment variables which I forgot to do after installing those tools. So when me and my partner was starting to do the Ant Lab in the class we had to actually set up all the paths for those tools and that took a while. After everything was set up invoking all the targets was fine except when I run the
"ant -f junit.build.xml" it failed because and it's saying something about the testing of the TestStack.java. So I run the TestStack.java on Eclipse and the test failed because the the top() method in the Stack is trying
access the first one that is push on to the stack instead of the one that is on top
of the stack. And the other one is trying to pop something that has been already remove from the stack. So I fixed that one by modifying the Stack.java class and TestStack.java class.


  • ant clean compile
  • 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 verify.build.xml

Here is the revised build stack file:

http://www2.hawaii.edu/~flestado/stack-flestado.zip


Sunday, September 14, 2008

CodeReview

GOAL:

To be able to identify any violations of
the Java coding standards and documentation.

Reviewer: Mari-Lee Flestado
Reviewee: Jeho Jung

File
Lines
Violation Comments
MyRuler.java
1, 2,3, *
EJS-5
Code is indented 4 spaces instead of 2 spaces
MyRuler.java
1 ,3
EJS-SE-JAVA-2
Code used the wildcard "*" in import statement
MyRuler.java

121,147
EJS-22
Code did not use lowercase for the first word for method names.
MyRuler.java
7, 156
EJS-46


Code did not use a fixed ordering for Javadoc tags.



The logic of the code itself performs the task in a very efficient 
manner. I did run the code also and what I really like about it is 
how the knights captured the castle really fast and when the 
knights captured the opponent's castle then it can create more
knights and peasants. That was one of the strategy that I tried 
to implement in my own code but it didn't really work. 
However, the only thing that I've notice was the lack of good 
application of Java coding documentations which I have listed
above. But other than that he implemented a very interesting 
strategy in his program.


Monday, September 8, 2008

05.CodeRuler

________________________________________
LESSON LEARNED FROM CODE RULER:

Time dedication is always been big part of programming. But in this project I think that was my biggest challenge. Because of time conflict with my former partner and my busy work schedule, communication in a timely manner was really hard. Unfortunately, he finally found someone else to do the project with .

The strategy that I came up with is :
  • to release the peasants in different directions to claim unoccupied lands and opponent's lands
  • when the opponent's peasants, knights and castles are more than ours we create more peasants, knights and castles.
  • when there are peasants or knights on our way we capture then and finally capture the opponent's castle.

Source code and javadoc link:
www2.hawaii.edu/~flestado

RESULT:
_________________________
marilee vs. migrate ruler
_________________________
438 - 94
408 - 121
330 - 118
_________________________
marilee vs. gang up ruler
_________________________
66 - 499
18 - 346
41 - 536
_________________________
marilee vs. split up ruler
_________________________
17 - 522
8 - 602
27 - 527





Among the three teams the hardest to compete with were the 2 groups(gang up and split up rulers), as you can see I got defeated pretty bad. I know I could have done better if I put more time in doing it. I think the reason why the 2 teams defeated me really bad was because I didn't develop a better strategy in attacking the enemy and protecting my castle, knights and peasants at the same time.

What I have learned about eclipse is remembering some of the features that I haven't use for a while. But comparing Eclipse to other IDE's out there, I would say that Eclipse has the best hands-on resources to help a lot of programmers .