Simple question, what's more common / standard / won't make future developers look at me cross-eyed for unit testing:
Displaying just the errors, or reporting every passed test?
|
Simple question, what's more common / standard / won't make future developers look at me cross-eyed for unit testing: Displaying just the errors, or reporting every passed test? |
|||||||||||||
|
|
I would say that showing every test and its pass/fail/skipped status is the best, because it gives positive feedback that each test was successfully run or purposefully skipped. However, if you are building your own tools, I recommend giving the user an option to choose what they want to see. |
|||
|
|
|
If you're using a unit testing framework:
If you're building a unit testing framework:
|
|||
|
|
|
Depends what you want to see. It's always nice to have at least the option of seeing all the results (as in, a complete list of all tests that have been run, and their status), and if you run the tests as a developer, you are probably also interested in error details for the failed ones. You do want a way to boil it all down to one single exit status though: either everything passes (which means global pass) or one or more tests do not pass (which means global failure). This is especially important if you want to hook your test suite into a Continuous Integration framework or similar automated checking mechanism. So, long story short: If you can, make it configurable. Most off-the-shelf solutions have this option, and if you're rolling your own, it's not hard to do either. |
|||
|
|