You have probably heard the Zune fiasco at the turn of the new year. Or if you have one with 30GB hard drive, you probably have experienced it yourself.The bug that caused the device to crash is actually quite embarrassing. As you can see in this post, the code coverage of the while loop is not 100% and thus when the day hits 366 the while condition will never be met, causing an infinite loop.

In fact this bug is quite obvious. But a bigger question is, what happened to the testing process? This function can and should be tested to ensure that it actually works! Clearly, this is a place where unit testing would have helped. Alas, it somehow passed through the eyes of peers and testers until the bomb went off…

Be Sociable, Share!