- Mastering Software Testing with JUnit 5
- Boni García
- 261字
- 2021-07-02 15:34:25
White-box testing
White-box testing (also known as structural testing) is based on knowledge of the internal logic of an application's code. It determines if the program-code structure and logic is faulty. White-box test cases are accurate only if the tester knows what the program is supposed to do.
Black-box testing uses only the specification to identify use cases, while white-box testing uses the program source code (implementation) as the basis of test case identification. Both approaches, used in conjunction, should be necessary in order to select a good set of test cases for the SUT. Some of the most significant white-box techniques are as follows:
- Code coverage defines the degree of source code, which has been tested, for example, in terms of percentage of LOCs. There are several criteria for the code coverage:
- Statement coverage: The line of code coverage granularity.
- Decision (branch) coverage: Control structure (for example, if-else) coverage granularity.
- Condition coverage: Boolean expression (true-false) coverage granularity.
- Paths coverage: Every possible route coverage granularity.
- Function coverage: Program functions coverage granularity.
- Entry/exit coverage: Call and return of the coverage granularity.
- Fault injection is the process of injecting faults into software to determine how well (or badly) some SUT behaves. Defects can be said to propagate, and in that case, their effects are visible in program states beyond the state in which the error existed (a fault became a failure).
- Mutation testing validates tests and their data by running them against many copies of the SUT containing different, single, and deliberately inserted changes. Mutation testing helps to identify omissions in the code.
推薦閱讀
- TypeScript Blueprints
- C# Programming Cookbook
- Nexus規?;疭crum框架
- Python數據可視化之Matplotlib與Pyecharts實戰
- 可解釋機器學習:模型、方法與實踐
- Learning JavaScript Data Structures and Algorithms
- 軟件品質之完美管理:實戰經典
- Visual C++開發入行真功夫
- Java程序設計案例教程
- Angular Design Patterns
- 大學計算機應用基礎(Windows 7+Office 2010)(IC3)
- Java語言程序設計實用教程(第2版)
- Alfresco for Administrators
- VB語言程序設計教程(第2版)
- Python從入門到全棧開發