Serious development for serious Robocode competitions will require serious testing. While the competition is a whiles away, I will still need to individually test each behavior of my robot. To do this, I will have to perform something called "behavioral testing." Behavioral testing is the practice of testing individual features in a controlled environment using JUnit which is provided by Eclipse.
The art of behavioral testing itself isn't something that is picked up easily. The idea of choosing scenarios can have many different factors, most of which you will never think of because you do not have all the time in the world to think of them. Behavioral testing is still an important function within software development because it helps expose logic errors that would otherwise be missed. Logic errors being that they are technically correct, but the code does not perform the way you want. It is also a cheap and fast way to expose logic errors.
I designed my robot to be as reactive as possible instead of merely pointing and shooting. I chose to make my robot ram its targets as I want to gain as much points as possible. At the moment, when my robot finds a target, it will stay on that target and nothing else, hence it has tunnel vision. It does not have very good situational awareness. Lastly, I try to reserve the shooting as much as possible. When my robot scans a target, it does not immediately fire at it. Rather, it will ram the target and them fire. It will also return fire in the direction the bullet came from, which is problematic because it stops my robot from moving and resets the scanner. It will also fire at the target if it stays still too long.
So far, my robot has performed poorly against all the robots. Especially against wall robots. I am not proud of my robot. Here are the percentages of how often my robot wins against the samples:
Sitting Duck: 100%
Walls: 10%
Crazy: 40%
Spin: 30%
Corners: 50%
I learned a very important lesson doing this. Despite the fact that I could visually inspect how well my robot is doing, I could find out so much more faster when I can run multiple tests alongside each other with minimal time involved. The behavioral tests are an invaluable tool for finding bugs.
Thursday, October 20, 2011
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment