Wednesday 5 January 2011

Apple has problems again.

As someone who has worked extensively in high technology, I am well aware of how easy it is for bugs to creep into both the operating system and applications. That is why it is so important for testing to be at the heart of any software company.

So it is hardly a surprise that a bug has struck some Apple users when alarms on their iPhones failed to trigger. This is the latest in a series of bugs that have afflicted their alarm system.

Alarms are notoriously difficult to get right - what appears simple (just fire off an alarm at the appropriate moment) becomes infuriatingly complex when repeats, sleep, snooze, time zones, leap years, daylight saving, differing calenders, standby, user configuration, leap seconds (and more) are taken into account. However, it is far from rocket science.

Leap years alone seem almost impossible for some people to get right. From memory the rules are as follows:

  • If a year is divisible by 4 (e.g. 2004) then it is a leap year.
  • Unless it is divisible by 100 (e.g. 1900), in which case it is not.
  • Unless it is divisible by 400 (e.g. 2000), in which case it is.

Believe me, I've had to code this logic a fair few times! Yet even Sony got this wrong in their Playstation 3, where 2010 was marked as being a leap year. Microsoft and others have also had problems with this simple formula.

Even something as simple as alarms matter; people rely on alarms for a whole multitude of reasons. An alarm failing to go off can cause real problems. If something is coded, even if it is an extra, then it should be fit for purpose. I am amazed that a company the size of Apple has got this so wrong.

No comments: