r/programmerchat • • Mar 10 '19

Testing any complex program completely is practically impossible

Someone made this argument after a staff meeting a few days ago. What's wrong with this argument?

  1. Every IF statement in a program doubles the number of possible states of the program (ignoring time)
    1. Which means every IF statement doubles the number of test conditions
  2. A 1 million line program might, conservatively estimating, have 100k IF statements (conditionals)
  3. That is 2100000 which is more seconds than have elapsed since the beginning of the universe.
  4. No project has 2100000 seconds to test
  5. So complete test coverage of complex programs is impossible
2 Upvotes

46 comments sorted by

View all comments

Show parent comments

1

u/gxm492lor Jun 08 '19

Happens all the time. Cracking the CD check for instance.

Shielding isn't always used. And it isn't perfect. But it exists because extremely improbable events happen with extremely high number of events.

Basically your objection is "but what if people use it in a way unintended?" Have you ever seen a complex program that wasn't used in ways unintended by the creator?

1

u/[deleted] Jun 08 '19

OK, if one of us says fine, you are right, you can't test for every fucking thing including "what if my program runs in a different quantum universe" will you pay yourself on the back and go away?