Thursday, August 13, 2009

Black Box Testing Vs White Box Testing

Black Box Testing

Black Box Testing refers to the technique of testing a system with no knowledge of the internals of the system. Black Box testers do not have access to the source code and are oblivious of the system architecture.

A Black Box tester typically interacts with a system through a user interface by providing inputs and examining outputs without knowing how and where the inputs where operated upon.

In Black Box testing, target software is exercised over a range of inputs and the outputs are observed for correctness.

Advantages

  1. Efficient Testing- Well-suited and efficient for large code segments or units
  2. Unbiased Testing- clearly separates user's perspective from developer's perspective.
  3. Non-intrusive- Code access not required
  4. Easy to execute- can be carried out by moderately skilled testers with no knowledge of implementation, programming language, operating systems or networks.
Disadvantages

  1. Localized Testing- Limited code path coverage since only a limited number of test inputs are actually tested.
  2. Inefficient Test Authoring- Without implementation information, exhaustive input coverage would take forever and would require tremendous resources.
  3. Blind Coverage- Cannot control targeting code segments which may be more error prone than others.
White Box Testing

White Box testing refers to the technique of testing a system with knowledge of the internals of the system. White Box testers have access to the source code and are aware of the system architecture.

A White Box tester typically analyzes source code, derives test cases from knowledge of the source code and finally targets specific code paths to achieve a certain level of code coverage.

A White Box tester with access to details about both operations can readily craft efficient test cases that exercise boundary conditions.

Advantages

  1. Increased Effectiveness- Cross-checking design and assumptions against source code outlives effective implementation.
  2. Full code pathway capable- All the possible code pathways can be tested including error handling, resource dependencies and additional internal code logic/flow.
  3. Early Defect Identification- Analyzing source code and developing test based on the implementation details enables testers to find programming errors quickly.
  4. Reveal hidden code flaws- Access to source code improves understanding and uncovering unintended hidden behaviour of program modules.
Disadvantages

  1. Difficult to scale- requires skilled and expert testers, with intimate knowledge of target system, testing tools and coding languages.
  2. Difficult to maintain- requires specialized tools such as source code analyzers, debuggers and fault injectors.
  3. Highly Intrusive- Requires code modification to be done using interactive debuggers or by actually changing the source code. This may be adequate for small programs, but it does not scale well to larger applications.

Waterfall Model Vs V-Model

Waterfall Model

Sequential software development process in which progress is seen as flowing steadily downwards from requirements analysis to design, construction, testing and maintenance.

Phases

  1. Requirements Specification
  2. Design
  3. Construction(Coding)
  4. Integration
  5. Testing and Debugging
  6. Installation
  7. Maintenance
The Waterfall model maintains that one should move to a phase only when its preceding phase is completed and perfected. To follow this model, one proceeds from one phase to the next in a purely sequential manner.

Advantages

  1. Each phase is 100% complete and absolutely correct before proceeding to the next phase. This turns out that time spent early on making sure that requirements and design are absolutely correct will save you much time and effort later.
  2. It emphasizes on documentation, requirements documents, design documents and source code. So if new team members or even entirely new teams should be able to familiarize themselves by reading the documents.
  3. It follows a simple approach and is more disciplined.
  4. It can be suited to software projects that are stapled, with unchanging requirements.
Disadvantages

  1. It is impossible to get one phase of a product's life-cycle perfected before moving on to the next phase.
  2. Clients may change their requirements after a design is finished, so the entire design must be modified to accomodate the new requirements.


V-Model


The V-Model is a software development process which can be assumed to be the extension of the waterfall model. Instead of moving down in a linear way, the process steps are bent upwards after the coding phase, to form the typical V shape. The V-model demonstrates the relationships between each phase of the development life cycle and its associated phase of testing.

Testing activities like test designing start at the beginning of the project well before coding and therefore saves a huge amount of the project time.

Phases

The verification phase are on the left hand side of the V. Coding phase is at the bottom of the v and the validation phases are on the right hand side of the V.

Verification Phases

  1. Requirements Analysis
  2. System Design
  3. Architecture Design
  4. Module Design
Validation Phases

  1. Unit Testing
  2. Integration Testing
  3. System Testing
  4. User Acceptance Testing