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.