Randomized Testing

about | archive


[ 2007-December-24 17:29 ]

Power of Two Games just posted an article about randomized software testing. I'm glad they did, since I was planning to write about it, and they did a better job than I would have. I've found randomized testing to be extremely useful when validating software that has obvious correctness conditions. For example, I used it in my unit tests for my vam Emde Boas queue implementation. The test runs random operations on the queue and ensures that it matches a very simple queue implementation. I've also used it to test B-Trees and Paxos. Google also uses randomized testing to validate their Paxos implementation. The conclusion: While it might sound silly, random testing is a very powerful tool that programmers should keep in mind. Just make sure you use a known random seed so you have some way of repeating any problems the test may find.