Generally I avoid in tests.

I like to test a particular known state. I like to test by example. I like to have tests that are very easy re-runnable and produce the same result every time (deterministic). Thus when app codes that uses it breaks we can fix the app code and the test returns to green.

So for these reasons I nearly always avoid randomness in the data that I test with, even if (not your case) the app has randomness.

I use the basic cases, e.g. for a 5 digit number I always consider having tests for 5 numbers(valid), < 00001, > 99999, alphabetic, blank. Assuming that all the numbers between 00001 and 99999 have the same rules I only test one of them.

I’m ok with only having 4 ways to head bang against the wall and I want to make sure the result (headache) is the same for each of them, every time I supply the same data.

Source link


Please enter your comment!
Please enter your name here