Monday, October 24, 2011

5 RedBulls = 1 Midterm coming up!

So another midterm is coming up and this is gonna be a really hard one, I guess.
Below is my 5 study guide questions:

1. What are the 6 steps for an Inspection review to be formal?
Planning - Orientation - Preparation - Review Meeting - Rework - Verify.

2. What are the three "classical" problems that might occur during a configuration management?
The double maintenance problem - The shared data problem - The simulataneous update problem.

3. If we set the return value to 1 when we override the hashCode () method, does java complains about it? Is it a good coding or bad coding?
Java will not complain about it, but it is really a bad coding. Because every different objects must have a different hashcode value. However, all the objects will recieve a hashCode value of 1. 

4. What is another build tool that was talked in class, apart from Ant? Give a brief description of it. 
The other tool is Make, which is widely popular than Ant. It can support any kind of programming language. However, its syntax is more complex than Ant, which require a lot of use of the TAB character. 
It is Unix-based.

5.  What are some strengths and weaknesses when doing Manual Quality Assurance?
Strengths: Find defects involving requirements - Low false positive rate.
Weaknesses: Redone for all projects - Difficult approach for low-level implementation defects.

Good Luck to everyone on the midterm!

Friday, October 21, 2011

Cloudy Management for Coding

After a tedious coding for my Robocode that took me days, I had learnt another tools called "Software Configuration Management" and "Project Hosting". Well, if you are a sole developer then you should skip this post. However, take in account that every software project to be successful has to be done in groups and the tool I have mentioned will make life easier for project management.

For this project, I used the "Google Project Housing" and the "TortoiseSVN". Subversions, like TortoiseSVN, helps to maintain current or old versions of coding files, web pages or documentation. It was my first time using some kind of Subversion to manage my Robocode project. It was pretty straightforward in which you can commit changes easily to the whole project at once instead going one file by file. I haven't explored any deeper the TortoiseSVN to check for any available features, but so far I haven't ran into any problems.

Google Project Hosting is like your cloudy place to share your project with any other person out there. I like cloudy stuff, but so far I think there are some flaws in this Project Hosting. First, its wikis markup can be annoying. It is just some minor things, but I think I am more comfortable using HTML. Then, there is the problem when you checked out the project, and committed some changes, there might be another person who did some changes already and uploaded to the Project Hosting. Then the files might be out of sync.

Overall, I think I found SVN as a useful tool for software development that will  help me a lot. Google Project Hosting is nicely formatted to do coding project management, but still there are some flaws, and some improvements need to be done.

Google Project Hosting - SnooPSan's Robocode http://code.google.com/p/robocode-cla-snoopsan/.

Tuesday, October 11, 2011

Now into a serious Robocode

Here I am with a new Robocode blog entry.

Having a general idea on how Robocode works by doing the katas, now I am facing with a extremely difficult task: Create a robot that can defeat some of the sample robots. I had put it some time and effort, but from lack of time, my robot is able to defeat 100% 5 out of the 8 samples (SittingDuck, Walls, RamFire, SpinBot, Crazy, Fire, Corners, and Tracker).

Design.
My robot basic movement is a very newbie dodging bullets which I tried to implement by myself. It takes in account the energy of the enemy robot. So if its energy drops by 0.1 or 3, then it is high a chance that it fired a bullet. My robot will then try to dodge it. Sounds good right? But I never take in account that if I hit my enemy, his energy will also drop. Or when my enemy hits a wall or ram onto me.
My targeting was an upgrade of the robocode katas "Boom04" which 95% of the time, my robot will point its gun to my enemy.
My firing also takes in account the robocode katas "Boom03" which the power of the fire is proportional to the distance of the enemy. The farther the enemy is, the stronger the firepower. Also I realized that if my robot is most of the time pointing its gun to the enemy, why not fire a bullet with stronger power? So if my robot's gun faces directly to its enemy, then it will fire a bullet with power of 2.



Results.
Out of 10 rounds this are my results.
SittingDuck : 100%.
Walls: 100%.
RamFire: 50%.
SpinBot: 0%.
Crazy: 0%.
Fire: 100%.
Corners: 100%.
Tracker: 100%.

My robot has a flaw: it fires linearly. Also my dodging bullets is not the best.

Testing.
Due to time constraint, I did some unit test of some helper methods I created. I tested them using some "obvious" inputs to correctly output the expected value. All tests passed.
I also did a behavioral test in which I test whether my robot should fire or not. My robot will fire only if it is directly pointing to the enemy, or its gunHeat is 0. So for each turn, I verify its angle and gunHeat, which 100% of time my robot fires as expected.

Lessons.
I think my code looks "beautiful" thanks to the automated quality assurance I had. I learned how hard is to keep up with the coding standards in Java. For every tiny error you had in your code, the xml files will not let you to build successfully. Also the testing part I find that it will save a lot of time. I didnt have to run every time the robocode application to see if my robot behave as I expected. I just need to write test cases that will run immediately.