views:

327

answers:

7

Hello,

What is functional testing? How is this different from unit testing and integral testing?

Thanks

+1  A: 
  • Unit testing is within single application tier (presentation, business logic, data access, etc.).

  • Functional testing is across multiple application tiers so that tests span pieces of complete application functionality.

  • Integration testing would be tests across multiple application components or even applications.

grigory
+6  A: 

Another way of thinking is this:

Unit Test:
Test your code as units, calling methods and verifying return values and object property states/values

Functional Testing:
Testing your code paths while preforming a task. This ensures your application does what your code says it does.

Integral Testing? Do you mean Integration Testing?

Integration Testing:
Testing your code by plugging it into a larger mass to ensure you haven't broken existing logic and you are able to integrate back into the main branch.

Chris
You can also add acceptation testing to make the list complete.
Gamecat
+2  A: 

Functional testing is making sure that customer requirements are implemented in the final product as specified in the spec. Unit testing is to check that small portions of code behave as intended. Integration testing is making sure that the system is stable when you combine all the different parts/modules together.

For example, BigBank Corporation wants a software that generates customer bank statements and inserts 3 random fees each month for each customer.

The Program Manager writes the software functional specification after several discussions with BigBank's representatives.

A developer writes a module that fills up a template statement from a database. He performs unit testing to check that most cases are covered (typical customer, no data for the month, etc.)

Another developer creates a random number generator module. He performs unit testing on that.

The integrator takes the two modules, compiles them and performs integration testing to ensure that they work well together.

Finally, in order to deliver a beta version for BigBank to try, the Test team performs functional testing to validate that the software complies with the functional specs.

Damien
+1  A: 

Unit Test: Test the smallest units of code possible, usually one function or method. By using mocks etc. this ideally should be very fast and not hit the hard disk or network in any way.

Functional Testing: Test a set of functions/methods working together. Ideally, this should also not go to disk or network as well, but often will.

Integration Testing: Test that run in the real world, going to real (although test) databases, writes to disk, etc. You are testing that your program works correctly with other services, that it 'integrates' with them correctly. You often will have a separate program (ex. Selenium) that exercises the tests, just like a real user would.

Also: White Box Testing: Tests that know the internals of how the program works. Unit tests and Functional tests are often white box. An example would be calling a function to save a value and then checking the value in the database for correctness.

Black Box Testing: Tests that are ignorant of the internals and treat the program/function/method as a "black box". An example would be calling a function to save a value and calling another (public) function to get that value.

Scott Kirkwood
My definitions of functional and integration testing are exactly the reverse of yours! :-)
Andrew Swan
A: 

The term "functional testing" is commonly applied to testing a system as a whole, e.g. a web application from the browser end through to the database layer. While I am guilty of abusing this term myself, I believe the terms "system testing" or "end-to-end testing" describe it much better.

The other meaning of "functional testing" can be just "testing functionality", which is usually true for unit or integration testing, too. But there are tests which are not functional tests. Pretty much anything that is regarding non-functional requirements falls into that category, such as load testing or profiling.

I think originally the distinction might have been between "functional system testing" and "non-functional system testing", nowadays "functional testing" is often used to distinguish end-to-end testing from testing subsystems/units.

Peter Becker
+1  A: 

Functional Testing is these days is commonly known as the End-to-End testing or System testing if you look at the V-Model.

Unit testing obviously testing the smallest unit of code that is possible and integration testing is checking that your units integrate well with other parts of the system.

AutomatedTester