Black box versus white box

You may have heard many times that a test is a black-box test. This simply means that the test does not know anything about how the system under test (SUT) is implemented. The test relies only on the interface of the SUT that is exported for the outside world. A white box test, on the other end of the scale, tests the internal working of the SUT and very much relies on the implementation:

Both approaches have advantages and disadvantages. We should use one, or a mixture of the two approaches, when it fits the purpose of the testing needs the most. A black-box test that doesn't rely on the implementation does not ...

Get Java Projects - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.