The Poker Copilot Blog

Tracking the development of Poker Copilot, Mac OS X software for poker analysis and statistics.

Wednesday, 11 February 2009

Poker Copilot, Bugs, and Unit Tests

Occasionally you'll find that Poker Copilot doesn't handle a particular type of tournament. Or reports that you didn't try to steal the blinds when you are sure you did. Or chokes on an unusual hand.

Let's call a spade a spade. Sometimes people find, ahem, bugs in Poker Copilot. There, I said it. I admit it. My code is not perfect. My testing is not perfect.

What I love is when the person who finds the, ah, bug sends me the hand history that caused the issue. Because I've got a good process for using that hand history to eradicate the bug forever.

First I create a unit test - a type of automatic test - that sends the hand history into Poker Copilot, and makes sure the resulting calculations are correct. Except that they aren't. So the test fails.

Then I fix the problem.

Now I run the unit test again. Problem solved? Good.

The final step is to run all the unit tests, to make sure I didn't break something else. For example, when I get things working for a 6-max turbo table, I might have broken things for a normal 6-max table.

I've now got about 100 of these tests.

5 comments:

Anonymous said...

How long does it take to run through these tests?

Mike Wilson said...

Hi Steve,

I've been following your CoPilot articles since they started, well done, seems to have come a long way in such a short time.

What are you using for your unit tests? NUnit, or something else?

Quentin said...

Hi,

It seems to be a pretty good maneer to eradicate bugs.

Regards,
Quenitn

Steve McLeod said...

The entire set of tests run within a couple of seconds. That's because the hand history parser is blindingly fast.

I'm using JUnit 4 for unit tests.

UK Poker Putz said...

Question: Have you thought about making poker copilot open source? I'm sure there would be some interest in that...

 

Poker Copilot

Free 30 Day Trial

Only $69

Order risk free with our 30-day money back guarantee.

  • Poker software for Mac OS X
  • Supports Full Tilt Poker and PokerStars
  • Analyses your opponents while you play
  • On-table HUD for Mac
  • Easy to use, easy to understand

Watch a demo of the major features of Poker Copilot