On 10/17/19 5:54 PM, Tim.Bird@xxxxxxxx wrote:
-----Original Message-----
From: Iurii Zaikin
You can do all of this and allow users to supply another set of data.
It doesn't gave to be one or the other.
What is the use case for running a unit test on a different data set than
what it comes with?
I just gave some ideas in another message (our emails crossed),
but one use case is to allow someone besides the test author
to inject additional data points, and to do so without having to re-compile
the code.
Right. Test author might not think about all the possible ways to
test.
They might do this for multiple reasons:
- to experiment with additional data points
- to try to diagnose a problem they are seeing
- to fill gaps they see in existing data points
Thanks for explaining the scenarios.
Whether this makes sense depends on a lot of factors. I suspect
the timestamp test code is not a good candidate for this, as the code
is simple enough that adding a new test case is pretty trivial. For some
other types of tests, adding the data via an external file could be easier
than changing the code of the test.
I agree. Even if author thinks of all the different ways (I am convinced
of that), still taking test data at run-time makes the unit test just
more effective.
thanks,
-- Shuah