Specificity is almost always a good thing.
But sometimes when unit testing, I need to pass dummy values to functions just to make the compiler happy.
I don’t care what the values are, but using specific literals can obscure the intent of the tests:
This test checks that the number of things on a stack is correct after pushing some strings onto it.
Somebody coming across this test may have a few questions: is it important that these particular values are pushed? Is the duplication of
In fact, it doesn’t matter what is pushed onto the stack, so this test shouldn’t introduce any doubt in the mind of the reader.