White box testing
Any one software product is definitely at fault because software products are built by humans. Therefore, an independent person, group, or organization will need to be tested to see if the product has any problems or errors. For software testing, we need to have effective testing strategies and techniques for each level of testing. Software testing consists of two parts that require different skills, white-box testing and black-box testing.
In this topic, I will delve into the white box testing. To better understand the technique of white box testing (White-box testing), we take a look at the following contents:
1.What is White box testing
White box testing is a software testing method in which the internal structure, design or implementation of the item being tested is known to the tester. The tester chooses inputs to exercise paths through the code and determines the appropriate outputs. So Programming know-how and the implementation knowledge is essential.
2. Subjects of application
The object to be tested is a software component. The software component can be a function, a function module,…
3. Levels Applicable To
White Box Testing method is applicable to the following levels of software testing:
- Unit Testing: For testing paths within a unit.
- Integration Testing: For testing paths between units.
- System Testing: For testing paths between subsystems.
However, it is mainly applied to Unit Testing.
4. Pros and cons of White box testing
- Testing can be commenced at an earlier stage.
- Testing is more thorough, with the possibility of covering most paths.
- Since tests can be very complex, highly skilled resources are required, with a thorough knowledge of programming and implementation.
- Test script maintenance can be a burden if the implementation changes too frequently.
5. Common white box testing techniques
5.1. Baseline test – Line graph
- A technique used in white box testing was first introduced by Tom McCabe. The line graph is similar to the program control flow graph.
- Baseline test – Line graph is one of many methods of algorithm description. Besides, this is a visual method that shows us easily the components of algorithms and relationships
- Contacts in implementing these components.
- Basic line techniques – flow graphs can help test case designers get a degree of procedural complexity.
- Consists of 2 types of components: nodes and arcs connecting them.
- Types of buttons in the control line graph:
- Types of structure components of line graphs:
If the control flow graph contains only binary decision nodes, then we call it control flow graph of a binary. Also, we can always detail any control flow graph into a binary control flow graph.
5.2 Testing based on control flow
- Execution path is a script to execute the corresponding software unit. In addition, it is an ordered list of commands executed for a specific run of the software unit, starting from the entry point of the software unit to the ending point of the software unit.
- Each software component has from 1 to n (possibly very large) different implementation paths.
- The objective of the control flow test method is to ensure that all the execution paths of the software units under test are run properly. But in reality, the effort and time to achieve the above goal is very large, even on small software units.
For example: the following code
for (i=1; i<=1000; i++) for (j=1; j<=1000; j++) for (k=1; k<=1000; k++) doSomethingWith(i,j,k);
only one execution path, but very long
For more information about Testing services, please contact us
Lotus Quality Assurance (LQA)
Tel: (+84) 24-6660-7474
Youtube: Lotus QA channel