The Artima Developer Community
Sponsored Link

Java Community News
Unit or Functional Tests?

18 replies on 2 pages. Most recent reply: May 23, 2007 1:51 AM by Chen Shiang Khoo

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 18 replies on 2 pages [ « | 1 2 ]
Frank Silbermann

Posts: 40
Nickname: fsilber
Registered: Mar, 2006

Re: Unit or Functional Tests? Posted: Apr 24, 2007 8:26 AM
Reply to this message Reply
Advertisement
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.

Jeff Ratcliff

Posts: 242
Nickname: jr1
Registered: Feb, 2006

Re: Unit or Functional Tests? Posted: Apr 24, 2007 9:06 AM
Reply to this message Reply
> 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.

Ivan Lazarte

Posts: 91
Nickname: ilazarte
Registered: Mar, 2006

Re: Unit or Functional Tests? Posted: May 21, 2007 1:01 PM
Reply to this message Reply
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...

Chen Shiang Khoo

Posts: 5
Nickname: coolboykl
Registered: Feb, 2007

Re: Unit or Functional Tests? Posted: May 23, 2007 1:51 AM
Reply to this message Reply
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.

I believe of writing a good ROI (Return of Investment) unit code is important, and presented my view on code coverage my blog at : http://coolboykl.blogspot.com/2007/05/100-unit-test-code-coverage-using-mock.html

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 [ « | 1  2 ]
Topic: Clustering RIFE with Terracotta Previous Topic   Next Topic Topic: DataDirect Releases XML Converters

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use