User talk:Ctalbert

From MozillaWiki
Jump to: navigation, search

Timezone Testing

In timezone testing, there are certain "safe" ranges for a zone and certain "unsafe" ranges for the zone. The safe ranges are those times during which the timezone calculation to UTC does not change the date. The unsafe ranges are those during which the timezone calculation to UTC does change the date. These unsafe ranges must be tested for all timezone conversion testing because you have a very good chance to find problems in those areas. For example, if you have a timezone that is offset -0600 hours from UTC (America/Chicago), then this is the range of safe and unsafe testing:

Unsafe and Safe Ranges for UTC-0600 Zone

0000 0100 0200 0300 0400 0500 0600 0700 0800 0900 1000 1100 1200 1300
<-------- unsafe --------------|<------- safe ---------------------->

1400 1500 1600 1700 1800 1900 2000 2100 2200 2300 0000 0100 0200
------ safe --------->|<--------------- unsafe ---------------->

So, you want to be sure that your timezone tests test times during "safe" portions of a given timezone as well as "unsafe" parts of given timezones. But, I tend to focus attention on the unsafe areas, since this is usually where bugs are found. bug 349788 was found because of a problem in timezone calculations that only occurred when working with a time that was in the "unsafe" part of the day.

So, for timezone testing in general there are three good guidelines to follow:

  1. Test unsafe ranges of various zones
  2. Be sure to test negative offset zones as well as positive offset zones
  3. Test zones with weird offsets America/St. Johns (UTC-0330) and Asia/Kathmandu (UTC+0545) are some of my favorites.

And you can't talk about testing timezones without talking about testing daylight savings time rollovers. For that:

  1. Test that zones go into/out of daylight time on the proper days.
  2. Test southern zones as well as northern zones (see below)
  3. Test converting between zones that have daylight and zones that do not have daylight especially near the dates of daylight savings rollovers.
  4. Be sure to test all of this with both non-recurring (most likely to work) and recurring (least likely to work) events.

Diagram of how Northern Timezones and Southern Timezone daylight savings time differs.

Northern zone looks like this;
J   F   M   A   M   J   J   A   S   O   N   D
            ^                       ^
         Dst Begins              Dst Ends

Southern zone is like this:
J   F   M   A   M   J   J   A   S   O   N   D
          ^                         ^
       Dst Ends                  Dst Begins