Diffusion Testing

In the March 2011 issue of MSDN Magazine I describe a testing technique I call diffusion testing. See http://msdn.microsoft.com/en-us/magazine/gg650663.aspx. Diffusion testing is a technique where you can automatically create new test cases from existing test cases. In the screenshot below I am testing a function Choose(n,k) which returns the number of ways to select k items from n items where order does not matter. In my simplified example, I have three existing test cases. The first test case has inputs n = 8 and k = 3, and an expected result of 56. After my test harness executed the first test case, which yielded a pass result, I used diffusion testing to automatically generate a new test case with inputs n = 9, k = 3, and an expected result of 84. Next the test harness executed test case 002 but because test case 002 yielded a fail result, I did not generate a new diffused test case. Manually generating test case data takes a huge amount of time. This is called the test oracle problem. The motivation behind diffusion testing is that if you can somehow automatically generate new test case data you will sidestep a time-consuming and error-prone part of the testing process, and be able to test your software system more thoroughly. As my article explains, diffusion testing is not applicable in all testing scenarios but when diffusion testing is feasible, it can be a very powerful technique.

This entry was posted in Software Test Automation. Bookmark the permalink.