CS 477 Lecture Notes
Week Fourteen, Thursday: Project Demonstrations
Demonstration Agenda
TBD
Year 2000 Problem
Even though Y2K came without many problems (because of the efforts through the
preceeding years), Y2K problem fixes are still relevant now: many new bugs may appear
in the future as a result of fixes incorporated in the last few years. Software
engineers should be conversant with some of the approaches to the Y2K "bugs" that
might have been implemented.
Portions of this lecture are excerpted from Dr. Dobb's Journal, May, 1998.
Fair use for educational purposes.
The Y2KP is sometimes erroneously called the "millenium bug:" The third millenium won't
begin until January 1, 2001. Many problems will occur before year 2000. GPS receivers
with their 13-bit epoch field in PROM will fail on August 22, 1999.
Bob Bemer: "Everybody blames the programmers,
but it wasn't their fault. It was people [like managers, customers]. They were happy they
didn't have to use 19s." (Quoted from "Programming Paradigms," by Michael Swaine,
Dr. Dobb's Journal, May, 1998. Bob Bemer invented
ASCII, data typing, named COBOL, and was a pioneer in word processing and time sharing.)
Y2KP Management
The first thing a company must do is assess the magnitude of the problem. Any business
that hasn't already started this is poorly managed and deserves to go under in 2000.
It could be really interesting to obtain a list of these companies and sell their stock
short. Here's the management process:
- Formulate a list of software programs that are mission critical.
- Use scanning software on the source code (if it's available) of the
mission critical programs to determine which ones have a Y2KP.
- Focus efforts on repairing those mission critical programs.
Repair Approaches
Regardless of whether we call it corrective, adaptive, or perfective maintenance,
the faults must be identified and repaired. The problems are of two types: programs
and data.
Date Expansion
The preferred method, given sufficient time: go from MMDDYY date representation to MMDDYYYY.
Advantages:
- It lasts forever.
- A 4-digit year is a natural representation (easy to understand and maintain).
Drawbacks:
- It must be implemented consistently everywhere dates are used or declared (source
code, scripts, JCL, databases, computer-to-computer interfaces, user interfaces, etc.
- It uses more storage space than the 2-digit year format.
In practice, date expansion requires that you find and alter all declarations, output and
input statements, calculations, and function calls. All existing data files with dates must
be converted.
Windowing
Windowing is a logic solution. Dates are translated on-the-fly. Humans do this easily
and naturally. There are two types of windowing, fixed and sliding. Sliding windows move
as the current date changes (the fix lasts longer).
Advantages:
- Quicker to implement with fewer code changes.
- Avoids the need for extra data storage space.
Drawbacks:
- Usable time span is no more than one century.
- Creates additional testing challenges.
- Future maintenance may become more difficult.
Date Compression
The Y2KP is really a storage overflow problem. Date "compression" simply uses a more
concise date representation.
Advantages:
- Lasts a very long time.
- Does not require additional storage space.
- Requires no more source code changes than expansion yet can store more information.
- Unlike windowing, it requires no function calls (except for human-readable output).
Compression works well when:
- An application is built for the long term.
- There is adequate time to implement.
- Storage space concerns have some weight in design decisions.
The CYYDDD Format: C is the number of centuries since 1900 and YY is the
number of years in the century. DDD is the day-count in the year.
The DDDDDD Format: Count the number of days since a certain date.
The MMDD 16-bit Year Format: Replace the YY field with a bit register (two 8-bit bytes).
16 bits stores 65,535 years.
The 48-bit Date Format: Count the number of days since a given date and store
in a 48-bit register. It holds billions of years.
See
DDJ
for algorithms for date conversions.
This page established April 13, 1998; last updated January 17, 2000.