Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Hello dear fellow programmers,

Did it ever happen to you after watching a movie to start wondering what would be a Perfect Crime?

Every once in a while we may hear about some angry programmer who left a company or was fired, and did or wanted to leave something broken or some time bomb behind him. Though nowadays with broad use of versioning, not only would it be easy to fix such a misfeature, but it would also be trivial to figure out who committed it.

Or would it?

We all have at least once faced a tough bug, occurring for tricky reasons or as a consequence of an unlikely situation.

As an example I remember once encountering a bug in some Lua code (which is dynamically typed), where some function returned a string coming from some service. If I recall correct, somewhere else in the code, the string would be used as a key for a dictionary. And when for some reason the service failed, in the function that used the string as a key it evaluated it as an integer and things broke up.

When I hit such a bug, I can not but think that if it were done on purpose, it would be pretty clever.

So here is the "It's not a bug, it a feature" question: if you were to purposely design a bug in a versioned project, what would you come up with? The goal is obviously to design a tricky one, and difficult to relate to its author (or at least it should look like a true mistake).

As a side note, this is a sensible question, and I understand you may have concerns regarding it. But from a theoretical point of view, I think it is both interesting and challenging. Oh, and I have no problem with my company. ;-)

On a similar topic: What is the hardest bug to find?

share|improve this question
3  
I think you'd have to spread it across multiple commits. For example, some weird behavior that arises only when different modules interact in a very specific way. – Maxpm Apr 3 '11 at 5:17
2  
See also How To Deliberately Hide Bugs In Code – Peter Taylor Apr 3 '11 at 5:50

1 Answer

up vote 5 down vote accepted

http://underhanded.xcott.com/ has addressed this very problem, and it is scary how clever some of the solutions have been.

share|improve this answer
1  
Thank you for the link!Haha, I cannot believe it: right in the first page the #3 winner is Linus Akesson AKA lft, who made the jaw dropping Craft intro. – Julien Guertault Apr 3 '11 at 5:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.