Code Coverage Criteria for Asynchronous Programs
Mohammad Ganji, Saba Alimadadi, Frank Tip
Abstract
Asynchronous software often exhibits complex and error-prone behaviors that should be tested thoroughly. Code coverage has been the most popular metric to assess test suite quality. However, traditional code coverage criteria do not adequately reect completion, interactions, and error handling of asynchronous operations.
This paper proposes novel test adequacy criteria for measuring: (i) completion of asynchronous operations in terms of both successful and exceptional execution, (ii) registration of reactions for handling both possible outcomes, and (iii) execution of said reactions through tests. We implement JS, a tool for automatically measuring coverage according to these criteria in JavaScript applications, as an interactive plug-in for Visual Studio Code.
An evaluation of JS on 20 JavaScript applications shows that the proposed criteria can help improve assessment of test adequacy, complementing traditional criteria. According to our investigation of 15 real GitHub issues concerned with asynchrony, the new criteria can help reveal faulty asynchronous behaviors that are untested yet are deemed covered by traditional coverage criteria. We also report on a controlled experiment with 12 participants to investigate the usefulness of JS in realistic settings, demonstrating its eectiveness in improving programmers' ability to assess test adequacy and detect untested behavior of asynchronous code.
• Software and its engineering ! Software testing and debugging.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext bce01acc-ec0d-4424-a828-e8124f7aeeb7Cited by top-tier papers1
Ask how each one uses itBuilds on6
- A Sense of Time for JavaScript and Node.js: First-Class Timeouts as a Cure for Event Handler PoisoningJames C. Davis, Eric R. Williamson, Dongyoon LeeUSENIX Security 2018 · 54 citations
- Automatic migration from synchronous to asynchronous JavaScript APIsSatyajit Gokhale, Alexi Turcotte, Frank TipOOPSLA 2021 · 23 citations
- Nessie: Automatically Testing JavaScript APIs with Asynchronous CallbacksEllen Arteca, Sebastian Harner, Michael Pradel, Frank TipICSE 2022 · 12 citations
- Race Detection for Event-Driven Node.js ApplicationsXiaoning Chang, Wensheng Dou, Jun Wei, Tao Huang et al.ASE 2021 · 6 citations
- DrAsync: Identifying and Visualizing Anti-Patterns in Asynchronous JavaScriptAlexi Turcotte, Michael D. Shah, Mark W. Aldrich, Frank TipICSE 2022 · 5 citations
Related papers
- Feature-Sensitive Coverage for Conformance Testing of Programming Language ImplementationsJihyeok Park, Dongjun Youn, Kanguk Lee, Sukyoung RyuPLDI 2023 · 3 citations
- Correlations between deep neural network model coverage criteria and model qualityShenao Yan, Guanhong Tao, Xuwei Liu, Juan Zhai et al.FSE 2020 · 75 citations
- Measuring and Mitigating Gaps in Structural TestingSoneya Binta Hossain, Matthew B. Dwyer, Sebastian G. Elbaum, Anh Nguyen-TuongICSE 2023 · 7 citations
- Generalizing Test Cases for Comprehensive Test Scenario CoverageBinhang Qi, Yun Lin, Xinyi Weng, Chenyan Liu et al.FSE 2026 · 1 citation
- SoK: State of the Krawlers - Evaluating the Effectiveness of Crawling Algorithms for Web Security MeasurementsAleksei Stafeev, Giancarlo PellegrinoUSENIX Security 2024 · 12 citations
