After doing the peer review, it made me realized that I need to change the way that I write programs. As I've notice from the two other systems that I've reviewed, there wasn't any testing done at all and require a bit more error handling. Maybe because we're still in school and the first thing we think about is completing the required task first to do what it's intended to do. Since a program that is incomplete will receive a worser grade. We will definitely have to change this mentality once we get into the real working world.
During the meeting, I felt a bit of awkwardness when it came to giving critiques to peers face-to-face. As I'm not sure how they would take my critiques and they probably think the same way. But once we got the ball rolling, it went really smooth as each team was eager to hear how they can improve their codes. It's almost like a teaching and learning experience all in one.
Majority of the critiques that we received had the same issues. They were able to get it to work with the Eclipse IDE, so they couldn't test the codes.We did all of the testing for our program in the command prompt so we didn't know it couldn't compile in Eclipse. When I try running it in Eclipse, I received a NullPointerException, it have to do with us using the "console.readline" to read user input. Other critiques were that we needed more comments to make our code easier to understand. We will be working on these issues and hopefully get it all fixed back this week.
Over all, This peer review was a great experience and an eye-opener for the ways we program.
Wednesday, November 11, 2009
Sunday, November 8, 2009
Code Review: Help yourself by helping your peers
After working a week on creating the command line interface for the Wattdepot project, we now begin a process called "Code Review". Our code review is an informal peer review consisting of peers examining each others source codes to find mistakes and possible improvements to their quality of their work, thus improving our own skills as a developer. We were each assign 2 other team's code to review. I will be doing my review on team "Umi" and "Umikumalua" codes which can be found here.
Team Umi:
Team Umi's system was well design with all commands working as intended. There were only a few minor error which could be easily fixed. Their javadocs were a bit brief but descriptive. One major thing they can work in is making test cases for each command. Here is my full review on Team Umi's system.
Team Umikumalua:
Team Umikumakahi's system competed most of the commands with a few not working as intended (chart, source summary). The javadoc were good but might have to work on some consistency between different authors. Things they can work on is making the remaining command work as intended, add more error messages, and make test cases for the commands. Here is my full review on Team UmiKumakahi's system.
Team Umi:
Team Umi's system was well design with all commands working as intended. There were only a few minor error which could be easily fixed. Their javadocs were a bit brief but descriptive. One major thing they can work in is making test cases for each command. Here is my full review on Team Umi's system.
Team Umikumalua:
Team Umikumakahi's system competed most of the commands with a few not working as intended (chart, source summary). The javadoc were good but might have to work on some consistency between different authors. Things they can work on is making the remaining command work as intended, add more error messages, and make test cases for the commands. Here is my full review on Team UmiKumakahi's system.
Wednesday, November 4, 2009
Wattdepot: puts you in command
As you all know, we got a new task this week for our Software Engineering class. We started our new project working with WattDepot, a program that collects and stores data on power consumption. With this tool, we are capable of retrieve the data, analyze it, and output it to a chart. This program would be extremely useful for smart consumers to monitor their power consumption. (But for this project, we are currently working with simulated data)
This was our first task that was done in a group. The task was to create a Command Line Interface for this project which will allow users to issue commands listed on the CommandSpecificationpage. Programming has never been one of my strong points. Working in a group has allowed me to learn better programming from my partner and improve my java programming skills. I was lucky enough to a partner that was knowledgeable in Java and patient in helping me to understand the codes. My partner contributed a lot more than I have in this project, Which mean I definitely have to improve on my programming skills to catch up with everyone.
Major problems that we're encounter were satisfying Checkstyle, PMD, and FindBug. To satisfy these criteria, we had to change a lot of the codes to codes that we're less familiar with, which was quite frustrating but a good learning experience. Unfortunately we were unable to create test cases to test each command due to time constraints.
If you want to take a look at our code for the Command Line Interface, you can find it in this list. Our group is umikumakahi...
This was our first task that was done in a group. The task was to create a Command Line Interface for this project which will allow users to issue commands listed on the CommandSpecificationpage. Programming has never been one of my strong points. Working in a group has allowed me to learn better programming from my partner and improve my java programming skills. I was lucky enough to a partner that was knowledgeable in Java and patient in helping me to understand the codes. My partner contributed a lot more than I have in this project, Which mean I definitely have to improve on my programming skills to catch up with everyone.
Major problems that we're encounter were satisfying Checkstyle, PMD, and FindBug. To satisfy these criteria, we had to change a lot of the codes to codes that we're less familiar with, which was quite frustrating but a good learning experience. Unfortunately we were unable to create test cases to test each command due to time constraints.
If you want to take a look at our code for the Command Line Interface, you can find it in this list. Our group is umikumakahi...
Monday, November 2, 2009
Hudson, a continuous secondary check...
If you wondering what Hudson is, it is a a popular open source continuous integration server. We were introduced to Hudson for our first group project in creating a command line interface for the WattDepot project. Continuous integration is great for group work where you want to ensure that the code quality and standards are consistent throughout the whole development process. It can assist teams with software build automation, continuous automated build verification, build testing, and post-buuild procedure automation.

When we began to setup the job in the Hudson server, we were having some connection issues. It was really slow in connecting and there were time where I couldn't load the page up at all. But when it was back up and running, creating the job as a cinch. We were enabled to sync our project with the Hudson server through the use of SVN. So now whenever a member commits new code, Hudson will do a verify test just like the ones we do with ANT, and if it fails the build, it's setup to send emails to the whole discussion group. Isn't it a nifty tool to have? I was quite impress with it. The only drawback that I've experience with this tool so far is the connection problem. As I'm typing this blog, I'm not able to connect to our Hudson project page to get a screenshot of it. I'm not sure what's causing this issue but I hope it'll get resolve soon.
When we began to setup the job in the Hudson server, we were having some connection issues. It was really slow in connecting and there were time where I couldn't load the page up at all. But when it was back up and running, creating the job as a cinch. We were enabled to sync our project with the Hudson server through the use of SVN. So now whenever a member commits new code, Hudson will do a verify test just like the ones we do with ANT, and if it fails the build, it's setup to send emails to the whole discussion group. Isn't it a nifty tool to have? I was quite impress with it. The only drawback that I've experience with this tool so far is the connection problem. As I'm typing this blog, I'm not able to connect to our Hudson project page to get a screenshot of it. I'm not sure what's causing this issue but I hope it'll get resolve soon.
Monday, October 19, 2009
Quickie Questions for a Quicky "A".
Here are some questions that could help you study for the upcoming midterm.
1. In the "Getting Answers" guide, 10 strategies were given. List 3 of these strategies.
6. Why did our RoboCode not follow the coding standard of being within the package hierachy "edu.hawaii" ?
A. this standard may be superceded by "adhere to the style of the original", as in the case of RoboCode.
7. In the antipattern article, what is the "Happy path test"?
A. A happy path test is a test within boundaries, pretty testing something that you know will pass.
8. What is the difference between white box testing and black box testing?
A. White box testing uses an internal perspective of the system to design test cases based on internal structure while Black box testing takes an external perspective of the test object to derive test cases.
9. What is the benefit of using a coverage tool?
A. It make sure that the program is performing normally; producing expected results with the smallest number of errors. Also shows you which line is being executed and if it contains errors or not.
10. What is the goal of GNU and what foundation did they create to help reach that goal?
A. The goal of GNU was to give users freedom, freedom to run the program, copy the program, modify the program, and distribute modified versions. They created the Free Software Foundation
1. In the "Getting Answers" guide, 10 strategies were given. List 3 of these strategies.
A. Explain what doesn't work
Provide Everything up-front
Post your code
Do your research beforehand
Do your research during
Do your research afterwards
Don't post the same question repeatedly
Follow up after you get an answer
Treat the list like people
Always consider the answer
2. Give one good and one bad example of a post to ask for answers. (include subject line and body).
A. (Bad)
Subject: Help, Code not working!!!
Body: Ahhhh... I cant get my code to work... Please help me ASAP
(Good)
Subject: Roboode Junit test error: "robocode home not set"
Body: I received this error while trying to run a Junit test on my robocode project.
I need to set the robocode home path but I dont know how to set it in Eclipse.
Could someone please tell me where i can set this path in Eclipse.
Thank you.
attached is my code and my file path.
3. what is the difference between foo.equals(bar) and foo == bar?
A. foo.equals(bar) is true when their values are the same but could be in different memory location
foo==bar is true only if they are in the same memory location
4. Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz"
instead of the number and for the multiples of five print "Buzz".
For numbers which are multiples of both three and five print "FizzBuzz".
A.
public class FizzBuzz{
public static void main(String [] args){
for (int i = 1; i <= 100; i++){
if (i % 15 == 0){
System.out.print("FizzBuzz");
}
else if (i % 3 == 0){
System.out.print("Fizz");
}
else if (i % 5 == 0){
System.out.print("Buzz");
}
else{
System.out.print(i);
}
}
}
}
5. Find a violation of checkstyle and findbug in the code below.
public void xFire(double robotDistance) {
if (robotDistance > 400) {
doNothing();
}
else if (robotDistance > 200)
fire(1);
else if (robotDistance > 100) {
fire(2)
}
else if (robotDistance > 50) {
fire(3);
}
}
A. Checkstyle: missing "{}" on first else if.
Findbug: missing ";" inside second else if.
6. Why did our RoboCode not follow the coding standard of being within the package hierachy "edu.hawaii" ?
A. this standard may be superceded by "adhere to the style of the original", as in the case of RoboCode.
7. In the antipattern article, what is the "Happy path test"?
A. A happy path test is a test within boundaries, pretty testing something that you know will pass.
8. What is the difference between white box testing and black box testing?
A. White box testing uses an internal perspective of the system to design test cases based on internal structure while Black box testing takes an external perspective of the test object to derive test cases.
9. What is the benefit of using a coverage tool?
A. It make sure that the program is performing normally; producing expected results with the smallest number of errors. Also shows you which line is being executed and if it contains errors or not.
10. What is the goal of GNU and what foundation did they create to help reach that goal?
A. The goal of GNU was to give users freedom, freedom to run the program, copy the program, modify the program, and distribute modified versions. They created the Free Software Foundation
Wednesday, October 14, 2009
Google hosting with express SVN checkout
For our final chapter in our robocode project, we got to create our own google project and discussion group. Yes, it might not sound like a fun thing to do, but rest assure that knowing how to do this will make collaboration on future projects a breeze.
Following the instructions from our professor, we managed to host our own project on google and create a discussion group to support our project. Being the owner of the project, we could select who to invite to be our members and give them access to our project. Couple that with a SVN program such as SmartSVN for Mac users or tortoiseSVN for PC, members can check out the project, make modifications to it, and upload it back to the project site with the new modifications. With this, everyone can work on the same project without having to be in the same place. Now isn't this a great thing to know.
With the instructions given, I didn't have much problem completing the tasks. The only hiccup that I ran into was adding codesite-noreply@google.com as a discussion list member. Following the link given by our instructor, I made a posting on googles support site and the moderator was able to give us a quick solution.
I've added our discussion list "robocode-aak-sidestep-discuss@googlegroups.com" to receive notification of any new changes/commits, but I didn't receive receive a notification email. Maybe I'm doing it wrong.
Something that I've learned from this is the usefulness of google project and SVN is. I've used google docs to share documents among group members before, but this is taking it to a different level.
Here are the links to my project page and my discussion group page.
Following the instructions from our professor, we managed to host our own project on google and create a discussion group to support our project. Being the owner of the project, we could select who to invite to be our members and give them access to our project. Couple that with a SVN program such as SmartSVN for Mac users or tortoiseSVN for PC, members can check out the project, make modifications to it, and upload it back to the project site with the new modifications. With this, everyone can work on the same project without having to be in the same place. Now isn't this a great thing to know.
With the instructions given, I didn't have much problem completing the tasks. The only hiccup that I ran into was adding codesite-noreply@google.com as a discussion list member. Following the link given by our instructor, I made a posting on googles support site and the moderator was able to give us a quick solution.
Please be sure that you understand that I am *not* adding
codesite-noreply@google.com to your mailing list.
Instead, I am changing your project so that it send
email From: PROJECTNAME@googlecode.com.
It is then up to you to subscribe that email address
to your mailing list (if it only allows posts from members).I've added our discussion list "robocode-aak-sidestep-discuss@googlegroups.com" to receive notification of any new changes/commits, but I didn't receive receive a notification email. Maybe I'm doing it wrong.
Something that I've learned from this is the usefulness of google project and SVN is. I've used google docs to share documents among group members before, but this is taking it to a different level.
Here are the links to my project page and my discussion group page.
Wednesday, October 7, 2009
Improved Junit testing With Help From Emma
So last week, we were introduced to Ant and Ivy which are great Quality Assurance tools. This week we go even further into QA by writing our own test cases and testing them with Junit. Why do test case, you asked? well, so far with Ant and Ivy, we're checked to see if our code is within a certain coding standard, that it'll compile with no error, and a simple test case to see if it'll beat SittingDuck. But we haven't test it to see if it does what its suppose to do. That's where you'll need the additional test case.
There were three types of test case that we have to write and test our robots with. They are acceptance (if the robot can consistently beat it's target), behavioral (verify that the robot satisfies a component of the strategy), and unit (verify that individual methods calculate the correct value) tests. The acceptance test were quite easy since our professor gave us an example of it which was tested against SittingDuck. By making a modification to the code changing the target robot name, I was able to create 2 new acceptance test case for my robot (SideStep) to go against Crazy and Walls. Both test passed via Eclipse and Ant, which was great considering that I had the hardest time getting Junit to work in Eclipse. ( After many fail attempts, I finally deleted Eclipse and reinstalled it and somehow Junit is working now with the same configuration that I used with the old one).
For the behavioral test, I created one that would test to see if my robot would fire only if the target is within 400 pixels. First off, writing test code was a lot harder than writing the actual code. I couldn't figure out how to call methods from other classes that I used in the actual code. After writing the test code by trail and error, it was able to pass the Junit test. Junit is still very new to me and I will probably need more time to look into it. But due to time constraints from my other classes (projects and exams) this week, I didn't have enough time into reading up on it, which I'll probably do over the remainder of this week.
Even with the help of Emma, I'm only about 50% sure that I'm testing the right thing. Emma is a great tool which outputs a html file that shows which line in the code it is testing and shows if the line fail or pass the test. I will continue this assignment through the rest of this week and will update this post with new test cases and discoveries.
Here is the code for my robot including its test cases.
There were three types of test case that we have to write and test our robots with. They are acceptance (if the robot can consistently beat it's target), behavioral (verify that the robot satisfies a component of the strategy), and unit (verify that individual methods calculate the correct value) tests. The acceptance test were quite easy since our professor gave us an example of it which was tested against SittingDuck. By making a modification to the code changing the target robot name, I was able to create 2 new acceptance test case for my robot (SideStep) to go against Crazy and Walls. Both test passed via Eclipse and Ant, which was great considering that I had the hardest time getting Junit to work in Eclipse. ( After many fail attempts, I finally deleted Eclipse and reinstalled it and somehow Junit is working now with the same configuration that I used with the old one).
For the behavioral test, I created one that would test to see if my robot would fire only if the target is within 400 pixels. First off, writing test code was a lot harder than writing the actual code. I couldn't figure out how to call methods from other classes that I used in the actual code. After writing the test code by trail and error, it was able to pass the Junit test. Junit is still very new to me and I will probably need more time to look into it. But due to time constraints from my other classes (projects and exams) this week, I didn't have enough time into reading up on it, which I'll probably do over the remainder of this week.
Even with the help of Emma, I'm only about 50% sure that I'm testing the right thing. Emma is a great tool which outputs a html file that shows which line in the code it is testing and shows if the line fail or pass the test. I will continue this assignment through the rest of this week and will update this post with new test cases and discoveries.
Here is the code for my robot including its test cases.
Subscribe to:
Posts (Atom)