How does the White Box Test work?

Asked

Viewed 930 times

6

I read in this reply user’s utluiz the following description of the White Box Test, see:

White box test: when assessing the internal functioning of the software. For example, if certain methods perform correctly.

However, I still have doubts about this type of test.

Doubts

  1. How the white box test is performed?
  2. This test is related to only methods of a particular class?
  3. What types of methods should I submit to the white box test?

I would like a practical example of a white box test being applied in a method, if possible.

1 answer

3


White box tests evaluated the behavior of a feature. Whether a given input will produce the expected output or whether code has passed the desired stream. To perform this type of test you need knowledge of the source code (other than a black box test where only the sample is evaluated).

1 . How the white box test is performed?

The most formal way to do this is to use a unit test battery and it is also possible to simplify by separating a portion of the code and create a new project/file for this purpose.

  1. This test is related to only methods of a particular class?

No, the test can check whether a particular part has been executed or not, as well as can test an entire method.

Some unit testing tools provide test case-based diagnostics and tell which lines/snippets of code have not been executed, which serves as an indication that not all paths have been run or there is dead code.

  1. What types of methods should I submit to the white box test?

Any type especially have some validation or application of business rule.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.