skip to main content
10.1145/2786805.2786863acmconferencesArticle/Chapter ViewAbstractPublication PagesfseConference Proceedingsconference-collections
research-article

Automatically computing path complexity of programs

Published: 30 August 2015 Publication History

Abstract

Recent automated software testing techniques concentrate on achieving path coverage. We present a complexity measure that provides an upper bound for the number of paths in a program, and hence, can be used for assessing the difficulty of achieving path coverage for a given method. We define the path complexity of a program as a function that takes a depth bound as input and returns the number of paths in the control flow graph that are within that bound. We show how to automatically compute the path complexity function in closed form, and the asymptotic path complexity which identifies the dominant term in the path complexity function. Our results demonstrate that path complexity can be computed efficiently, and it is a better complexity measure for path coverage compared to cyclomatic complexity and NPATH complexity.

References

[1]
Abdulbaki Aydin, Lucas Bang, and Tevfik Bultan. Automata-based model counting for string constraints. In Proc. 27th Int. Conf. Computer Aided Verification (CAV), 2015.
[2]
Clark W. Barrett, David L. Dill, and Aaron Stump. A framework for cooperating decision procedures. In Proc. 17th Int. Conf. Automated Deduction (CADE), pages 79–98, 2000.
[3]
N. Biggs. Algebraic Graph Theory. Cambridge Mathematical Library. Cambridge University Press, 1993.
[4]
R. Burden and J. Faires. Numerical Analysis. Cengage Learning, 2010.
[5]
Cristian Cadar, Daniel Dunbar, and Dawson R. Engler. KLEE: unassisted and automatic generation of high-coverage tests for complex systems programs. In Proc. 8th Symp. Operating Systems Design and Implementation (OSDI), pages 209–224, 2008.
[6]
Christoph Csallner and Yannis Smaragdakis. Check ’n’ crash: combining static checking and testing. In Proc. 27th Int. Conf. Software Engineering (ICSE), pages 422–431, 2005.
[7]
Christoph Csallner, Yannis Smaragdakis, and Tao Xie. Dsd-crasher: A hybrid analysis tool for bug finding. ACM Trans. Softw. Eng. Methodol., 17(2), 2008.
[8]
Leonardo Mendon¸ ca de Moura and Nikolaj Bjørner. Z3: an efficient SMT solver. In Proc. 14th Int. Conf. Tools and Algorithms for the Construction and Analysis of Systems (TACAS), pages 337–340, 2008.
[9]
Nishant Doshi. Approximation for the path complexity of binary search tree. CoRR, abs/1404.4692, 2014.
[10]
A. Erdelyi. Asymptotic Expansions. Dover, 1956.
[11]
Philippe Flajolet and Andrew M. Odlyzko. Singularity analysis of generating functions. SIAM J. Discrete Math., 3(2):216–240, 1990.
[12]
Philippe Flajolet and Robert Sedgewick. Analytic Combinatorics. Cambridge University Press, New York, NY, USA, 1 edition, 2009.
[13]
Cormac Flanagan, K. Rustan M. Leino, Mark Lillibridge, Greg Nelson, James B. Saxe, and Raymie Stata. Extended static checking for java. In Proc. 2002 Conf. Programming Language Design and Implementation (PLDI), pages 234–245, 2002.
[14]
Geoffrey K. Gill and Chris F. Kemerer. Cyclomatic complexity density and software maintenance productivity. IEEE Trans. Software Eng., 17(12):1284–1288, 1991.
[15]
Patrice Godefroid. Model checking for programming languages using verisoft. In Proc. 24th Symp. Principles of Programming Languages (POPL), pages 174–186, 1997.
[16]
Patrice Godefroid, Nils Klarlund, and Koushik Sen. DART: directed automated random testing. In Proceedings of the 2005 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), pages 213–223, 2005.
[17]
Bhargav S. Gulavani and Sumit Gulwani. A numerical abstract domain based on expression abstraction and max operator with application in timing analysis. In Proc. 20th Int. Conf. Computer Aided Verification (CAV), pages 370–384, 2008.
[18]
Sumit Gulwani, Sagar Jain, and Eric Koskinen. Control-flow refinement and progress invariants for bound analysis. SIGPLAN Not., 44(6):375–385, June 2009.
[19]
Sumit Gulwani, Bill McCloskey, and Ashish Tiwari. Lifting abstract interpreters to quantified logical domains. In Proc. 35th Symp. Principles of Programming Languages (POPL), pages 235–246, 2008.
[20]
Sumit Gulwani and Florian Zuleger. The reachability-bound problem. SIGPLAN Not., 45(6):292–304, June 2010.
[21]
Brian Henderson-Sellers, Yagna Raj Pant, and June M. Vemer. Cyclomatic complexity: theme and variations. Australasian J. of Inf. Systems, 1(1), 1993.
[22]
Dennis G. Kafura and Geereddy R. Reddy. The use of software complexity metrics in software maintenance. IEEE Trans. Software Eng., 13(3):335–343, 1987.
[23]
Taghi M. Khoshgoftaar and John C. Munson. Predicting software development errors using software complexity metrics. IEEE Journal on Selected Areas in Communications, 8(2):253–261, 1990.
[24]
James C. King. Symbolic execution and program testing. Commun. ACM, 19(7):385–394, 1976.
[25]
S.G. Krantz. The Handbook of Complex Variables. Birkhäuser, 1999.
[26]
Loi Luu, Shweta Shinde, Prateek Saxena, and Brian Demsky. A model counter for constraints over unbounded strings. In Proc. 2014 Conf. Programming Language Design and Implementation (PLDI), page 57, 2014.
[27]
Thomas J. McCabe. A complexity measure. IEEE Trans. Software Eng., 2(4):308–320, 1976.
[28]
Beth McColl and James C. McKim. Evaluating and extending npath as a software complexity measure. Journal of Systems and Software, 17(3):275–279, 1992.
[29]
Brian A. Nejmeh. NPATH: A measure of execution path complexity and its applications. Commun. ACM, 31(2):188–200, 1988.
[30]
Corina S. Pasareanu, Willem Visser, David H. Bushnell, Jaco Geldenhuys, Peter C. Mehlitz, and Neha Rungta. Symbolic pathfinder: integrating symbolic execution with model checking for java bytecode analysis. Autom. Softw. Eng., 20(3):391–425, 2013.
[31]
Koushik Sen, Darko Marinov, and Gul Agha. Cute: a concolic unit testing engine for c. In Proc. 10th European Software Engineering Conf. and 13th Int. Symp. Foundations of Software Engineering (ESEC/FSE), pages 263–272, 2005.
[32]
Richard P. Stanley. Enumerative Combinatorics: Volume 1. Cambridge University Press, New York, NY, USA, 2nd edition, 2011.
[33]
I. Stewart. Galois Theory, Third Edition. Chapman Hall/CRC Mathematics Series. Taylor & Francis, 2003.
[34]
J. Stewart. Calculus. Cengage Learning, 2007.
[35]
Willem Visser, Klaus Havelund, Guillaume P. Brat, Seungjoon Park, and Flavio Lerda. Model checking programs. Autom. Softw. Eng., 10(2):203–232, 2003.
[36]
Introduction Overview Computing Path Complexity Comparison with Other Complexity Measures Implementation & Experiments Conclusions Replication Package References

Cited By

View all
  • (2024)Interprocedural Path Complexity AnalysisProceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3650212.3652118(162-173)Online publication date: 11-Sep-2024
  • (2024)Path Complexity Analysis for Interprocedural CodeProceedings of the 2024 IEEE/ACM 46th International Conference on Software Engineering: Companion Proceedings10.1145/3639478.3643527(404-405)Online publication date: 14-Apr-2024
  • (2024)The ACPATH Structural Complexity Metric2024 IEEE 24th International Conference on Software Quality, Reliability and Security (QRS)10.1109/QRS62785.2024.00022(127-138)Online publication date: 1-Jul-2024
  • Show More Cited By

Index Terms

  1. Automatically computing path complexity of programs

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    ESEC/FSE 2015: Proceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering
    August 2015
    1068 pages
    ISBN:9781450336758
    DOI:10.1145/2786805
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

    Sponsors

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 30 August 2015

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. Path complexity
    2. automated testing
    3. path coverage

    Qualifiers

    • Research-article

    Funding Sources

    Conference

    ESEC/FSE'15
    Sponsor:

    Acceptance Rates

    Overall Acceptance Rate 112 of 543 submissions, 21%

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)23
    • Downloads (Last 6 weeks)3
    Reflects downloads up to 07 Mar 2025

    Other Metrics

    Citations

    Cited By

    View all
    • (2024)Interprocedural Path Complexity AnalysisProceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3650212.3652118(162-173)Online publication date: 11-Sep-2024
    • (2024)Path Complexity Analysis for Interprocedural CodeProceedings of the 2024 IEEE/ACM 46th International Conference on Software Engineering: Companion Proceedings10.1145/3639478.3643527(404-405)Online publication date: 14-Apr-2024
    • (2024)The ACPATH Structural Complexity Metric2024 IEEE 24th International Conference on Software Quality, Reliability and Security (QRS)10.1109/QRS62785.2024.00022(127-138)Online publication date: 1-Jul-2024
    • (2023)Path Complexity of Recursive FunctionsProceedings of the 45th International Conference on Software Engineering: Companion Proceedings10.1109/ICSE-Companion58688.2023.00083(308-310)Online publication date: 14-May-2023
    • (2023)Path Complexity Correlates with Source Code Comprehension Effort Indicators2023 IEEE/ACM 31st International Conference on Program Comprehension (ICPC)10.1109/ICPC58990.2023.00041(266-274)Online publication date: May-2023
    • (2023)Formalizing Path Explosion for Recursive Functions via Asymptotic Path Complexity2023 IEEE/ACM 11th International Conference on Formal Methods in Software Engineering (FormaliSE)10.1109/FormaliSE58978.2023.00016(76-85)Online publication date: May-2023
    • (2023)TPGen: A Self-stabilizing GPU-Based Method for Test and Prime Paths GenerationFundamentals of Software Engineering10.1007/978-3-031-42441-0_4(40-54)Online publication date: 30-Aug-2023
    • (2022)Devising optimal integration test orders using cost–benefit analysis基于成本收益分析的集成测试序列生成优化方法Frontiers of Information Technology & Electronic Engineering10.1631/FITEE.210046623:5(692-714)Online publication date: 25-May-2022
    • (2021)Metrinome: Path Complexity Predicts Symbolic Execution Path Explosion2021 IEEE/ACM 43rd International Conference on Software Engineering: Companion Proceedings (ICSE-Companion)10.1109/ICSE-Companion52605.2021.00028(29-32)Online publication date: May-2021
    • (2020)Thread Scheduling Sequence Generation Based on All Synchronization Pair Coverage CriteriaInternational Journal of Software Engineering and Knowledge Engineering10.1142/S021819402050005930:01(97-118)Online publication date: 27-Feb-2020
    • Show More Cited By

    View Options

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Figures

    Tables

    Media

    Share

    Share

    Share this Publication link

    Share on social media