Aug 18

This programmer discovered the hard way the importance of testing:

in 1998, i made a C++ program to calculate pi to a billion digits. i coded it on my laptop (pentium 2 i think) and then ran the program. the next day i got a new laptop but decided to keep the program running. it’s been over seven years now since i ran it. and this morning it finished calculating. the output: "THE VALUE OF PI TO THE BILLIONTH DIGIT IS = "

mindblowing eh? i looked in the code of my program, and i found out that i forgot to output the value :(.

Comment: true story, i fixed the code and am running it again.  (Source)

This cautionary tale reminds me of a certain fictional computer that worked for 7-1/2 million years to calculate the meaning of life, only to output the number 42:

"I think the problem is that the question was too broadly based…"

"Forty two?!" yelled Loonquawl. "Is that all you’ve got to show for seven and a half million years’ work?"

"I checked it very thoroughly," said the computer, "and that quite definitely is the answer. I think the problem, to be quite honest with you, is that you’ve never actually known what the question is."  (Source)

Share and Enjoy:
  • Twitter
  • Facebook
  • Reddit
  • LinkedIn
  • Digg
  • DotNetKicks
  • StumbleUpon
  • Slashdot
  • Technorati
  • Google Bookmarks
  • Print
  • email

Article published on August 18, 2008




6 Responses to “The Answer is 42, aka The Importance of Testing”

  1. The Answer is 42, aka The Importance of Testing | One Path Says:

    […] The Answer is 42, aka The Importance of Testing wwe summerslam 2008 […]

  2. Living Monstrance » The Answer is 42, aka The Importance of Testing Says:

    […] The Answer is 42, aka The Importance of Testing wwe summerslam 2008 […]

  3. The Answer is 42, aka The Importance of Testing at Clinging to the Barque of Peter Says:

    […] The Answer is 42, aka The Importance of Testing wwe summerslam 2008 […]

  4. Happy Mamma » Blog Archive » The Answer is 42, aka The Importance of Testing Says:

    […] The Answer is 42, aka The Importance of Testing wwe summerslam 2008 […]

  5. Matt Langley Says:

    Gutted!

    As a fellow developer I can’t think of anything worse that does not involve someone dying.

    Don’t forget to turn off automatic update on your new computer, or you might never get to the end of the calculation (it seems to reboot your PC terminating all processes if Microsoft determine an update important enough). Of course, you should get your answer a lot quicker this time if you run it on your new old laptop, as I should imagine it is at least twice as fast.

    Would love to know the answer, btw. Hope it’s not a circular reference…

  6. Maurice Says:

    The importance of testing? What if you hadn’t injected the fault in the first place? I’ve written a post that explores “Is more testing the answer?” Find it here http://mauriceonsoftware.blogspot.com

Leave a Reply