Using Redundancies to Find Errors 338
gsbarnes writes "Two Stanford researchers (Dawson Engler and Yichen Xie) have written a paper (pdf) showing that seemingly harmless redundant code is frequently a sign of not so harmless errors. Examples of redundant code: assigning a variable to itself, or dead code (code that is never reached). Some of their examples are obvious errors, some of them subtle. All are taken from a version of the Linux kernel (presumably they have already reported the bugs they found). Two interesting lessons: Apparently harmless mistakes often indicate serious troubles, so run lint and pay attention to its output. Also, in addition to its obvious practical uses, Linux provides a huge open codebase useful for researchers investigating questions about software engineering."
Errors like... (Score:3, Funny)
Patience! (Score:5, Funny)
Perhaps it's just shy!
And their other findings ... (Score:5, Funny)
Russian errors cause code
Incorrect code causes errors
Missing code causes errors
Untested code causes errors
Redundant codec causes redundancies
Driver code causes headaches
C code causes buffer overflows
Java code causes exceptions
Perl code causes illiteracy
Solaris code causes rashes
Novell code causes panic attacks
Slashdot code causes multiple reposts
Slashdot articles cause poor-quality posts
Microsoft code causes exploits
Apple code causes user cults
Uncommented code causes code rage
RIAA code causes computers to stop functioning
(Poor idea causes long, desperate post)
IN SOVIET RUSSIA... (Score:0, Funny)
Most prevalent source of redundant code.... (Score:2, Funny)
Now, if you'll excuse me, I've got to get back to my text editor project.
Finding errors in your code (Score:3, Funny)
Well, at least that's how I finish all my projects.
A good editor... (Score:4, Funny)
Intentional redundant code (Score:5, Funny)
x += 0;
x += 0;
x += 0;
x += 0;
x += 0;
x += 0;
It actually caused a bug 'cuz they accidentally left the '+' off one of the lines. What an idiot.
Redundancy? (Score:3, Funny)
Re:redundant? (Score:1, Funny)
Now, i'm off to create a new form of steel that will revolutionize the railroad industry!
PDF usually crashes my computer (Score:1, Funny)
Re:lint is horrible (Score:1, Funny)
Re:Using redundant code to find errors (Score:3, Funny)
vi! (Score:4, Funny)
Re:Patience! (Score:3, Funny)
It's not dead - it is resting. It is pining for the fjords.
Even the smallest program... (Score:2, Funny)
Re:How to Avoid Mistakes? Practical Advice? (Score:2, Funny)
Re:Error checking compilers (Score:1, Funny)
Silence! We will not tolerate such subversive thoughts here.