CH05.L07 . White Box techniques
Summary
TLDRThis script delves into white box testing, focusing on Statement and Decision techniques for software testing with visible source code. It illustrates how to achieve 100% statement coverage with the least test cases and emphasizes Decision testing for comprehensive code pathway exploration. The explanation includes practical examples, demonstrating the process of creating test cases and calculating coverage percentages. The script suggests that Decision testing generally requires more test cases for better code coverage and references 'A Practitioner's Guide to Software Test Design' for further insights.
Takeaways
- π White box testing involves examining the source code of software, allowing for detailed testing techniques.
- π Two primary white box testing techniques discussed are Statement testing and Decision or branch testing.
- π Statement testing aims to execute all lines of code with the fewest test cases possible, ensuring code coverage.
- π οΈ Decision testing focuses on creating test cases that cover all possible outcomes of decision points in the code, such as if-else or while loops.
- π A control flow graph is a useful tool for visualizing the flow of a program, aiding in the application of these testing techniques.
- π The first example demonstrates how selecting specific conditions (e.g., vehicle type and color) can achieve 100% statement coverage with a single test case.
- π To calculate coverage, divide the number of executed statements by the total number of statements, or executed decisions by the total number of decisions.
- π The second example shows that statement coverage does not always require using all code lines and can be achieved with multiple test cases.
- π’ In the second example, three test cases with varying conditions are needed to achieve 100% statement coverage, illustrating the complexity of some code structures.
- π‘ The number of test cases required for Statement testing is generally less than or equal to those needed for Decision testing, highlighting the thoroughness of Decision testing.
- π For further reading on white box testing techniques, 'A Practitioner's Guide to Software Test Design' is recommended.
Q & A
What are white box testing techniques?
-White box testing techniques are methods used when the tester has access to the source code of the software being tested. These techniques allow for a deeper understanding and testing of the internal workings of the software.
What are the two white box testing techniques discussed in the script?
-The two white box testing techniques discussed are Statement testing and Decision or branch testing.
What is the goal of Statement testing?
-The goal of Statement testing is to execute all the code lines or to review all of them using the least number of test cases possible.
How is 100% statement coverage achieved according to the script?
-100% statement coverage is achieved when a single test case can execute all the statements in the code, ensuring that every line of code is tested.
What is Decision or branch testing?
-Decision or branch testing is a technique aimed at writing test cases that cover all possible paths in the code, especially focusing on decision points such as if-then-else or while loops.
How many test cases are needed to achieve 100% decision coverage in the first example provided?
-Three test cases are needed to achieve 100% decision coverage in the first example, each covering different branches of the decision points.
What is a control flow graph and how is it used in white box testing?
-A control flow graph is a diagram that represents the flow of control in a program, showing decision points and the paths that can be taken. It is used in white box testing to visually plan test cases that cover all possible execution paths.
How is decision coverage calculated?
-Decision coverage is calculated by dividing the number of executed decisions by the total number of decisions in the code.
What is the relationship between the number of test cases in Statement testing and Decision testing?
-The number of test cases needed for Statement testing is always less than or equal to the number of test cases needed for Decision testing, as Decision testing aims to cover all possible paths, including all decisions.
Why is it not always necessary to use all code lines for 100% statement coverage in some cases?
-In some cases, due to the structure of the code and decision points, it may be possible to achieve 100% statement coverage with fewer test cases than the total number of statements, as some paths may naturally cover multiple statements.
Which book is recommended for a good reference on white box testing techniques?
-The book 'A Practitioner's Guide to Software Test Design' is recommended for a comprehensive understanding of white box testing techniques, including Statement and Branch testing.
Outlines
This section is available to paid users only. Please upgrade to access this part.
Upgrade NowMindmap
This section is available to paid users only. Please upgrade to access this part.
Upgrade NowKeywords
This section is available to paid users only. Please upgrade to access this part.
Upgrade NowHighlights
This section is available to paid users only. Please upgrade to access this part.
Upgrade NowTranscripts
This section is available to paid users only. Please upgrade to access this part.
Upgrade NowBrowse More Related Video
ISTQB FOUNDATION 4.0 | Tutorial 35 | Branch Testing & Branch Coverage | Test Case Techniques | CTFL
ISTQB FOUNDATION 4.0 | Tutorial 34 | Statement Testing | Statement Coverage | Test Techniques | CTFL
Branch Coverage - Georgia Tech - Software Development Process
Statement Coverage - Georgia Tech - Software Development Process
CH05.L08 . Conclusion
0204: Coverage measurement
5.0 / 5 (0 votes)