Do you write common pre-conditions for a large number of unit test cases ?
Posted
by
Vinoth Kumar
on Programmers
See other posts from Programmers
or by Vinoth Kumar
Published on 2011-03-04T11:57:32Z
Indexed on
2011/03/04
15:33 UTC
Read the original article
Hit count: 357
unit-testing
I have heard/read writing common pre-conditions for a large number of test cases is a bad thing, since this dependency may cause large number of test cases to fail if something changes . What are your thoughts on it ?
If this is so , then what exactly is the purpose of setUp() method in Junit that runs before each test case ? If the same code inside setUp() runs before each test case , why cant it run only once before running all the test cases together ?
© Programmers or respective owner