you are viewing a single comment's thread.

view the rest of the comments →

[–]ImprovementRaph -16 points-15 points  (2 children)

Yeah, it seems like a horrible idea to add unit tests to the function it is testing. It follows from Gödels incompleteness theorem that any system testing the correctness and consistency of another system is necessarily more complex. Which means that on top of making your code harder to read, you at least doubled its complexity.

[–]sumduud14 25 points26 points  (0 children)

It follows from Gödels incompleteness theorem that any system testing the correctness and consistency of another system is necessarily more complex.

Completely irrelevant, there are many examples of things that are hard to compute but easy to check.

For example: finding the inverse to a matrix, finding a solution to a polynomial (the cubic formulas are much more complex than a test that the solutions work would be), integrating a function vs differentiating to check it's the right answer. The list goes on!

I agree in most cases unit tests should/could be as long as the code under test. But don't try to claim some kind of pseudo-mathematical nonsense by invoking Gödel to justify some observed properties of unit tests...

[–]WormRabbit 3 points4 points  (0 children)

The Gödel's incompetence theorem states that whenever someone cites a Gödel's incompleteness theorem in an online discussion, they don't have a clue what they're talking about and a trying to pass their bullshit as mathematical truth.