in reply to Re^3: debug output from TODO with Test::More
in thread debug output from TODO with Test::More

"If you use SKIP instead of TODO, you won't automatically get the information about tests that start passing."

And there is ZERO value in that. :-) It is not about the tests passing or failing -- it is about why you are or are not running the tests. TODO is pointless, SKIP has the real value.

  • Comment on Re^4: debug output from TODO with Test::More

Replies are listed 'Best First'.
Re^5: debug output from TODO with Test::More
by 1nickt (Canon) on Jan 13, 2017 at 21:49 UTC

    And there is ZERO value in that.

    Sorry, you are quite wrong.

    TODO tests are an extremely valuable tool when you are dealing with volatile data. For example: you fetch data by querying an API, and you know it returns bad results under condition X. So you code a workaround for condition X, and you write a TODO test that you expect to fail. When the test begins to pass you get notification because of the TODO, and you remove the workaround for condition X.

    This is a common strategy. The fact that you aren't familiar with it is no reason to be dismissive of other people's experience.

    From the Test::More docs:

    • You don't skip tests which are failing because there's a bug in your program, or for which you don't yet have code written. For that you use TODO.


    • When do I use SKIP vs. TODO?

      If it's something the user might not be able to do, use SKIP. This includes optional modules that aren't installed, running under an OS that doesn't have some feature (like fork() or symlinks), or maybe you need an Internet connection and one isn't available.

      If it's something the programmer hasn't done yet, use TODO. This is for any code you haven't written yet, or bugs you have yet to fix, but want to put tests in your testing script (always a good idea).


    The way forward always starts with a minimal test.
      "TODO tests are an extremely valuable tool when you are dealing with volatile data."

      Hence why you mock the service and provide data that is not volatile.

      "If it's something the programmer hasn't done yet, use TODO."

      Nah, SKIP does that much better. But thanks for your opinion. Meanwhile, the real world calls ...

        Your ignorance may feel like bliss, but you are not even half as clever as you think you are. Mocking the service is the exact opposite of what is needed. You mock a service when you want to shield your test from the volatility of the data. I am running tests precisely to observe when the data changes. TODO is the right tool for that job, clueless though you may be about the job and the tool.


        The way forward always starts with a minimal test.