Mining Long Tail Bugs: Identifying Rare and Overlooked Issues in Code
Open Access
- 30 June 2026
- journal article
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Software Engineering
- Vol. 3 (FSE) , 943-966
Abstract
Using data mining to extract frequent code patterns for bug detection has proven effective. However, prior studies have overlooked the prevalence of infrequent ( rare ) patterns, even though violations of such patterns can also lead to bugs. In this paper, we present LTMiner, which mines rare patterns from large-scale projects and detects potential bugs by checking for violations of these patterns. In practice, rare patterns far outnumber frequent ones and lack strong statistical support. Consequently, we face a pattern explosion, and many rare patterns and their violations are uninteresting. LTMiner addresses this by using instance-based ranking and filtering to prioritize violations of rare patterns. It further employs a large language model (LLM) as a domain expert to audit top-ranked violations; mined information supports in-context learning, and task decomposition and self-reflection mitigate possible hallucinations. This pipeline effectively curbs pattern explosion and false positives, uncovering previously unknown bugs in large-scale projects at an acceptable cost. Applied to Linux kernel 6.12.1, LTMiner identified 42 previously unknown bugs, 27 of which have been confirmed by developers. These results indicate that, although rare-pattern bugs are sparse, a considerable number remain and exhibit a non-negligible long tail. We believe that rare-pattern bugs constitute a promising blue ocean for bug detection.Keywords
Funding Information
- National Key Research and Development Program of China (2024YFB4506200)
This publication has 71 references indexed in Scilit:
- Pattern Mining: Current Challenges and Opportunities2022
- Guided pattern mining for API misuse detection by change-based code analysisAutomated Software Engineering, 2021
- Identifying risk factors for adverse diseases using dynamic rare association rule miningExpert Systems with Applications, 2018
- Development of a new metric to identify rare patterns in association analysis: The case of analyzing diabetes complicationsExpert Systems with Applications, 2018
- Finding Anomalies in SCADA Logs Using Rare Sequential Pattern Mining2016
- Mining fuzzy specific rare itemsets for education dataKnowledge-Based Systems, 2011
- RP-Tree: Rare Pattern Tree Mining2011
- WiFi Miner: An Online Apriori-Infrequent Based Wireless Intrusion SystemLecture Notes in Computer Science, 2010
- Finding Sporadic Rules Using Apriori-Inverse2005
- KNN Model-Based Approach in Classification2003