15
https
2y

Writing a Unit test to test the Unit test that's testing your application, because you can never be sure about anything.

Comments
  • 0
    🤡🚿
  • 3
    Honestly: You definitely _should_ test your unit test framework. It is code too.

    But testing tests is a smidge too fractal for me...
  • 4
    What you're referring to is Mutation Testing, which exists.

    It aims to test whether your tests fail in case code were to change. For example, your mutation test framework changes some code like an operator and then runs your tests again to see if any of them fail
  • 0
    Ehm... Yeah....

    Sure.

    Who watches the Watchmen?
  • 0
    @superidiot Like you can build code which outputs itself, you actually also can build a circular chain of tests. It is very tedious and probably won't find any additional bugs.

    But if you happen to need to design a society, there are well-tested real-world implementations for incentives that make a population implement self-orgnaized hierarchy-agnostic mutual observation. They mostly are used by dictators to ensure early denunciation of threats to their power. But less extreme variants can (for an example) make tax avoidance or other forms of corruption really risky in a faux-democracy too. It should work even better in a real democracy, but such a thing never existed and therefore none of the design patterns has ever been tested in one.
  • 0
    @superidiot Don't know - looks like they want to sell "consulting".
Add Comment