James Watson
Posts: 2024
Nickname: watson
Registered: Sep, 2005
|
|
Re: What are Your JUnit Pain Points, Really?
|
Posted: Nov 11, 2009 1:27 PM
|
|
> > "If all you have is functional tests, the bug that > > causes that test to fail might be deep under layers of > > code. > > > > If > > you have unit tests, these unit tests will fail earlier > > than functional tests and therefore, you will identify > > the faulty code faster." > > That's true, but how much of a problem it is in practice? > You make a change, run the functional tests, they fail - > the problem must be in your latest change, no?
My take is that, unit test do often make it easier to find and fix issues. They don't prove that a system works, however. IMO, this makes them optional. Functional tests are not optional.
The question then becomes: if we are going to have comprehensive functional testing, does the benefit of creating unit tests outweigh the cost? I think the answer depends on what you are doing. The more the code is reused, the more value unit tests have.
|
|