- Elephant in Cairo
An elephant in Cairo is a term used in
computer programming to describe a piece of test data that is designed to ensure that an algorithm is working. The term derives from a humorous essay circulated on the Internet and published in "Byte" magazine in September 1989 that described how various professions would go about hunting elephants, with programmers following the algorithm::# Go to
Africa .:# Start at theCape of Good Hope .:# Work northward in an orderly manner, traversing the continent alternately east and west until you get to Cairo,:# During each traverse pass,:#:* Catch each animal seen.:#:* Compare each animal caught to a known elephant.:#:* Stop when a match is detected.:Experienced programmers modify Algorithm A by placing a known elephant in
Cairo to ensure that the algorithm will terminate.:# Go toAfrica .:# Put an elephant in Cairo.:# Start at theCape of Good Hope .:# Work northward in an orderly manner, traversing the continent alternately east and west until an elephant is found,:# During each traverse pass,:#:* Catch each animal seen.:#:* Compare each animal caught to the elephant in Cairo.:# If the elephant is in Cairo, you put it there.This simplifies the algorithm a little. It dates back to the 1970s.
References
Olsen, Peter C. (1989) "Pachydermic Personnel Prediction", Byte Magazine, "Stop Bit" column, September 1989.
ee also
*
Elephant test External links
* [http://www-users.cs.york.ac.uk/susan/joke/elephant.htm Transcript] of Stop Bit,
Byte magazine , September 1989, p.404
* [http://www.cl.cam.ac.uk/~fms27/door/elephant.pdf List of the other elephant hunting techniques] (PDF)
Wikimedia Foundation. 2010.