Monday, December 12, 2011

Going to be King After the Back Row Life

     Building off of the previous review comes an extension to the project our group inspected. Our team members of the group BackR took over the project hale-aloha-cli-bking, developed by group Bking, to add in some new enhancements and features.
     The hale-aloha-cli projects in summary are the same program developed by different groups of developers. This program is basically a command line interface program that gathers energy data from the Hale Aloha Towers Dormitories at the University of Hawaii at Manoa using WattDepot.  With this energy data, the program utilizes it and manipulates it to provide a formatted output for the user to see and analyze.
     Using the previous base project of the hale-aloha-cli-bking as the foundation, our group implemented the following new commands to the project and bump it up to version 2.0:

  • (1)  set-baseline [tower | lounge] [date]
     This command defines [date] as the "baseline" day for [tower | lounge].  [date] is an optional argument in YYYY-MM-DD format and defaults to yesterday.  When this command is executed, the system should obtain and save the amount of energy used during each of the 24 hours of that day for the given tower or lounge.  These 24 values define the baseline power for that tower or lounge for that one hour time interval.  For example, if lounge Ilima-A used 100 kWh of energy during the hour 6am-7am, then the baseline power during the interval 6am - 7am for Ilima-A is 100 kW.

  • (2) monitor-power [tower | lounge] [interval]
     This command prints out a timestamp and the current power for [tower | lounge] every [interval] seconds.  [interval] is an optional integer greater than 0 and defaults to 10 seconds. Entering any character (such as a carriage return) stops this monitoring process and returns the user to the command loop.

  • (3) monitor-goal [tower | lounge] goal interval
     This command prints out a timestamp, the current power being consumed by the [tower | lounge], and whether or not the lounge is meeting its power conservation goal.   [goal] is an integer between 1 and 99.  It defines the percentage reduction from the baseline for this [tower | lounge] at this point in time.  [interval] is an integer greater than 0.
     For example, assume the user has previously defined the baseline power for  Ilima-A as 100 kW for the time interval between 6am and 7am, and the current time is 6:30am.   If the goal is set as 5, then Ilima-A's current power must be 5% less than its baseline in order to make the goal.  At the current time, that means that Ilima-A should be using less than 95 kW of power in order to make its goal.
     It is an error if the monitor-goal command is invoked without a prior set-baseline command for that [tower | lounge].
     Entering any character (such as a carriage return) stops this monitoring process and returns the user to the command loop.

     As a group, we continued the Issue Driven Project Management and applied it to this project as well. With practice from our first project, it wasn't difficult to adapt it to the new project. The only thing we needed to adapt to is the code since none of us wrote it. Besides adapting to new code, we also needed to understand it which was fairly easy from the get go.
     Our group implemented all of the three commands listed above with minor modifications to overall base code. For example, the original program hard codes its commands in a processor class, so we copied the design and extended it, rather than replacing it. Developers like myself will probably not like code that is not theirs, but that's a pat of life. People will not appreciate everything, so you need to adjust and live with it sometimes. With code, you get to see how others write to solve a problem that you would do differently and that's how we can learn and discover new things.
     With the new system, it still applies to all three Prime Directives. The project still accomplishes a task as the 1st Prime directive describes. Our group updated the home page of this project to reflect these changes as well. With the 2nd Prime Directive, an external user will be able to still successfully install and use the system with the help of the previous groups user guide. In addition to this, we also modified to add in more descriptions for the user to read upon. In Prime Directive 3, developers will also be able to understand and enhance the system just like our group did for this project. We entered a project that set up the baseline for any future project enhancements.
     Overall, this project improved from the first version with the addition of the new commands. I would say our group did an excellent job providing great quality work.

Links:
Project Home: http://code.google.com/p/hale-aloha-cli-bking/
Download: http://code.google.com/p/hale-aloha-cli-bking/downloads/detail?name=hale-aloha-cli-bking-2.0.2011.12.13.11.06.zip&can=2&q=
WattDepot Home Page: http://code.google.com/p/wattdepot/
Three Prime Directives (Blog Entry) : http://elmarcarillo.blogspot.com/2011/08/three-important-pixels.html

Tuesday, November 29, 2011

A Retrospective Review

     After the events of my group project: hale-aloha-cli-backr, I gained enough knowledge to review another hale-aloha-cli project created by another team. Before I can get into this review, let's go back and see how we got here.

  In August, in a blog entitled, "Three Important Pixels", I've introduced three important rules under open source software engineering called the Three Prime Directives. I used these directives to evaluate a program called Pixelitor and so on to gain some experience using Java-based open source systems, and to gain an appreciation for the difficulties involved.

The Three Prime Directives are as followed:
  • Prime Directive 1: The system successfully accomplishes a useful task.
  • Prime Directive 2: An external user can successfully install and use the system.
  • Prime Directive 3: An external developer can successfully understand and enhance the system.

  Moving up a month to September, I've introduced an "Awesomely Nifty Thing" called ANT. Developed by the Apache Software Foundation, Ant is a tool for automating software build processes. Along with ANT came a project in October involving Robocode which introduced myself to the Automated Quality Assurance tools: Checkstyle, PMD and FindBugs. Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard. PMD scans Java source code and looks for potential problems. FindBugs uses static analysis to look for bugs in Java code. By implementing ANT build files to adhere to one of these automated quality assurance tools, it was a simple task to build, test and compile a project to distribute to other users.
  At the dawn of November sparks the introduction of WattDepot which is a system for collecting and storing data from electricity meters for smart grid research and experimentation. To better understand the aspects of WattDepot, I've undergone some software Katas to familiarize myself to the WattDepot API manipulating various energy data and displaying them in a given fashion.
Not found in my blog, but from personal experience came the introduction of Continuous Integration (CI). What may CI be? Well, tying all the aspects of what I've introduced to you is an important technique for high quality software development. CI implements continuous processes of applying quality control — small pieces of effort are applied frequently. Continuous integration improves the quality of software, and reduces the time taken to deliver it, by replacing the traditional practice of applying quality control after completing all development.
  Finally this led to the hale-aloha-cli-backr project highlighted in the previous blog entry which also brought up the topic of Issue Driven Project Management (IDPM). IDPM breaks up a project worked on by several members and is divided into small tasks or "issues". Each person completes their issues and updates frequently to adhere to the CI standards.

  Okay, so you're still here if you're reading this line. Let's go back to the review…

  As stated before, I got the opportunity to review another hale-aloha-cli project created by another group of people. In this review, I will evaluating the software incorporating all the things learned throughout these past months and basing them off the first thing I introduced to you: The Three Prime Directives.

Review question 1:  Does the system accomplish a useful task?
     This project is just like the project I've worked on with my group, so it's basically our project envisioned by another group. I obtained a copy for this project and ran as many commands to view the feature set of this team's project. It seems that the group implemented all the feature commands:

  •      current-power [tower | lounge]
    • Returns the current power in kW for the associated tower or lounge.
  • daily-energy [tower | lounge] [date]
    • Returns the energy in kWh used by the tower or lounge for the specified date (yyyy-mm-dd).
  • energy-since [tower | lounge] [date]
    • Returns the energy used since the date (yyyy-mm-dd) to now.
  • rank-towers [start] [end]
    • Returns a list in sorted order from least to most energy consumed between the [start] and [end] date (yyyy-mm-dd)
  • quit
    • Terminates execution
  • help
    • Displays a menu of all possible commands.
With all of these commands, they provide useful tools for displaying various energy data gathered from the Hale Aloha towers at the University of Hawaii at Manoa.

Review question 2: Can an external user can successfully install and use the system?
     Now lets get down to testing this project. The home page of this project describes briefly what the project is about. Also on the home page is a featured link to the user guide. The user guide written provides simple instructions to install the program and what available commands the program offers (as described in the help command). The downloads section of the project website provides a distribution with the current version number of the project. Unzipping this file outputs the source and an executable jar file.
     After an extensive testing continuing from the first prime derivative, I've tested this program thoroughly and noted these errors and findings:
  • Program crashes when entering any number of space characters without any characters entered.
  • If a correct command is called without any parameters, it gives the same help information.
  • The help command with parameters still gives help and doesn't catch error.
  • The output of the help dialog needs more spacing between information to be easier to read.
  • Some commands catches invalid date format, but needs to be more clear on the specific error.
  • rank-towers does not have energy rating units.
  • energy-since without a tower goes through but brings up a generic error message, needs to be more specific.
  • Calling daily-energy without a tower or lounge but having the date parameter in a correct format gives an error specifying that there was an error accessing the blank tower.
  • Calling rank-towers with a future date in the end parameter crashes the program.
  • Calling rank-towers with the end date lower than the start date gives the correct error.
  • Given a date far in the past gives a generic error that should be more specific.

Review question 3: Can an external developer successfully understand and enhance the system?
     For this part, we'll take the shoes of a developer. On the website for the project, it also provides a developer guide along the user guide. It provides a short sentence on how to build the system and lists all the types of automated quality assurance it runs. Though it doesn't mention if there are any manual testing done. Provided is a coding standard used for the project and a link to it as a plugin of the Eclipse IDE. The remainder of the guide describes the packages of the program and their functionality. There is no mention if this project is under continuous integration, no descriptions on how the project was implemented and contains no explanation on how to generate javadoc.
     After examining the website, I move on to checking out a copy of the project from the repository. I was able to find an ant build in the project that generates javadoc. The javadoc of the system seemed clear and simple, but maybe a bit short. However, the names of the components in the project are clear and provides a sense on what they do. Within the processor class are hard coded command class, so there is some information hiding since one could update the processor class to add in additional functionality.
     Upon building the system, there we're no errors. Generating test coverage from the jacoco ant build provided an overall 85% coverage for instructions and 65% coverage for branches. The manual test cases in the program tests one java source according to the name. If any additional enhancements to the project should occur, it would not disturb these test files since enhancements should come in the command package as specified by the developer guide on the project's website.
     Overall after reading through the source code, I would say that it was fairly easy to read, but the comments in the code was on the low side. Some additional comments would be helpful to explain some algorithms such as get the user's input date and parsing it.
     Back to the website to do more analysis. This project was developed under Issue Driven Project Management, so there were a see of issues assigned to each member who completed that assigned task. The issues page clearly shows on which member worked on what and would give a clear sense on who to question if a new developer works on this project. The system does show that one developer did more work than the fellow members but most of the issues this user committed were testing issues.
     Even though it was not specified in the developer guide, this project was ran under continuous integration. I was given the link to the CI build site and did some analysis on it. Failed project builds seemed to be corrected promptly, though there was a lengthly correction for build #4 - #7 which took 11 hours and 52 minutes to correct. The project did seem to be worked on consistently with build every day or two though not all builds were associated with an issue. Here's a breakdown of the builds with no issues:

  • #1-14 no issues associated with upload.
  • #16-19 no issues associated with upload.
  • #24 no issues associated with upload. Started by user.
  • #29 no issues associated with upload.
  • #32-35 no issues associated with upload. Started by SCM change.
  • #43 no issues associated with upload.
  • #47 no issues associated with upload.
  • #49 no issues associated with upload.
  • #51 no issues associated with upload. Started by SCM change.
  • #53 no issues associated with upload.
  • #55 no issues associated with upload.
  • #56 no issues associated with upload.
  • #57 no build.
  • #58 no issues associated with upload.

     Overall, the project seemed easy to read and with some time someone would understand it. Since much of the program to call the command package from the run class is hardcoded into the processor class, an external developer would have some ease on adding more elements to this system. All the developer needs to do is hard code the new command class into the processor, produce a working new command class and add tin the description into the help command. It will be a simple task, but since the developer will need to update 2 classes and provide a new one, it will also be a lengthy task.

Links:
Three Prime Directives (Blog Entry) : http://elmarcarillo.blogspot.com/2011/08/three-important-pixels.html
Robocode : http://robocode.sourceforge.net/
Robocode (Blog Entry) : http://elmarcarillo.blogspot.com/2011/09/kode-cut-row-bow-code.html
Apache ANT : http://ant.apache.org/
ANT (Blog Entry) : http://elmarcarillo.blogspot.com/2011/09/awesomely-nifty-thing.html
CheckStyle : http://checkstyle.sourceforge.net/
PMD : http://pmd.sourceforge.net/
FindBugs : http://findbugs.sourceforge.net/
WattDepot (Blog Entry) : http://elmarcarillo.blogspot.com/2011/11/shopping-for-electricity-at-wattdepot.html
hale-aloha-cli-backr (Blog Entry) : http://elmarcarillo.blogspot.com/2011/11/command-line-in-back-row.html

Sunday, November 20, 2011

Command Line in the Back Row


     Most young programmers like myself start off programming solo, but we eventually have to learn how to program and work with others since this is a more realistic approach to a programming type of job. Over the months, I've introduced many things such as the Ant Build System and Configuration Management that enables working in a group with ease. With these tools, anyone in a group can make a change in the project and update it to the other members, but would you say it's organized? Over the past weeks, I participated in a group to develop a program using a style called Issue Driven Project Management (IDPM). Simply, as a group, we break down the project into tasks and we update the project according to these small tasks that we are assigned to do rather than just writing code till it works and putting it together. IDPM organizes what each member of a team should do and is efficient since it acts as the guideline to finishing up the project.
     So let's get back to the project my group and I created. The project is called hale-aloha-cli, but for our group, it's entitled "hale-aloha-cli-backr". (Note: backr is or group name. Derived from "Back Row" since our group was formed in the back row of a classroom.) This project extends what I've been working on the more recent blog entry of WattDepot. This project is a command line interface program to understand various aspects of energy use in the Hale Aloha residence halls at the University of Hawaii at Manoa. Other information on our project can be found here: http://code.google.com/p/hale-aloha-cli-backr/
     As a group, we developed this program using Google Project Hosting to host a repository of our system online and we also used Jenkins to automatically build the project and check for errors. We divided the project into tasks which we individually had to update the status on (or Issue as it's called). At first, our group didn't start with much issues. We just builded the base system and didn't create any issues on them. After a formal meeting on IDPM, out group started fresh and created issues for all tasks from revision 1 of the project. After more issues, we finally accepted what these issues did; it directed each group member what they needed to do rather than asking someone what needs to be done. If an issue is found, anyone can create an issue for it where anyone could take to address it.
     We completed the project fulfilling the guidelines and implementing all what needs to be in our system. Our project takes in 6 basic commands:
  • help
             Shows the user a list of commands, the parameters for them and a description.
  • current-power [tower | lounge]
             Returns the current power in kW for the associated tower or lounge.
  • daily-energy [tower | lounge] [date]
             Returns the energy in kWh used by the tower or lounge for the specified date (yyyy-mm-dd).
  • energy-since [tower | lounge] [date]
             Returns the energy used since the date (yyyy-mm-dd) to now.
  • rank-towers [start] [end]
             Returns a list in sorted order from least to most energy consumed between the [start] and [end] date (yyyy-mm-dd)
  • quit
             Terminates execution

     Our project contains a main program which we named HaleAloha. This class is the main interface which does most of the printing on to the console, takes user input and connects to the WattDepot server. The HaleAloha class calls the CommandProcessor class which decodes the user's input in which this processor class makes a call to the CommandManger. The CommandManager invokes one of the command class that matches with the command input from the user using the Java Reflection API to create instances of these command classes. This seems to be more robust that hard coding these classes onto the file. This would make adding future command classes simpler.
     While developing the program, we also needed to test the program at the same time. In sync, we developed some test files for the classes we created. Using jacoco to see how much our test covered our code, we tried to make test cases that would cover most of our code, if not 100%. A simple program that is well tested will probably perform with no issues than a complex program with little or no testing. As we completed our test files, the entree project was hit with a curve ball. The WattDepot server crashed and we were unable to connect to the server, rendering our program useless for a couple of days. When WattDepot revived, our program ran as before, but our test files failed. This was because all old sensor data from WattDepot was no longer available. We could only access data since the revival. Our team acknowledged the problem and fixed it to get it up and running again; clearing up the many failed builds in Jenkins.
     Overall, I think our group produced a great quality program, though there will always be room for improvements.

Link:
Project Home: http://code.google.com/p/hale-aloha-cli-backr/
Download: http://code.google.com/p/hale-aloha-cli-backr/downloads/detail?name=hale-aloha-cli-backr-v1.zip&can=2&q=

Friday, November 4, 2011

Shopping For Electricity at WattDepot

     With the previous introduction of energy comes the idea of utilizing the data centered around it. Why do such a thing you may ask? Well interestingly, energy data could be used to research different areas while gathering data on the amount of energy consumed or produce. With this information, there could be a way to use it such that in the future when a hypothetical smart grid is developed, energy could be dispersed based on the need of a certain area. Could this be possible? Most certainly, but maybe not today.
     Today on the other hand, I introduce to you WattDepot. This web service collects electricity data from meters and stores it in a data base. This data can then be retrieved and analyzed then possibly become the basis to developing applications for a future smart grid.
     Like previous applications introduced to you in my blog, before we decide to use an application, we must learn how to use it ourselves. See the pattern? Here we go… Code Katas. The following code katas were designed to help one become proficient in utilizing the WattDepot API.

Kata 1: SourceListing
     Implement a class called SourceListing, whose main() method accepts one argument (the URL of the WattDepot server) and which writes out the URL argument and a list of all sources defined on that server and their descriptions, sorted in alphabetical order by source name.  Use the System.out.format method to provide a nicely formatted list. 
  • Using the wattdepot-simpleapp distribution as a basis, I built this kata off of it. I took out some unnecessary code such as retrieving sensor data and just left it pruning out the sources and descriptions.
  • Time to completion: 10 Minutes.


Kata 2: SourceLatency
     Implement a class called SourceLatency, whose main() method accepts one argument (the URL of the WattDepot server) and which writes out the URL argument and a list of all sources defined on that server and the number of seconds since data was received for that source, sorted in ascending order by this latency value.  If no data has every been received for that source, indicate that.  Use the System.out.format method to provide a nicely formatted list.
  • This kata was a bit tricky. I could calculate the latencies and print them along with the list, but this kata states that the output must be sorted by the latency values. My first though was to create an array and then sort it, but it might take too much time and wouldn't be efficient. Ultimately, the best solution was to create a class that implements comparable. I called this call WattDepotUtility and created it such that I could benefit from using it for the next katas, hopefully. I also note there is a delay in getting the latencies before showing the list. A user might think the program might be stalled, but it's actually doing the calculations.
  • Time to completion: 2 hours (Estimate. Most of time was spent on researching how to create my WattDepotUtility class).


Kata 3: SourceHierarchy
     Implement a class called SourceHierarchy, whose main() method accepts one argument (the URL of the WattDepot server) and which writes out the URL argument and a hierarchical list of all sources defined on that server.  The hierarchy represents the source and subsource relationship between sources.
  • Building off from the previous katas, I discovered that there is a method in the API to retrieve sub sources of a source. The problem is that this method returned the path of the sub source instead of only the name. What I did to solve this problem was to split the string at the last index of the '/' character to get the name. I also created a method that would generate a tab character (2 spaces) when the hierarchy needs to be branched out.
  • Time to completion: 45 minutes.


Kata 4: EnergyYesterday
     Implement a class called EnergyYesterday, whose main() method accepts one argument (the URL of the WattDepot server) and which writes out the URL argument and a list of all sources defined on that server and the amount of energy in watt-hours consumed by that source during the previous day, sorted in ascending order by watt-hours of consumption.  If no energy has every been consumed by that source, indicate zero.
  • Most of my time spent building this kata was learning how to retrieve the energy data and getting yesterday date. I know I need to use the getEnergyConsumed method, but I always kept getting errors. What I discovered with some testing was that if the XMLGregorianCalendar being passed it had a time with seconds and milliseconds that were not zero, it would produce a resource not found error, so these time always had to be set to zero. First problem solved. For getting yesterdays date, I went through many methods such as Calendar and SimpleDateFormat. After browsing through the API, I could my answer in using the Tstamp class.
  • Time to completion: 3 hours.


Kata 5: HighestRecordedPowerYesterday
Shopping For Electricity at WattDepotImplement a class called HighestRecordedPowerYesterday, whose main() method accepts one argument (the URL of the WattDepot server) and which writes out the URL argument and a list of all sources defined on that server and the highest recorded power associated with that source during the previous day, sorted in ascending order by watts.  Also indicate the time when that power value was observed. If no power data is associated with that source, indicate that.  Use the System.out.format method to provide a nicely formatted list.
  • In this kata, it's very similar to the previous one. I just added in a method that would get all the power values from the previous date and get the highest value. My utility class only holds a string and data (double), but the output also wants the time. I could have added another field to my WattDepotUtility class, but instead, I concatenate the time with the name and the deconstruct it before printing the result. Same like the second kata, there is a delay in showing the list, but is much, much longer to the point most users would think it froze. So I added in print statements that would tell users when it is getting data from a certain source, in this test, there where 64 sources, so there were 64 messages printed to ensure the program is doing something in the background.
  • Time to completion: 35 minutes.


Kata 6: MondayAverageEnergy
     Implement a class called MondayAverageEnergy, whose main() method accepts one argument (the URL of the WattDepot server) and which writes out the URL argument and a list of all sources defined on that server and the average energy consumed by that source during the previous two Mondays, sorted in ascending order by watt-hours.  Use the System.out.format method to provide a nicely formatted list.
  • For the final kata, I think the trickiest part is determining when the previous two Mondays were. Playing with the Tstamp class and writing a switch statement product the correct result.
  • Time to completion: 30 minutes.


     Overall with my experience using WattDepot I think it's very simple, though what you do with the data however, can get really complex. I completed all the katas listed above and most where not easy to complete as described. WattDepot is straight forward on getting energy data with many methods that probably sound what they will do such as getEnergyConsumed (getting the data for the amount of energy consumed). The katas can teach you how to sort data in a way that is easy to compare data from one source to another. In the end, this could be applied to any type of data and is not limited to energy data. Data manipulation may take some work to produce the correct output, but what really maters is how one will use this information.

Links:

Monday, October 31, 2011

Down with Oil: Renewing Hawaii's Energy Future

     It must a dream to live in Hawaii for most people, but the cost of living and lack of space would deter people from doing so. One of the more costly expenses in Hawaii is the source of energy. Hawaii has the most expensive power rate in the United States due to our heavily dependence on imported oil. Governor Linda Lingle signed the Hawaii Clean Energy Initiative that would achieve 70% Clean Energy in Hawaii by 2030. In order to promote clean energy and bring down the cost of energy, Hawaii has to change its way on getting its energy beside using oil, such as using renewable energy, use local resources and lower the overall power consumption of the state. By doing these tasks, Hawaii could become the leader in clean energy development.
     Using renewable energy will make Hawaii less dependent on imported sources of energy. In fact, Hawaii has almost every source or renewable energy such as wind, waves, solar, ocean thermal and geo thermal energies. The problem with this is that the state is divided into several islands and not all islands provide all these natural resources. For example, The Island of Lana'i would be a viral place to produce wind energy due to strong wind currents over the island, but the island doesn't need all the power. Other islands such as O'ahu needs this power, but the problem is how does it retrieve the power from Lana’i since the ocean is separating them both. The mainland consists of one giant main power grid and regions can produce or even sell its energy to other regions. In Hawai'i, each island has its own power grid and can't share it with others. If Hawaii can solve this problem and find a way to share energy with the other islands, using renewable energy will lower the over cost of power.
     Oil accounts for 77% of energy in Hawaii. This a very large portion of the energy consumption of Hawaii. Due to oil being imported, the cost to bring the oil to Hawaii effects the overall price of not just energy, but practically everything such as gas, food, clothes and jobs. When the price for oil goes up, the prices of all goods goes up along with it. By breaking this dependency on imported resources like oil and coal, the cost of living in Hawaii can be significantly lower if the state uses local resources just like the mainland.
     Local consumption of energy is high and will continue to grow, unless Hawaii finds a way to use energy efficiently. Currently Hawaii uses about 1000 Megawatts of energy everyday and is projected to rise to 1200 Megawatts in the near future. This would probably mean if Hawaii does indeed produce renewable clean energy but also increases its power consumption, the cost of energy might be less the same. If Hawaii can keep the power consumption at the same level or even decrease the demand for power, that's when the state can expect to see a decrease of price in energy. To promote lower power consumption, the state will have to work together and use power efficient devices such as replacing old lightbulbs with new CFL's or LED lights. It might be a small change for one person, but if everyone in Hawaii contributes, efficient use of power will lower the over power demand for the state.
     Hawaii has the potential to provide the state with most of its energy needs without the dependency of oil as an energy source. Using renewable energy, local resources and lowering the power consumption of the state, Hawaii can achieve it's Hawaii Clean Energy Initiative that would achieve 70% Clean Energy in Hawaii by 2030 and could significantly lower the cost of energy and consumer goods of the state.

Links:
Hawaii Clean Energy Initiative: http://www.hawaiicleanenergyinitiative.org/

Friday, October 21, 2011

Study, Stress, Study, Stress, Study, Pass The Test!

     It's the middle of the semester. Guess what time it is? Yup. Midterms!!! I know you're thinking: "noooooooooooo" times 100 while rolling on the floor stressing out, but it doesn't have to be this way. In one class of mine (Software Engineering) our professor let us students create questions for our upcoming midterm. This is what all you students should be doing anyways. Studying does equal stress, but in the end, it helps you pass the test. Now grab those box of kleenex and wipe your tears. It's time to study!
     In this blog, I've been writing about the experiences I've been through and all the new things I've learned under the subject of Software Engineering. The following are five study guide questions I've created for the upcoming midterm. It might give you some time to look back at what was learned to see if you've been up to date. Not sure if I am, but who is anyways. Keep that spirit up and see you after you pass that midterm of yours!!!

1. When generating JavaDoc for your projects, what 2 files must be created and where do they need to be placed?
     overview.html in the top-level of your system implementation. 
     package.html in the package.

2. When designing a Robocode robot, there are 3 basic moves. Name one and write the method that enables that function.
     Movement: ahead(), back();
     Radar: scan()
     Shoot its gun: fire();

3. We are using the Apache Ant build system for assignments in this class. Name one feature of Ant.
     Java-Based
     Cross-platform
     Extensible
     XML configuration files
     Open Source
     Defacto standard for Java Projects
     File-Level, but not library-level dependency management.

4. When running an Ant build file, what argument must you put before the file name to execute the build file.
     -f = Use given build file.

5. Given the following program below, which of the following automated quality assurance tool (Checkstyle, PMD, FindBugs) will produce an error?
Checkstyle will produce an error. There is no package 

Thursday, October 20, 2011

Changes Made Simple. Now Commit!

       With Robocode somewhat aside, let's move away from coding and look at projects as a whole. When working on a project alone, it's simple to keep the project up to date. When sharing And distributing projects, we ran into the problem of getting the project to work on other user systems. That's where we were introduced to Build Systems such as Apache Ant to help distribute, compile, test and debug projects. So now, how can we take projects further? Well, first step was to work on projects alone, second was to share them with others, so I guess the third logical step is to work on projects together. Many of you may think that it's just like group work where everyone splits up and do their share then come back together to piece it up. Sounds simple right? In theory it does, but there are some issues we do have to address in this situation. Having the same project on different systems causes every copy of the project being slightly different from one another after the changes that are committed. The problem with this is that how do all the developers of the project merge all there files together without overwriting everyone's changes? This is where I introduce to you Configuration Management, *Applause*. What is it? Magic? A life saver? Something that will bore you if I explain in too deep? I guess all is true. Let's summarize and say that configuration management allows users to work on a project and they could update the project that is hosted online with what they locally on their systems. When users update (Commit) the project, only the. Hanged in the project are changed, for example, one line of code rewrittenI set as Users or a renamed file. Configuration Management makes multi user projects easier to handle. 
       After being introduced to Configuration Management myself, I decided to try it out  using my Robocode project. For this experiment I used Google Project Hosting as my hosting site for my project and Smart VN as the Configuration Managment. After some speed bumps trying to get my project to upload into the server, I finally got it to work. While playing around with the system, I made some updates to my projects such as formatting and better javadoc. These changes causes the revision number to change and I can use this to see what changes were made since the original upload. With Google Project Hosting, it was simple to create some wiki pages that I set as user and developer guides. The SVN client SmartSVN was also simple to use to upload and commit changes to the project. The only initial problem was setting it up, but most of what I needed to know was listed in the Google Project Hosting site. Overall with my experience, I thought it was a simple process. I can see why this is another handy tool for many developers.

Link:
Robocode-cel-wayfarer Project: http://code.google.com/p/robocode-cel-wayfarer/