Functional Testing – How to Perform at Unit Test Level

testingtheoryunit testing

Preparing myself for ISTQB, I found a bit odd many things in their textbooks. E.g. they call black box testing as functional testing when you are not concerned with structured but only observe the ouput based on inputs.
But later they say that functional testing is done at levels..well, how can I do unit testing without the knowledge how it works if I can just see it (and must see it). It is white box but then it is in the conflict..

Best Answer

When you are doing unit testing, you do not care about the actual implementation of the solution, only that it gives the expected results. The difference being the level of unit that you are testing. If you are testing a class, you are not making sure that internal methods are called but that the correct response is returned. How the unit gets the response is not what you are testing for.

The different levels of testing cover the interaction and logic of the pieces of your implementation but are agnostic of what they actually are.

UPDATE Generally, developers do fine grain unit testing. However, even a tester can do lower level unit testing. Focusing on specific pieces of an operation, for example sending data to the server themselves rather than through the web interface (removing the web interface from the unit). Or for testing the web interface, spoofing the response provided so that you are able to test its behavior in isolation.

Knowing the implementation would allow you to determine the lower level 'units', however the tests themselves do not know anything about the actual details of the solution.