Wednesday, May 13, 2009

Devcathlon: Great Experience

It has been a while since the last blog entry. The spring semester of 2009 at University of Hawaii is almost over, only couple of days left. What have I been up to for the last couple of weeks – doing some coding on the Devcathlon system of course!

For those of you who are not familiar with what I am talking about, here is a quick summary of what the Devcathlon system is. The Hackystat "Devcathlon" (http://code.google.com/p/hackystat-ui-devcathlon/) is a software engineering game where individuals and groups "compete" based upon their actual software development practices. A software development rule they follow or practice (for example, commit code at least once to a main repository) will be turned into an event, that event have a negative and positive score. A team or programmer follows an event is award points, and not following will a deduction in their score. The Devcathlon system is now running and functional (http://dasha.ics.hawaii.edu:9880/devcathlon/).


The whole Devcathlon development team was given the task to test run the system and jot down findings of what works and what does not work. So I have been test driving the system. What I found
  • (1) should have added scroll option to the events’ panel.
  • (2) The team main, team browse, and match invitation are working.
  • (3) Match invitation’s decline button does not delete the match from Match browse when one of the team owners decline.
  • (4) Preview icons after selecting one from list or uploading from local machine.
  • (5) Overall, the system is running and functioning.
Next, I invited a friend to test drive the system. I kind of notice at times where a scratch to the head and a face of confusing of what am I suppose to do next look. Anyways, here is the outcome:
  • (1) the scoreboard on the login page is great for people who do not have a login credential to get a small “preview.”
  • (2) Liked the whole personal profile managing system, it is like editing your own Facebook, MySpace user account.
  • (3) Commenting on a match lets users “turn up the heat” on the opposing team.
  • (4) The events panel should be scrollable, the list gets too long.
  • (5) There should be more images on the site, it looks a little bland.
  • (6) Link to a user guide should be included within the menu.
  • (7) Add a little more color to the current color scheme, it did not give a “kick.”
  • (8) Overall, the system is a new kind of “game” that programmers might use. I do agree with my friend’s observations and opinions, testing driving the system were somewhat straight forward.

Well, it was a great semester in Dr. P. Johnson’s software development 2 class. Here is my Top Five Lessons Learned from ICS 414:”
  • (1) Working with a team of eight programmers is a lot harder than with four and two programmers.
  • (2) Do not start programming late, input some hours into a program everyday.
  • (3) Fixing merge conflicts when uploading to main repository is a pain in the butt.
  • (4) In the team, there will be someone who is willing to parallel/pair program with you late in the night.
  • (5) All team members have their own style and habits, but we all should communicate with others and follow a standard so there will not be a “silo” effect on the system.

My software development habits have changed a lot – now I know what “siloing” a system means – where people do not communicate with each other, causing people to not be productive and difficult to achieve milestones. Program earlier in the week, so there will not be a late night session at a library. My strength is that once I get the train rolling, then I am on it. My weakness is that the first couple of minutes, I do not know what to do, or I get distracted by other things. I will be working on staying focus and get the trains rolling. Overall, it have been a great experience to work in a team, meeting milestones and deadlines, having the experience on what it is like when a deadline is not met, and programming in a big project like this one.

Monday, March 23, 2009

Devcathlon: User and Team Pages

The Devcathlon system was official turned over to the students in my software engineering class on Wednesday Match 18, 2009. The professor, P. Johnson, is still fully in charge of the system, but the coding and laying out the HTML’s are now in our hands. Hopefully we (students) get a lot of coding and layouts done before mid-May. Alright, here is my run-down of what I did before March 23, 2009 milestone.

We formed two teams to tackle some coding of the devcathlon system – Team User-Team and Team Matches-Scoreboard. I was on Team User-Team (A. Du, J. Ly, S. Sanchez, and me), this team does the coding and HTML layouts for user profile, user’s team profile, listing of teams in the system, listing of user’s teams, manage teams, invitations for joining a team.

So my job was to layout the User’s Teams and Teams in Devcathlon pages. Pages display teams, one is teams affiliate with the user, and the other is all teams in the system. So I created the layouts for both pages, what they should look like. The following images show the layout in the web browser.



I also added pagination to both pages, they are numbers of pages you can look at, a previous arrow to go back one page and a next arrow to go on. The pagination is a great idea if people want to go to Page #3 or Page #8 without looking at the pages in between. The pagination on the Team Browse Page is using the letters of the alphabet because that page display all teams in an A-Z manner.


I made around five to six to the main repository since March 18, 2009. I know it was not that much, I did not commit in the earlier part of the week because I was still implementing the wicket coding (http://wicket.apache.org/) for User’s Team and Team Browse Pages. The majority of my code were committed to two packages: the org.hackystat.ui.devcathlon.teams and org.hackystat.ui.devcathlon.teams.browse.


You can click on the following link to view issues/tasks that are assigned to me: http://code.google.com/p/hackystat-ui-devcathlon/issues/list?can=1&q=PhillipKHLau&colspec=ID+Type+Status+Component+Owner+Summary&x=owner&y=component&mode=grid&cells=tiles. Since March 18, 2009 to the date of this blog entry, I had for issues assigned to me. I complete two of the four issues; the other two issues were not required by this milestone.


My development time tracking sensor for Eclipse is not working properly, I did not notice until fellow team UT member, J. Ly, told me to check out my development time sensor because it is not displaying the amount of time I worked in Eclipse. After posting this blog, I will be reinstalling my Eclipse development time tracking sensor and test it to see if it is the case. I am pretty sure I put in a lot of hours for this week, especially over the weekend.

My team, Team UT, met on Wednesday (when we were in our newly formed groups) and on Friday, March 20, 2009. Those dates we did in-person meeting, met for one hour discussing about the layouts and API’s for getting user and team data. We did two online meeting on March 19 and March 22, 2009. The two online meeting was to for any questions and answers while we are working on our tasks. All the meetings were good because you get to know if everyone was on task and what not.

Wednesday, March 18, 2009

Wicket All Over Again

HAHAHA! I do not remember how to do Wicket (http://wicket.apache.org/) and Cascading Style Sheets (CSS) for html pages. This week for the software engineering class, we are refreshing our minds with an example on wicket, cascading style sheets, and HTML’s. The example is using a menu bar, submenus, and CSS to create an appropriate look. We took the code from a guy named Adam Kalsey (http://kalsey.com/2003/05/css_tabs_with_submenus/) and we have to modify his example to fit what we want.

My first task was to make a new menu (menu 3) in the menu bar that comes with three submenus. That was easy, just have to add some new codes to the BasePage.java and create new htmls for menu 3 and its submenus.


My second task was to make menu 3 to hold ten submenus tabs. So I went into the menu.css and added #menu #subnav 4 to #menu #subnav 10, so this will let the menu bar hold ten submenu tabs.


My third task is that when the header/title text on the page is change to different sizes, the submenus are not dynamically position; they are set to a constant number of pixels. If we change the text size from one to another, we also have to change the fixed position of the submenus. By doing that, we have to go into the menu.css and change this part of the code to the correct number of pixels.


I had trouble doing the final task for this example, is to make the submenu tabs highlight people are viewing that submenu. I did a little research using Google.com to search up any useful implementation of that kind. They had some, but did not work out in the menu bar. A little Java Scripting would be helpful in the future; if possible we can use it for the Devcathlon system.

Had this handy dandy book on the side:


Here are the files that I modify and used, the ten tabs can only be view on test-menu3.java (because that was the page that I modify and did not add to test-menu1.java and test-menu2.java): http://sites.google.com/site/phillipkhlau/files/wicket-example05-phillipkhlau-1.0.318.zip

Monday, March 9, 2009

Devcathlon: Regular Events

This week we are continuing our work on the Devcathlon system. This week, we are working on regular events(http://code.google.com/p/hackystat-ui-devcathlon/wiki/Events). We are also partner up with a fellow classmate to work on this week’s event.

I am partner up with fellow classmate, R. Raqueno. The event we are working on is ‘Keep The Repository Clean,’ there are two wakeup intervals to that event, the first one is waking up every 60 minutes to check if there are any failed builds during that 60 minutes range. The second one is waking up every 24 hours to check if there are any successfully builds during that 24 hours period.

So I am working on the first part of this two-part event. ‘Keep the Repository Clean Hourly,’ event where it will check the continuous integration service (Hudson) every 60 minutes intervals and see if there was any failed builds. If there is a failed build during that check, then it will deduct five points for that team. My part of the event was simply and easy to implement. I re-used my code from a previous event I did ‘Pass the Build,’ added couple of lines so it checks for continuous integration builds instead of regular builds. I also did some test cases to check if the code and scoring is working properly.

I did not run into problems when coding for this event. I did run into problems when I was running automated error detection tools (Emma, JUnit, FindBugs). I forgot what the error was, because it did not happen after a couple of tries. I do not think it is a heap overload error, because it was corrected by the professor, so I do not know what it was. I try to reproduce the error as I am writing this entry, but I am unsuccessful in producing the error again.

Saturday, February 28, 2009

Devcathlon: Starter Events Part 2

We got our Devcathlon starter events (http://code.google.com/p/hackystat-ui-devcathlon/wiki/StarterEvents) extended because not everyone was done or something was missing or extra lines code that does not have to be in there. Getting it extended was a good and bad thing – good thing was that the code was reviewed by the professor, P. Johnson, so we know what to change and what to get rid of; bad thing is that this means most of us were not starting ahead of time, delaying the next part of the Devcathlon system.

My starter event is “Pass the Build,” an explanation on my previous blog post. Making things short, it checks data for successful and failed builds. Gives one point for each successful build, deduct one point for each failed build. There are bonus ten points for successful builds and no failure in a seven day period.

Some mistakes I made in my coding, my method names were not meaningful to what they actually do – corrected that, hopefully it is not confusing now. My methods for finding build data was not working because I was not using the correct result types: ‘Failure’ and ‘Success;’ I was using “failed” and “success’ – that is corrected and the methods are working correctly. Lastly, I made test cases for testing out my methods working properly in finding and scoring points for my start event.

A problem came up in Hudson after I committed my files to Devcathlon’s main repository. Hudson failed build after I committed, the error message I notice was this:

[junit] java.sql.SQLException: Failed to start database 'sensorbase',
see the next exception for details.

I did not know how to fix it and it was causing on random test files. So I asked a fellow student, J. Ly, if he have any idea on fixing it. Scratching my head, I came up with this theory that something went down for couple of minutes on Hackystat side (my professor’s Hackystat server).
That theory was proven wrong when I ran automated testing and it was able to contact the “sensorbase database" on my local machine. So I changed some Javadocs in order to have Hudson build again, first two times Hudson failed, but the third time was a charm when everything passed in Hudson. Soooo… I do not know what really happen that cause that error.

Wednesday, February 25, 2009

Devcathlon: Starter Events

This week we are starting to code for the Devcathlon system. What is the Devcathlon system? My pervious blogs will tell you what it is. Soooo… this week, each of us in my software engineering class get to work on a starter event (http://code.google.com/p/hackystat-ui-devcathlon/wiki/StarterEvents).

Starter events are simple events to code to get started on Event portion of Devcathlon. My starter event was:

Pass The Build
Summary: Give points for passing builds.
PAR: Wakeup once per day. Determine how many builds occurred during that interval and how many passed and how many failed. Award 1 point for each passing build during the past day and deduct -1 point for each failing build during the past day.
Decay/Incentives: Award 10 bonus points for 7 straight days with at least one build per day and no failures.

So this event only checks one team at a time and rewards +1 for each successful build deducts 1 for each failed build. It also gives a bonus for 7 straight days of successful builds and no failure. The problem I ran into was going though the correct Hackystat Javadocs for the right line code to work with, I asked some of the classmates for help, which was great. Another problem was the TestConfigurationManager file, it tests the total number of events, and the problem was incorrect number of events to test.

assertEquals("Test events", 7, config.getEventConfigurations().getEventConfiguration().size());

Merge conflicts happened this morning when I was uploading my java files onto main repository. Hudson failed to compile and build because of incorrect number of events and other things. Like around 12:30 AM 2/25/09, Hudson failed for couple of hours, the person that failed it did not fix it. One of the classmates that were waiting for the Hudson to compile and build successful gave up the wait and went in and fix it. One other problem is that coverage tool Emma (http://emma.sourceforge.net/) is showing 0% line coverage for all test files, I do not know what is going on, for example my test cases is working in Eclipse, but showing failed in Emma.


On the side note, I think the screencasts (http://code.google.com/p/hackystat/wiki/Screencasts) are great, if it is possible to get the file too that was with each screencast will be awesome as well.

Wednesday, February 18, 2009

My First Hackystat Data Retrieval Program

We are about to start coding for the Devcathlon system. If you do not know, the devcathlon system is a “game” my software development class is going to make. The game consists of matches against software programmers. Before we can start coding for the devcathlon, we have to learn how to retrieve information from the Hackystat server (http://dasha.ics.hawaii.edu:9879/projectbrowser/). Our professor, Dr. P. Johnson, gave step-by-step tutorials on how to retrieve information from the server (http://code.google.com/p/hackystat/wiki/Screencasts).

With all that resources available, I code my first basic hackystat program. This program will retrieve the total number of data instances for each day of November, 2008 that was submitted to hackystat server. A data instance can be coding time, number of commits to main repository, and etc. My program will retrieve data instances from November 1, 2008 to November 30, 2008. Then it prints out the total number of data instances for each day, and the total for November 2008.

import javax.xml.datatype.XMLGregorianCalendar;
import org.hackystat.sensorbase.client.SensorBaseClient;
import org.hackystat.sensorbase.resource.sensordata.jaxb.SensorDataIndex;
import org.hackystat.sensorshell.SensorShellException;
import org.hackystat.sensorshell.SensorShellProperties;
import org.hackystat.utilities.tstamp.Tstamp;

/**
* My first Hackystat program to get information from U. of Hawaii Hackystat server.
*
* @author Ka Hung Phillip
*
*/
public class HackystatTask1 {

/**
* Get the total number of data instances for each day of November 2008.
*
* @param args
* @throws SensorShellException
*/
public static void main(String[] args) throws Exception {
String host = "http://dasha.ics.hawaii.edu:9876/sensorbase";

SensorShellProperties properties = new SensorShellProperties();

String user = properties.getSensorBaseUser();
String password = properties.getSensorBasePassword();
System.out.println(user + "\n");

SensorBaseClient client = new SensorBaseClient(host, user, password);
client.authenticate();

String project = "Default";
XMLGregorianCalendar startTime = Tstamp.makeTimestamp("2008-10-31");
int total = 0;

for (int i = 0; i < 30; i++){
XMLGregorianCalendar endTime = Tstamp.incrementDays(startTime, 1);
SensorDataIndex index = client.getProjectSensorData(user, project, startTime, endTime);

System.out.println("Total # of instances for " + endTime + " is: " + index.getSensorDataRef().size());
total = index.getSensorDataRef().size() + total;
startTime = endTime;
}

System.out.println("---------------------------");
System.out.println("Total instances for November is: " + total);
}

}


I am still working on my second basic program that will retrieve data instances on any given month. My for loop that program is giving me funky results, fixing it and will have that code up probably later in the day.

This is cool that I can get instances from the Hackystat server; maybe in the future I can create plug-ins for other IDEs (jokes). My first problem I ran into was getting to the right command to retrieve data. I used the APIs on hackystat wikis to solve it. The second problem was getting the XML Gregorian Calendar date for correct retrieval. I forgot to put in the new date after each retrieval, fixed that and I got it to work. Right now, I am fine with Hackystat APIs, there is no problem for me as of now.