Functional tests are useful for regression testing, to make sure that nothing obvious is broken by a new revision. It automates part of a human tester's job. It provides management with a go/no-go quality gauge. Test scripts and human manual testing can substitute for automated functional tests.
Unit tests, in contrast, are for the developers to help them build quality into the product -- by identifying the source of quality problems, and by exercising the code more completely than could ever be accomplished by functional tests. Also, the requirement of unit testing provides an incentive for quality programming, as good code is much easier than crappy code to unit-test.
If you have to choose between functional testing (whether automated or manual) versus unit testing, then you probably lack the resources needed to successfully complete your project.
> I think the first error is in assuming that "Unit or > Functional Tests?" is a sensible question in the first > place. To me, it's like asking, "Does my car need a gas > pedal or a steering wheel?" The two are techniques > intended to solve completely different problems.
I disagree that they attempt to solve completely different problems. They both attempt to insure the proper operation of an application.
Unit tests may uncover problems in a unit that a particular application using that unit would never encounter which might become important if code is reused in another application that stimulates the unit differently, but in the end the proper behavior of applications is all that matters.
Both are needed aren't they? I will typically create a note above functional tests with the exact phrase from the corresponding document "Be able to...". The black-boxness of it is a nice complement to the unit test which are necessary because as a developer/engineer/architect etc you've chosen an object design that doesn't exactly mimic the requirements.
Only with a level of both do I really feel comfortable refactoring...
I am strong believer of delivering a comprehensive functional/integration testing is far far more important simply try to deliver 100% unit testing code coverage, as it will help us to detect business error ASAP, and provide us meaningful code coverage.
At the end, I believe both unit and functional testing is important, but if time is limited, and developer resources is a concern, I will rather spend time to deliver a good functional testing.
Flat View: This topic has 18 replies
on 2 pages
[
«
|
12
]