Black Box Testing:
- Tester is a human and not the developer
- Tester does not know how system was implemented *
- Tester will report an issue when the response from the system to any step of the test is not the expected result.
White Box Testing:
- Tester is a human and not the developer
- Tester does know how system was implemented *
- Tester will report an issue when the response from the system to any step of the test is not the expected result and is more likely to detect an issue with the test case itself or with the system despite receiving expected results.
Unit Testing:
- Tester is usually code that tests a particular module within a system. For example, in Java, a project may have a class named Student and a test class named StudentTest. For each of the functions in Student (like
getGrades
), StudentTest might have 0 or more functions to test them (like getGradesTest
). This is just one such way to go about it.
- Testing code typically only knows the expected output for various input for a portion of a system.
- Unit tests are often run before submitting code or run automatically when building an application to deploy. The goal is to prevent as many bugs from being introduced into the system when adding, changing or removing functionality.
* The amount of knowledge known between a black box tester and a white box tester varies from organization to organization. For example, what I consider usability testing, another company might call black box testing. A white box tester in some companies might be another developer (developer QA), whereas another organization may not allow any testing sign-offs to be completed by a developer. A black box tester could be someone who just has a list of instructions they need to follow and validate, or it could be someone who generally knows how the system works, but just not at a particularly detailed level. For example:
A black box tester may or may not identify an issue despite a test case that matches expectations, like an e-commerce test case that omits the step of collecting a guest checkout shipping address.
Essentially, white box and black box testing is rarely implemented strictly. Most organizations have unit tests, developer testing (that may or may not be formally documented - depends upon the implications of a failure), QA testers (black, white, and every shade of gray in between), and user testing / business sign-off (the people who should be involved throughout the project, but in poorly run organizations only show up at the beginning and end, and send a completed project back to design right before deployment).