|The stupid question is the question not asked|
Re^2: Neither system testing nor user acceptance testing is the repeat of unit testing (OT)by fokat (Deacon)
|on Oct 24, 2005 at 00:46 UTC||Need Help??|
I mostly agree with you, dragonchild, except for this small piece (which does not deprive you of your well deserved ++):
unit-testing is still black-box testing
The blackness of the boxes you test with, are orthogonal to the phase of testing you are at. Seriously, you can base your cases on the documented behavior (what the code is supposed to do) and also add cases to stress the inner workings of the code you're looking at.
If you generalize, you'll see that you cannot insure you're achieving the desired level of test coverage, unless you peek under the hood and verify that the code is being excercised in the intended (or unintended, depending on who you ask) way.
The point is that you must try to use both, black box and white box, as long as you can. As you progress in the scope of your tests (ie, you move from unit testing to system testing also called integration testing), the number of cases / paths makes the white box approach too resource intensive.
Otherwise, you may have all the test cases you want, and still miss bugs because you did not see how the actual code did something in particular.
But even when white box can help provide more effective test cases, this does not mean you can forget about black box testing. If you rewrite a substantial part of the code, chances are your white-box test cases become less effective, because they may now be tickling different code, or in different ways. But your black-box tests will still be verifying that at least, the interface is working as expected.
Update: pg is right in the money (++ too): For unit testing, most of the time, it is a mixture of white box testing and black box testing (...)
-lem, but some call me fokat