11

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

0

8 Answers 8

20

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.

Sign up to request clarification or add additional context in comments.

1 Comment

You can also add acceptation testing to make the list complete.
8

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.

Comments

2

Functional testing of the target-of-test should focus on any requirements for test that can be traced directly to functional specifications or business rules. The goals of these tests are to verify proper data acceptance, processing, and retrieval. It tests the features and operational behavior of a product to ensure they correspond to its specifications, and incorporates tests that ignore the internal mechanism of a system or component and focus solely on the outputs generated in response to selected inputs and execution conditions. This type of testing is based upon typically black-box techniques, that is, verifying the application (and its internal processes) by interacting with the application via the UI (User Interface) and analyzing the output (results).

Source:http://softwareqatestings.com/introduction-to-software-testing/basic-steps-of-functional-testing.html

Comments

1

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.

1 Comment

My definitions of functional and integration testing are exactly the reverse of yours! :-)
1
  • 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.

Comments

1

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.

Comments

0

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.

Comments

0

First we should understand what is a 'function' with respect to software?

Function can be considered as a task/activity which is intended to do by the software.

So, testing each and every function of the software is called functional testing

Coming to the unit testing you will isolate the code and test each unit of it.

Consider a method/function in a program as an unit where you will pass some parameters and expect the code to give required output and testing such units of code is called a unit testing

A collection of units acts as a function of a software and testing of such functions can be called as functional testing

Please go through the links to understand it better

http://www.guru99.com/unit-testing-guide.html

http://www.guru99.com/functional-testing.html

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.