Tuesday, December 13, 2011

What is this... code... you speak of?

My group seemed satisfied with our project that we were a part of which I talked about in my last post. If you don't remember what that was about, we wanted to add a command line interface to an open source project called WattDepot. WattDepot is an open source program that retrieves and monitors data from energy usage that is gathered by sensors within a location such as a house or other building. You can find more information here. Our resulting project is called hale-aloha-cli-backr and you can find more information about our project here.

I looked over Google's code project and searching for our project when I saw that there were several other groups that were implementing the same functionality through a command line interface that we had implemented. As a group, we were interested in what functions other groups were trying to implement and how those groups were implementing those functions. After looking over several other groups that were implementing the same type of interface, we hit upon a group that seemed interesting to build upon. They had implemented the same type of interface which we had implemented and some of the same functionality. More information about their code and project can be found here.

When we contacted the group, they seemed interested in getting our input on their project and we wanted to get another opinion about our project. So we became developers on their project and we added them as developers to our project. We both wanted to add more functionality to our codes and we started to wonder if we could improve on the new project rather than our own project, in order to understand each others code more in depth.

Both groups decided on implementing these three changes:

1. set-baseline [tower | lounge] [date]

2. monitor-power [tower | lounge] [interval]

3. monitor-goal [tower | lounge] goal interval

Each of these things would rely on building on the already implemented base command line interface program and give us the chance to work as a collaborator to an already existing code base.

The set-baseline function is needed to set a baseline for a tower or lounge to mark the power usage per hour over the course of a day per hour, giving us a way to track power usage during a specific day and hour of that day.

The monitor-power function shows the current usage of power and reports it to the user in set intervals.

The monitor-goal function relies on the set-baseline function to compare a certain day's power usage rating compared to the current power usage. It also compares if the current power usage is reduced at or below the goal percentage reduction and keeps calculating the comparison in the set intervals.

After defining the functions that we wanted to implement, we started reviewing the basic supplied code from the group that we wanted to improve on. Our group continued to use issue based project management and continuous integration to monitor and help keep our project running smoothly. After getting a shaky start with implementing our base project, we started to get more confident and used to issue based project management. In addition, we wanted to make sure where everyone is during the design process, so we started to communicate more with our group. In accordance, our issues started to go up.

After getting roughly familiar with the foreign code that we are starting to work on, we quickly fleshed out prototypes of the functions that we wanted to implement. taking into account the changes that we wanted to implement, we had to change some key modules that were to run the base program in order to facilitate running our program. There was some difficulty, but I was assigned to create the monitor-goal function. Since this relied on another function, set-baseline, I needed to wait until that was completed in order to finish work on the functionality I was supposed to work on. When the set-baseline function was working, I had started coding the monitor-goal function and it was sort of difficult at first. not only I had to look over the base code, I also had to look over the new code for the set-baseline function.

After getting everything finished, which included some parts where the code just did not want to work for no apparent reason, I had integrated the finished function into the code base. We were glad that was finished, but we needed to update all the smaller things such as the user and developer wikis that were on the project page as well as the front page listing all functions of the program.

I admit it was difficult to look over a code base that you want to improve on and getting used to implementing code that is different from what you are used to coding, but it gives good practice in order to review code effectively and also spot error where they might pop up. The code that we had to work with was not all that bad and was fairly well documented, compared to code that I have seen that has either no real good documentation or documentation that is fairly old and has not been updated in quite a long time. Our group's new

No comments:

Post a Comment