Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unit testing, Black-box testing and white box testing [closed]

What is Unit testing, Black-box testing and White-Box testing? I googled but all the explanation I found was very technical. Can anyone answer this question in a simple way with an appropriate example?

like image 865
software Avatar asked Aug 31 '11 14:08

software


People also ask

Is unit testing white box or black box testing?

Unit testing is simply testing every unit class of your "code". It is a whitebox testing.

Are unit tests Whitebox testing?

Is unit testing a black box or white box testing technique? Unit testing is a white box technique. The reason for this is that you can see what the code does before it executes. This allows you to write a test case for every aspect of your code.

What is closed box testing?

Also known as closed-box testing, data-driven testing, or functional testing. Also known as translucent testing, as the tester has limited knowledge of the insides of the application. Also known as clear-box testing, structural testing, or code-based testing. Performed by end-users and also by testers and developers.

Can unit tests be black box?

Black box testing refers to any type of software test that examines an application without knowledge of the internal design, structure, or implementation of the software project. Black box testing can be performed at multiple levels, including unit testing, integration testing, system testing, or acceptance testing.


1 Answers

In black box testing, you don't care how the internals of the thing being tested work. You invoke the exposed API and check the result; you don't care what the thing being tested did to give you the result.

In white box testing, you do care how the internals of the thing being tested work. So instead of just checking the output of your thing, you might check that internal variables to the thing being tested are correct.

Unit testing is a way of testing software components. The "Unit" is the thing being tested. You can do both black and white box testing with unit tests; the concept is orthogonal to white/black-box testing.

like image 71
hvgotcodes Avatar answered Oct 13 '22 06:10

hvgotcodes