Monday, January 3, 2011

Lessons from the iPhone’s Era-Switching Failure

The iPhone had a Year 2000-like moment over the weekend, as some iPhone alarms didn’t go off.

From published reports, the problem related to alarms set in 2010 to go off on a single occasion in 2011, but it is more obscure than this. The iPhone’s alarm clock failed to sound only if the phone was relatively idle in the interim.

Based on the description, it is a file system era-related problem, similar to the famous Year 2000 problem. In the Year 2000 problem, a whole generation of software written to use 2-digit years failed, either when they ran out of two-digit year numbers or when the numbers didn’t go in sequence as expected. An “era,” in computer software, is any period of time that has a sequential calendar. Changing an era in a computer program is like changing the calendar on your wall.

I am hard pressed to guess what the era-related problem on the iPhone might have been, or indeed, to explain why January 1, 2011, should be a new era in any software. That is nevertheless what happened, and the era-switching code included in the iOS file system wasn’t as automatic as we would want it to be. It was activated, apparently, only when certain user actions took place, such as launching or closing an application or saving a file.

If this glitch went undetected in early testing, it is partly because software testing in recent years has put most of its emphasis on the complex sequences of events that trigger most of the bugs that remain in our software. The objective is to find what sequence of button-pressing will make something go wrong. The iOS era-switching glitch, though, popped up only when people were not pressing buttons. Based on the little that Apple has said about the problem, it is occurring today mainly in iPhones that were idle (on, but not being used) all weekend. If you’re a software tester, and your plan is to let the computer do nothing at all for three days to see if that creates an error, your boss is probably going to tell you to get back to work.

The fact that iPhone alarms that didn’t go off created such a stir tells you how quickly people are abandoning single-purpose devices such as alarm clocks to rely instead on general-purpose devices such as mobile telephones. This doesn’t fit the traditional idea of marketing consumer electronics, since the dedicated alarm clock (or calculator, compass, etc.) costs a small fraction of the price of an iPhone. But people are trying to simplify their lives by using fewer gadgets.