Affiliation:
1. University of Waterloo, Canada and The Hong Kong University of Science and Technology, China
2. University of Waterloo, Canada
3. Tsinghua University, China
4. The Hong Kong University of Science and Technology, China
Abstract
Program reduction is a highly practical, widely demanded technique to help debug language tools, such as compilers, interpreters and debuggers. Given a program
P
that exhibits a property ψ, conceptually, program reduction iteratively applies various program transformations to generate a vast number of variants from
P
by deleting certain tokens and returns the minimal variant preserving ψ as the result.
A program reduction process inevitably generates duplicate variants, and the number of them can be significant. Our study reveals that on average 61.8% and 24.3% of the generated variants in two representative program reducers HDD and Perses, respectively, are duplicates. Checking them against ψ is thus redundant and unnecessary, which wastes time and computation resources. Although it seems that simply caching the generated variants can avoid redundant property tests, such a trivial method is impractical in the real world due to the significant memory footprint. Therefore, a memory-efficient caching scheme for program reduction is in great demand.
This study is the first effort to conduct a systematic, extensive analysis of memory-efficient caching schemes for program reduction. We first propose to use two well-known compression methods,
ZIP
and
SHA
, to compress the generated variants before they are stored in the cache. Furthermore, our keen understanding on the program reduction process motivates us to propose a novel, domain-specific, both memory and computation-efficient caching scheme,
R
efreshable
C
ompact
C
aching
(
RCC
). Our key insight is two-fold: ① by leveraging the correlation between variants and the original program
P
, we losslessly encode each variant into an
equivalent
,
compact
,
canonical
representation; ② periodically, stale cache entries, which will never be accessed, are timely removed to minimize the memory footprint over time.
Our extensive evaluation on 31 real-world C compiler bugs demonstrates that caching schemes help avoid issuing redundant queries by 61.8% and 24.3% in HDD and Perses, respectively; correspondingly, the runtime performance is notably boosted by 22.8% and 18.2%. With regard to the memory efficiency, all three methods use less memory than the state-of-the-art string-based scheme
STR
. Specifically,
ZIP
and
SHA
cut down the memory footprint by more than 80% and 90% in both Perses and HDD compared to
STR
; moreover, the highly-scalable, domain-specific
RCC
dominates peer schemes, and outperforms the
SHA
by 96.4% and 91.74% in HDD and Perses, respectively.
Funder
Natural Sciences and Engineering Research Council of Canada (NSERC) through the Discovery Grant, a project under Waterloo-Huawei Joint Innovation Lab, and CFI-JELF Project
Publisher
Association for Computing Machinery (ACM)
Reference53 articles.
1. Dimitris Andreour. 2015. ObjectExplorer. Retrieved May 29 2023 from https://github.com/DimitrisAndreou/memory-measurer
2. Antoine Balestrat. 2012. CCG: A Random C Code Generator. Retrieved May 29 2023 from https://github.com/Merkil/ccg/
3. David W. Binkley, Nicolas Gold, Mark Harman, Syed S. Islam, Jens Krinke, and Shin Yoo. 2014. ORBS: Language-independent program slicing. In Proceedings of the 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering, (FSE-22). Shing-Chi Cheung, Alessandro Orso, and Margaret-Anne D. Storey (Eds.), ACM, 109–120. DOI:10.1145/2635868.2635893
4. Bobby R. Bruce, Tianyi Zhang, Jaspreet Arora, Guoqing Harry Xu, and Miryung Kim. 2020. JShrink: In-depth investigation into debloating modern Java applications. In Proceedings of the ESEC/FSE’20: 28th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering, Virtual Event. Prem Devanbu, Myra B. Cohen, and Thomas Zimmermann (Eds.), ACM, 135–146. DOI:10.1145/3368089.3409738
5. Fundamental Limits of Combinatorial Multi-Access Caching
Cited by
3 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Towards Understanding the Bugs in Solidity Compiler;Proceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis;2024-09-11
2. LPR: Large Language Models-Aided Program Reduction;Proceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis;2024-09-11
3. T-Rec: Fine-Grained Language-Agnostic Program Reduction Guided by Lexical Syntax;ACM Transactions on Software Engineering and Methodology;2024-08-30