1. What is black box/white box testing?
Black-box and white-box are test design methods. Black-box test design treats the system as a “black-box”, so it doesn’t explicitly use knowledge of the internal structure. Black-box test design isusually described as focusing on testing functional requirements. Synonyms for black-box include:behavioral, functional, opaque-box, and closed-box. White-box test design allows one to peek insidethe “box”, and it focuses specifically on using internal knowledge of the software to guide theselection of test data. Synonyms for white-box include: structural, glass-box and clear-box.While black-box and white-box are terms that are still in popular use, many people prefer the terms"behavioral" and "structural". Behavioral test design is slightly different from black-box test designbecause the use of internal knowledge isn't strictly forbidden, but it's still discouraged. In practice, ithasn't proven useful to use a single test design method. One has to use a mixture of differentmethods so that they aren't hindered by the limitations of a particular one. Some call this "gray-box" or "translucent-box" test design, but others wish we'd stop talking about boxes altogether.It is important to understand that these methods are used during the test design phase, and theirinfluence is hard to see in the tests once they're implemented. Note that any level of testing (unittesting, system testing, etc.) can use any test design methods. Unit testing is usually associatedwith structural test design, but this is because testers usually don't have well-defined requirementsat the unit level to validate.
2. What are unit, component and integration testing?
Note that the definitions of unit, component, integration, and integration testing are recursive:
The smallest compliable component. A unit typically is the work of one programmer (At leastin principle). As defined, it does not include any called sub-components (for procedural languages)or communicating components in general.
in unit testing called components (or communicating components) are replaced withstubs, simulators, or trusted components. Calling components are replaced with drivers or trustedsuper-components. The unit is tested in isolation.
a unit is a component. The integration of one or more components is a component.Note: The reason for "one or more" as contrasted to "Two or more" is to allow for components thatcall themselves recursively.
same as unit testing except that all stubs and simulators are replaced with thereal thing.Two components (actually one or more) are said to be integrated when:a. They have been compiled, linked, and loaded together.b. They have successfully passed the integration tests at the interface between them.Thus, components A and B are integrated to create a new, larger, component (A,B). Note that thisdoes not conflict with the idea of incremental integration—it just means that A is a big componentand B, the component added, is a small one.
carrying out integration tests.Integration tests (After Leung and White) for procedural languages. This is easily generalized for OOlanguages by using the equivalent constructs for message passing. In the following, the word "call"is to be understood in the most general sense of a data flow and is not restricted to just formalsubroutine calls and returns – for example, passage of data through global data structures and/orthe use of pointers.