What is black box testing and white box testing [closed]
Asked Answered
G

8

7

I'm trying to understand one in terms of how it compares to the other.

Is white box testing where you can see the code and black box testing where you don't look at the code?

Goree answered 15/12, 2009 at 8:56 Comment(1)
See the previously existing #402661Citrange
R
5

basicaly yes.

in black box testing you test if the expected input to your object produces expected output without the ability to change the underlying code.

in white box testing you can see the code and you test all possible paths through it.

Roughen answered 15/12, 2009 at 8:59 Comment(3)
They should call it clear box testing instead of white box testing.Goree
Also be aware that if you have a code branch that you aren't able to exercise using a valid blackbox test case, then you are either trying to test for something incidental and irrelevant or you have found some dead code.Dominion
I have a question: "you can test all possible paths through it". So which one I should do? Test all the possible paths through the UI of the program or just writing test scenarios in the code to do test?Mchugh
M
10

Q) Is white box testing where you can see the code and black box testing where you don't look at the code?

Black-Box Testing

  • It is a process of giving the input to the system and checking the output of the system, without bothering about the system that how the system generates the output. It is also call as behavior testing, data-driven testing or I/O driven testing, functional testing .

  • testing based solely on analysis of requirements (specification, user documentation etc)

Advantages:

1) More effective on larger units of code than glass-box testing.

2) Tester and Programmer are independent of each other.

3) Tests done according to users point of view.

4) test-cases can be designed as soon as specifications are complete.

Disadvantages:

1) It may leave many program path untested.

2) Only small number of possible inputs can actually be tested, to test every possible. input stream would take nearly forever.

White-Box Testing

  • It is a process of giving input to thee system and checking that how the system processes the input to generate the output.

  • It is mandatory for tester to have the knowledge of the code.

Advantage:

1) This type of testing helps to uncover defects at structural level. The tests go below the top and functional layer to uncover the defects

Disadvantages:

1) Does not ensure the user requirements are met

2) Does not establish if the decisions, condition ans paths.

Mohammadmohammed answered 7/5, 2013 at 16:29 Comment(2)
Very good answer. But it seems like the last sentence is cut off?Dominion
Disadvantage for whitebox testing is also that it is highly coupled to the implementation, and needs to change whenever there is an incidental change to the implementation that doesn't change the behavior. So whitebox testing has higher maintenance.Dominion
R
5

basicaly yes.

in black box testing you test if the expected input to your object produces expected output without the ability to change the underlying code.

in white box testing you can see the code and you test all possible paths through it.

Roughen answered 15/12, 2009 at 8:59 Comment(3)
They should call it clear box testing instead of white box testing.Goree
Also be aware that if you have a code branch that you aren't able to exercise using a valid blackbox test case, then you are either trying to test for something incidental and irrelevant or you have found some dead code.Dominion
I have a question: "you can test all possible paths through it". So which one I should do? Test all the possible paths through the UI of the program or just writing test scenarios in the code to do test?Mchugh
H
5

Wikipedia:

White box testing uses an internal perspective of the system to design test cases based on internal structure. It requires programming skills to identify all paths through the software.

versus

Black box testing takes an external perspective of the test object to derive test cases.

Hexavalent answered 15/12, 2009 at 9:0 Comment(0)
S
2

Yeah, you pretty much have it. Black box is testing the externals without knowledge (or access) of/to anything internal. White box testing is being able to look at (and perhaps modify) the internal state of what you are testing. They both have different uses. Unit tests are most often (but not always) white box tests.

Spatter answered 15/12, 2009 at 8:59 Comment(1)
Unit tests test particular functions typically at a very granular level. They are the lowest level tests and they are typically created by the developers of the application and formed in to a regression test suite comprised of hundreds or thousands of them which can be run anytime things change to detect a regression.Spatter
C
1

White box testing

Once the internal working of s/w is known, the test is performed to ensure that all the internal operations of s/w are performed according to specification.

Black box testing

Once the specified function for each s/w compnent have been designed, the test is performed to ensure that each function is performing.

Chambertin answered 16/1, 2013 at 15:24 Comment(0)
B
1

white-box testing: In white box testing we use knowledge of the internal structure of system i.e. tester needs to have knowledge of programming language and coding.

and in black box testing we ignore the internal of the system and focus on the relationship between inputs and outputs.

Burkes answered 3/10, 2013 at 19:7 Comment(0)
A
1

White box testing is like a giving input and verifying output using (glass) transparent box i.e. in this you give the input observe the processing on input (functional flow, variables values, calculation) and verifies the output is as expected or not.

Black box testing is like giving input and verifying output using (wooden) non-transparent box i.e. in this you give the input don't observe the processing on input (functional flow, variables values, calculation) and verifies the output is as expected or not.

Abject answered 18/2, 2014 at 12:18 Comment(0)
C
0

White box testing :- Programming and implementation knowledge is required.

Black box testing :- Programming and implementation knowledge is not required.

Catarrhine answered 19/7, 2014 at 11:38 Comment(1)
You can write blackbox unit tests. For those you most definitely need to be able to write code.Dominion

© 2022 - 2024 — McMap. All rights reserved.