19 December, 2009

Easter Eggs in Software

Easter eggs are specially decorated eggs given to celebrate the Easter holiday. These eggs are often hidden, allegedly by the Easter Bunny, for children to find on Easter morning as per Wikipedia.

Easter Eggs in software refer to hidden features in the program that are intentionally injected into the product by the programmer. These may include hidden commands, animations, funny jokes, games, credits for programmers who built the product etc. The programmers of easter eggs do it for their own personal reasons or for entertainment and are not meant to be harmful. If the programmer intentionally added malicious code to behave as a virus/spam/trojan, it may not be an easter egg. However, if the programmer added some code to behave as an easter egg that accidentally turned out to be harmful, it is still an easter egg.

How to unearth easter eggs?
Programmers Names
Search for the names of programmers who built the product. These are a very common form of easter eggs. These references mean that a few programmers wanted to take credit for the work done by them and inserted their names into the code without the knowledge of the management. More often, programmers resort to this method due to lack of appreciation for their work by the management.

Guidewords
Looking for swear words or expletives helps discover easter eggs. Dissatisfied/disgruntled/quitting employees may add these words in the code to take revenge on people they disliked or hated. I once saw a line reading ‘Thomas is a fool’ as part of a code snippet in one of the products that I tested a few years ago (No offense to Thomas here!).

Personalized images/animations
A few programmers embed their favorite images or animation in the code as they find themselves emotionally bound to the images/animations as much as the code that was written. For eg, a programmer might include icon images to include one of his favorite picture or a scenery.

Magical Keystrokes
A few easter eggs can be found by pressing a magical key combination/shortcut keys on the keyboard. These may be discovered accidentally or based on the knowledge of similar easter eggs in previous versions of the product.

Clusters of Easter Eggs
If an easter egg of any one type as described above was found, there is a high possibility of many more being found in close proximity to the already found egg. Pattern matching with previously found easter eggs helps find a few more surrounding them.

Read the code
Reading the code completely is one of the ways of looking for any unusual code that does not fall in line with the actual code in the product. Any code that is not in sync with the rest of the code may be easter eggs.

Ask the programmers
One of the fastest ways of finding most easter eggs is to ask the programmers themselves about what kind of easter eggs have been injected into the code. Not all programmers would reveal about all the easter eggs. A few of them might reveal theirs, but may not know about other programmers easter eggs. Some of them might be tightlipped to talk about easter eggs for fear of being fired or disciplined by the management.

Easter eggs by definition cause no harm by hiding inside the product. However, If the customers find easter eggs in the production environment, it could raise doubts about the kind of testing done on the product by the testers. The companies become liable for any offensive or illegal content that is shipped in the product and may face legal consequences. It is therefore very important to test for easter eggs as part of the normal testing process to avoid embarrassing situations after the product is shipped to the customer.

Start looking for Easter Eggs – in your software,

Happy Testing,
Parimala Shankaraiah

7 comments:

Netra said...

Very interesting post :)I'm getting creative to add some easter eggs ;) ;)

BTW, very nice profile pic :)

Manjunath said...

Coool.... this is the first time i came across the term let me use some easter eggs in my upcoming projects :)

Markus Gärtner said...

We added some easter eggs in our automated tests. Since most of them rely on the date they're executed on, we felt the temptation to run the tests on the 4th of May after seeing a German video where George Lucas was translated wrongly when stating "May the force be with you." with the english equivalent "May the forth be with you." Since that day most of our tests appear to run on the 4th of May with varying years.

Pari said...

@Netra
Thank you :-)

@Manjunath
Some organizations reprimand the programmers for adding easter eggs. Look for some easter eggs from Microsoft. You will find some cool stuff.

@Markus
Glad to know you read my blog. I respect your writings a lot.

Good to know about a real time Easter Egg.

Regards,
Parimala Shankaraiah

software testing consulting said...

I had no idea that programmers would do that. I bet a lot of these are private jokes, but I'll start looking at programs differently now, though many of them are probably in the code- where there's no way for me to notice them. :)

Parimala Shankaraiah said...

@Software Testing Consultant
Good to know that this post made you think different.

Regards,
Parimala Shankaraiah

Gaurav Pandey said...

Very informative post.

I disagree with the following -

Easter eggs by definition cause no harm by hiding inside the product. However, If the customers find easter eggs in the production environment, it could raise doubts about the kind of testing done on the product by the testers. The companies become liable for any offensive or illegal content that is shipped in the product and may face legal consequences. It is therefore very important to test for easter eggs as part of the normal testing process to avoid embarrassing situations after the product is shipped to the customer.

At this point, we must consider factors like security, malware etc. (Trusted computing as a big initiative in this aspect)

Finding them is very difficult by someone who is testing (during execution of code) - Dynamic Testing.

At this point, we must look more closely to constructive QA (dev, using concepts like code inspection, configuration management changes etc)

Regards
Gaurav Pandey