I have recently heard of Functional Testing over Unit Testing.
I understand that Unit Testing tests each of the possibilities of a given piece of code from its most atomic form. But what about Functional Testing?
This sounds to me like only testing if the code works, but is it as reliable as Unit Testing?
I've been told there was two school of thoughts for the matter. Certains would prefer Unit Testing, others Functional Testing.
Is there any good resources, links, books, any references or one of you all who can explain and elighten my path on the subject?
Thanks!
Unit Testing and Functional Testing have two different results.
Unit Testing verifies that a small piece of code works as expected. It is usually done by the developer to ensure that the code works correctly. They are usually automated by a testing-framework as well.
Functional Testing verifies that a feature works as expected by going through a certain pathway through the program. They are usually executed by a person on the software ensuring that the program will work they way it is supposed to for the user. It, as such, is higher level, and thus tests several units at once.
I think both are important. If you have limited resources, though, and have to pick/choose techniques, and I think it depends on the products you create, but for what I do (automotive control products used by humans through some buttons) functional tests are most important. It checks, and ensures, that when the user gets the product, it does what it is supposed to do. This doesn't mean we should opt out of unit testing, but if push-comes-to-shove, functional is the most important to ensure great user experience and getting the product out the door.
If you produce, say, a database engine (or some other product that isn't necessarily user-facing), unit testing may be what you really ought to do.
There is a place for both in most development work.
Unit testing is there to test small units of code, to see that they work as expected.
Functional testing is there to test that the overall functionality of the system is as expected.
They are at different levels and both should be used.