Sunday, October 18, 2009

Study Time!

Some questions to help study for this week's midterm:

1. Name one reason why using Unix based OS is better than using Windows in software development.

There's many reasons why a unix based OS is better than Windows in software development. One of them is that you don't get the usual problems that Windows users get such as getting infected by a malware and/or spyware. Stability could also be a reason.

2. Provide an example on how to properly ask a question in an online community forum.

Subject: NullPointerException when running a robot in Robocode

Body: Hello, I'm using Eclipse 3.5 on my Intel Macbook Pro running Snow Leopard. The error shows up when I try to run the robot Movement04. It throws the NullPointerException error before the robocode application gets a chance to open up.

*code here*

3. Why is it better to focus on doing one thing instead of multitasking?

The quality of work decreases if not focused on one thing.

4. Name one advantage of using automated quality assurance.

It saves precious time and money.

5. Provide an example of a JUnit Antipattern and explain it briefly.

Happy Path test validates the expected behavior of the system.

6. What automated quality assurance tool checks for proper coding standard?

Checkstyle

7. Provide an example of an acceptance test design.

Test to see if my own robot can beat a sample robot.

8. Why would a developer implement version control on their programs?

By implementing version control, we can see what types of changes were made in the system. For example lets say we have a system that's currently in version 1.1. If we compare it to say version 1.1.1, we can tell that its just a minor bug fix if the developers were following the version standards. If it was 1.2, then we know that something new or a major revision was done.

9. Name one advantage of distributed version control over centralized version control.

Everybody has their own copy of the project. If the project gets lost or corrupted in a centralized server, unless someone kept a backup, the whole thing is gone.

10. What does ANT stand for?

Another Neat Tool

Wednesday, October 14, 2009

Project Management with Google

In this homework assignment, I learned how to use a centralized configuration manager by using SmartSVN and project hosting with Google Code. The tasks for this assignment were pretty easy if done correctly. The first thing I did was install SmartSVN on my machine. This is the program that does all the subversion work for us. It didn't take long before I got the hang of using SmartSVN on my machine. I used the "robocode-pmj-dacruzer" project to test SmartSVN.

After getting SmartSVN up and running on my machine, I then went ahead and created a new project in Google Project Hosting called "robocode-djl-dabeast." With the help of SmartSVN, I got my robocode system hosted in no time. I went ahead and tried to download the project anonymously in SmartSVN and ran ant -f verify.build.xml. The build was successful which means that everything is set up correctly.

I was able to accomplish all task except for one. An issue with Google that wouldn't allow us to add codesite-noreply@google.com as a member in our discussion list. The main purpose of this was to send out notifications whenever someone commits to the project. I filed the issue here and tried their fix but I'm still not able to generate an email after committing. I think this is the most difficult part of the assignment for me.

There is one important lesson I learned from this and that is to not "Update" my local directory when the repository is empty. I made this mistake in SmartSVN. I didn't commit the local project to the repository before I did the update and it resulted in an empty local directory.

Here are the links to my project and discussion pages:

Leave a message with your email if you want to contribute to this project :)

-David Joel Lazaro

Wednesday, October 7, 2009

Robocode: JUnit Testing

This homework assignment was about gaining experience writing our own JUnit test codes. I think the hardest and most frustrating part of this homework for me was getting our distribution directory to import and play nice with Eclipse. I spent the whole class time trying to setup my environment inside Eclipse. Once I got everything up and running the way I wanted, it was time to brainstorm on what I should test in my robocode.

My JUnit test cases consisted of two acceptance test and four behavioral test. For my acceptance tests, I tested whether DaBeast can win half the time against the sample robots Corners and Crazy. One of my behavioral test check whether DaBeast actually goes into one of the corners of the battlefield mainly the bottom left corner. The other test checked whether DaBeast travelled near the left wall by checking if it went to the bottom left corner and top left corner. Another behavioral test was to see if DaBeast rams its opponents. Lastly, I made a test to make sure that DaBeast's firing power is within range of what I set it to be.

The easiest test to create were obviously the acceptance test. All we needed to do was assert if we won the battles half the time. The behavioral tests were the difficult ones to create for me. I think it's because I wasn't familiar with the syntax of the snapshot interfaces that were built in robocode.

I'm not really 100% sure about the quality of my test cases. Two of the tests had bugs that I can't quite figure out how to fix. My bullet power test for example takes all the bullets in the battlefield at the end of each turn. This means that it also uses the bullets of the enemy robot for testing purposes. My robot only fires either to the power of two or three. For some reason, even if I was going against SittingDuck, I would see a bullet fired with the power of 1 which doesn't make sense to me. Another test that's flawed is when I check to see if DaBeast travels next to the left wall. It only checks whether DaBeast goes to the bottom and top left corners. DaBeast moves from the bottom left corner and goes straight up to the top left corner near the left wall. If anybody can help me fix that test then I'd really appreciate it.

When I ran Emma, it revealed that all of the methods of my test cases were executed. From my experience, it seems like having your code broken down into smaller pieces and testing each of those is the easiest way to test my robot. Click here to download the distribution of my system and see if you guys can implement my test cases in a much better way :).

-David Joel Lazaro