How does the White Box Test work?

6

I read this response of the user #

  

White box test : When evaluating the internal operation of the   software. For example, if certain methods execute correctly.

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

Questions

  • How does the white box test run?
  • This test is related to only methods of a given class?
  • 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 to a method if possible.

        
    asked by anonymous 19.04.2017 / 13:52

    1 answer

    3

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

      

    1. How does the white box test run?

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

      
  • Is this test related to only methods of a given class?
  •   

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

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

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

    Any type especially has some validation or rule rule application.

        
    19.04.2017 / 14:22