Basis path testing: Difference between revisions

Content deleted Content added
replaced 'mathematical path' with 'linearly independent path' because the meaning of 'mathematical' is ambiguous in this context. I am a lecturer in software engineering.
 
(24 intermediate revisions by 8 users not shown)
Line 1:
In [[software engineering]], '''basis path testing''', or '''structured testing''',<ref name="nist">{{cite web|
{{notability|date=May 2012}}
url=http://www.mccabe.com/pdf/mccabe-nist235r.pdf| title=Structured Testing: A Testing Methodology Using the Cyclomatic Complexity Metric| author=Arthur H. Watson and Thomas J. McCabe| year=1996|publisher=NIST Special Publication 500-235}}</ref> is a [[White-box testing|white box method]] for designing [[test case (software)|test case]]s. The method analyzes the [[control-flow graph]] of a program to find a set of linearly independent paths of [[execution (computing)|execution]]. The method normally uses McCabe [[cyclomatic complexity]] to determine the number of linearly independent paths and then generates test cases for each path thus obtained.<ref name="Westfall2008">{{cite book|author=Linda Westfall|title=The Certified Software Quality Engineer Handbook|year=2008|publisher=ASQ Quality Press|isbn=978-0-87389-730-3|pages=436–437}}</ref> Basis path testing guarantees complete [[branch coverage]] (all edges of the [[control-flow graph]]), but achieves that without covering all possible [[Path (graph theory)|paths]] of the control-flow graph{{snd}} the latter is usually too costly.<ref name="SrikantShankar2002">{{cite book|author1=Y.N. Srikant|author2=Priti Shankar|title=The Compiler Design Handbook: Optimizations and Machine Code Generation|year=2002|publisher=CRC Press|isbn=978-1-4200-4057-9|page=249}}</ref> Basis path testing has been widely used and studied.<ref name="Binder2000">{{cite book|author=Robert V. Binder|title=Testing Object-oriented Systems: Models, Patterns, and Tools|year=2000|publisher=Addison-Wesley Professional|isbn=978-0-201-80938-1|page=[https://archive.org/details/testingobjectori00bind/page/378 378]|url-access=registration|url=https://archive.org/details/testingobjectori00bind/page/378}}</ref>
'''Basis path testing''', or '''structured testing''', is a method for designing [[test case]]s intended to examine each possible linearly independent path of [[Execution (computing)|execution]] at least once. A linearly independent path is a sequence of commands without possible branch points. A branch point exists if a conditional permits alternative execution paths depending on the outcome of a logical test.
 
By creating a set of basis paths, creating and executing tests for these paths, 100% statement and 100% branch coverage can be guaranteed.
 
==See also==
* [[Decision-to-decision path|DD-path]] testing
* [[Cyclomatic complexity]]
 
==References==
{{reflist}}
 
==Further reading==
== External links ==
* {{cite book|author=Paul C. Jorgensen|title=Software Testing: A Craftsman's Approach, Second Edition|year=2002|publisher=CRC Press|isbn=978-0-8493-0809-3|pages=146–150}}
* [http://hissa.nist.gov/basicpathtest/ What is Basis Path Testing?] from the National Institute for Science and Technology
* {{cite book|author1=Alan Page|author2=Ken Johnston|author3=Bj Rollison|title=How We Test Software at Microsoft|year=2008|publisher=Microsoft Press|isbn=978-0-7356-3831-0|at=chapter 6}}
 
[[Category:Software testing]]
Basis path testing is a white box testing technique that is used to test the code based on control flow. The method uses a control flowchart and a control flow graph to convert the code into a model and then derive independent test paths from it.
 
Each test path corresponds to one possible execution in the software. These test paths are then used to generate test cases. The test cases are then used to verify the code for its correctness.
 
{{Software-eng-stub}}