Monday, July 28, 2008

Advantages and Disadvantages of Black Box and White Box Testing

Advantages and Disadvantages of Black Box Testing

Advantages of Black Box Testing

  • Black box tests are reproducible.
  • The environment the program is running is also tested.
  • The invested effort can be used multiple times.
  • More effective on larger units of code than glass box testing
  • Tester needs no knowledge of implementation, including specific programming languages
  • Tests are done from a user's point of view
  • Will help to expose any ambiguities or inconsistencies in the specifications
  • Efficient when used on Larger systems
  • As the tester and developer are independent of each other, test is balanced and unprejudiced
  • Tester can be non-technical.
  • There is no need of having detailed functional knowledge of system to the tester.
  • Tests will be done from an end user's point of view. Because end user should accept the system. (This is reason, sometimes this testing technique is also called as Acceptance testing)
  • Testing helps to identify the vagueness and contradiction in functional specifications.
  • Test cases can be designed as soon as the functional specifications are complete

Disadvantages of Black Box Testing

  • The results are often overestimated.
  • Not all properties of a software product can be tested
  • The reason for a failure is not found.
  • Only a small number of possible inputs can actually be tested, to test every possible input stream would take nearly forever
  • Without clear and concise specifications, test cases are hard to design
  • There may be unnecessary repetition of test inputs if the tester is not informed of test cases the programmer has already tried
  • May leave many program paths untested
  • Cannot be directed toward specific segments of code which may be very complex (and therefore more error prone)
  • Most testing related research has been directed toward glass box testing
  • Test cases are tough and challenging to design, without having clear functional specifications
  • It is difficult to identify tricky inputs, if the test cases are not developed based on specifications.
  • It is difficult to identify all possible inputs in limited testing time. So writing test cases is slow and difficult
  • Chances of having unidentified paths during this testing
  • Chances of having repetition of tests that are already done by programmer.

Advantages and Disadvantages of White Box testing

Advantages of white box testing

  • Forces test developer to reason carefully about implementation
  • Approximates the partitioning done by execution equivalence
  • Reveals errors in "hidden" code:
  • Beneficent side-effects
  • Optimizations (e.g. chartable that changes reps when size > 100)
  • As the knowledge of internal coding structure is prerequisite, it becomes very easy to find out which type of input/data can help in testing the application effectively.
  • The other advantage of white box testing is that it helps in optimizing the code.
  • It helps in removing the extra lines of code, which can bring in hidden defects.

Disadvantages of white box testing

  • Expensive
  • Miss cases omitted in the code
  • As knowledge of code and internal structure is a prerequisite, a skilled tester is needed to carry out this type of testing, which increases the cost.
  • And it is nearly impossible to look into every bit of code to find out hidden errors, which may create problems, resulting in failure of the application.
  • Not looking at the code in a runtime environment. That's important for a number of reasons. Exploitation of vulnerability is dependent upon all aspects of the platform being targeted and source code is just of those components. The underlying operating system, the backend database being used, third party security tools, dependent libraries, etc. must all be taken into account when determining exploitability. A source code review is not able to take these factors into account.
  • Very few white-box tests can be done without modifying the program, changing values to force different execution paths, or to generate a full range of inputs to test a particular function.

10 comments:

Numan GÖÇERİ said...

thank you, nice analysis;)

Anonymous said...

ty 4 that

Prathi said...

hi can you give me a comparison between the diff types of black box testing.....

Anonymous said...

can anyone tell me "what is the need of doing black box testing even we are doing white box testing"

Anonymous said...

acceptance testing is not black box testing.

Romil said...

there are two types of acceptance testing:
1) User acceptance testing and
2) Business acceptance testing

acceptance testing is a formal testing conducted to determine whether a system satisfies it's acceptance criteria-- criteria the system must satisfy to be accepted by the customer.

Anonymous said...

As we often say that it is not the technology which is bad but it is its use which determines the real difference between good or bad. Same is the case with Black Box car Insurance. There are two different parameters to evaluate the advantage or disadvantages of it.
Read More
http://www.worldrealnews.com/2012/04/05/black-box-car-insurance-advantages-disadvantages/

Shumaila said...

As we often say that it is not the technology which is bad but it is its use which determines the real difference between good or bad. Same is the case with Black Box car Insurance. There are two different parameters to evaluate the advantage or disadvantages of it.
Read More
http://www.worldrealnews.com/2012/04/05/black-box-car-insurance-advantages-disadvantages/

Venu said...

Tnqs a lot

Anonymous said...

Complete post on

http://blogs.tutorialshouse.com/black-box-testing/