Friday, February 27, 2009

Engineering the Event pt II

Introduction
The class got a reprieve and got an extension on Event development. After a disastrous start, the team struggled with the Hackystat framework, which led to more review and an extra nudge to get everyone to work extra hard.

Working with the Framework
Professor Johnson mentioned in class the difficulty with working with a new framework and how he spends numerous hours reviewing documentation and tinkering with code. I was quite relieved to hear a seasoned computing expert to talk about their learning curve when learning something new. The team was given a week to go through the DailyProjectDataClient documentation and write code using the API. The challenging aspect of the assignment was not the task but trying to figure out how everything fits together. At this point in our college careers we should be able to work with a new framework in a fair amount of time. In my case I was not aggressive with writing the code and assumed that I could bang out the event in a day or two. However, it took me 4 days of actual coding to complete the assignment.
Over the course of the 4 days I hacked away trying to figure out.
  • How to extract members and dev time using DevTimeDailyProjectData.
  • How the bonus points get calculated.
  • How a HashMap works, I used only once in an assignment for 311.
  • Why didn't start on this assignment sooner.
I did complain to Professor Johnson about the Hackystat documentation being difficult to research. Because the Sensorbase, Utilities, and DailyProjectClient Javadocs are not in one document or linked together. It can be a bit of a pain if you are in the section Tstamp and you need information on DailyProjectClient API.

Digging for Data
For the event No MIAs I had to dig for data: development time and user information. I spent about a day and half using print statements to find the right code combination to extract what was needed to get the application moving.
for (int i = 0, j = timePeriod; i < timePeriod ; i++, j--) {
      try {
        DevTimeDailyProjectData devTimeDpd = 
          dpdClient.getDevTime(owner, projectName, Tstamp.incrementDays(currentTime, -j));
        
        for (MemberData dataRef : devTimeDpd.getMemberData()) {
          String user = dataRef.getMemberUri().substring(38);
          this.devTimeMap.put(user, dataRef.getDevTime().intValue());
          devTimeSum = this.devTimeMap.get(user);
          devTimeSum += devTimeSum;
        }
      }
Some notes about the code.
  • Need to iterate over a given number of days. The parameters for the assignment is 3 days.
  • A DevTimeDailyProjectData instance is needed to extract member data. The DevTimeDailyProjectData object is initialized by getDevTime from DailyProjectDataClient class.
  • Loop through the member data, retrieve the user name, and dev time.
  • Store the information into a HashMap for easy access.
  • Sum up the scores.
Probably the most important snippet from NoMias.java because it retrieves the data necessary to assess if developers are spending time coding.

Conclusion
Wish I took a more aggressive approach to developing the event. I probably could have finished the assignment on time. I felt working with a new framework was challenging but not impossible. I am hopeful that I can learn other frameworks in the near future and perhaps make software engineering a career.