Path Testing in Software Engineering Last Updated : 30 Jan, 2024 Summarize Comments Improve Suggest changes Share Like Article Like Report Path Testing is a method that is used to design the test cases. In the path testing method, the control flow graph of a program is designed to find a set of linearly independent paths of execution. In this method, Cyclomatic Complexity is used to determine the number of linearly independent paths and then test cases are generated for each path. It gives complete branch coverage but achieves that without covering all possible paths of the control flow graph. McCabe's Cyclomatic Complexity is used in path testing. It is a structural testing method that uses the source code of a program to find every possible executable path. Path Testing ProcessPath Testing Control Flow Graph: Draw the corresponding control flow graph of the program in which all the executable paths are to be discovered.Cyclomatic Complexity: After the generation of the control flow graph, calculate the cyclomatic complexity of the program using the following formula.McCabe's Cyclomatic Complexity = E - N + 2P Where, E = Number of edges in the control flow graph N = Number of vertices in the control flow graph P = Program factor Make Set: Make a set of all the paths according to the control flow graph and calculate cyclomatic complexity. The cardinality of the set is equal to the calculated cyclomatic complexity.Create Test Cases: Create a test case for each path of the set obtained in the above step.Path Testing TechniquesControl Flow Graph: The program is converted into a control flow graph by representing the code into nodes and edges.Decision to Decision path: The control flow graph can be broken into various Decision to Decision paths and then collapsed into individual nodes.Independent paths: An Independent path is a path through a Decision to Decision path graph that cannot be reproduced from other paths by other methods.Advantages of Path TestingThe path testing method reduces the redundant tests.Path testing focuses on the logic of the programs.Path testing is used in test case design.Disadvantages of Path TestingA tester needs to have a good understanding of programming knowledge or code knowledge to execute the tests.The test case increases when the code complexity is increased.It will be difficult to create a test path if the application has a high complexity of code.Some test paths may skip some of the conditions in the code. It may not cover some conditions or scenarios if there is an error in the specific paths. Comment More infoAdvertise with us Next Article Path Testing in Software Engineering P pp_pankaj Follow Improve Article Tags : Software Engineering Software Testing Similar Reads Layered Technology in Software Engineering Software engineering is a fully layered technology, to develop software we need to go from one layer to another. All the layers are connected and each layer demands the fulfillment of the previous layer. Fig: The diagram shows the layers of software development Just as software engineering requires 2 min read Software Engineering Tutorial Software Engineering is a subdomain of Engineering in which you learn to develop, design, test, and maintain software using a systematic and structured approach. Software is a collection of programs. And that programs are developed by software engineers In this Software Engineering Tutorial, you wil 7 min read What is the Need of Software Engineering? Pre-requisites: Software Engineering | Introduction to Software Engineering Software engineering is a technique through which we can develop or create software for computer systems or any other electronic devices. It is a systematic, scientific and disciplined approach to the development, functionin 4 min read Introduction to Software Engineering Software is a program or set of programs containing instructions that provide the desired functionality. Engineering is the process of designing and building something that serves a particular purpose and finds a cost-effective solution to problems. Table of ContentWhat is Software Engineering?Key P 11 min read Software Processes in Software Engineering Software is the set of instructions in the form of programs to govern the computer system and to process the hardware components. To produce a software product the set of activities is used. This set is called a software process. Table of Content What are Software Processes?Components of SoftwareKey 8 min read Like