用大模型生成智能执行路径,提升安卓代码异味检测覆盖率。
DynamicsLLM: a Dynamic Analysis-based Tool for Generating Intelligent Execution Traces Using LLMs to Detect Android Behavioural Code Smells
- 用大模型生成针对性执行序列,动态触发代码异味
- 在少量操作下覆盖三倍于原工具的异味事件
- 特别适合活动少的应用,适合质量检测开发者
移动应用已成为日常生活必需品,代码质量至关重要。行为代码异味是源码中导致运行时异常行为的特征,影响性能、能耗和内存。Dynamics 是当前最先进的基于工具的方法,虽优于静态分析,但存在高漏检率。大语言模型(LLMs)在多个领域取得进展,具备生成智能执行轨迹的潜力,可有效触发代码异味。本文提出:(1) DynamicsLLM,利用 LLM 智能生成执行轨迹以增强 Dynamics;(2) 针对活动少的应用设计混合方法,提升事件覆盖;(3) 在 F-DROID 的 333 个应用上进行验证。结果表明,在有限操作下,配置 100% LLM 时,DynamicsLLM 覆盖的异味事件是 Dynamics 的三倍;混合方法使活动少的应用覆盖率提升 25.9%;12.7% 原工具无法触发的异味事件被成功激活。
原文摘要 · Abstract (English)
Mobile apps have become essential of our daily lives, making code quality a critical concern for developers. Behavioural code smells are characteristics in the source code that induce inappropriate code behaviour during execution, which negatively impact software quality in terms of performance, energy consumption, and memory. Dynamics, the latest state-of-the-art tool-based method, is highly effective at detecting Android behavioural code smells. While it outperforms static analysis tools, it suffers from a high false negative rate, with multiple code smell instances remaining undetected. Large Language Models (LLMs) have achieved notable advances across numerous research domains and offer significant potential for generating intelligent execution traces, particularly for detecting behavioural code smells in Android mobile applications. By intelligent execution trace, we mean a sequence of events generated by specific actions in a way that triggers the identification of a given behaviour. We propose the following three main contributions in this paper: (1) DynamicsLLM, an enhanced implementation of the Dynamics method that leverages LLMs to intelligently generate execution traces. (2) A novel hybrid approach designed to improve the coverage of code smell-related events in applications with a small number of activities. (3) A comprehensive validation of DynamicsLLM on 333 mobile applications from F-DROID, including a comparison with the Dynamics tool. Our results show that, under a limited number of actions, DynamicsLLM configured with 100% LLM covers three times more code smell-related events than Dynamics. The hybrid approach improves LLM coverage by 25.9% for apps containing few activities. Moreover, 12.7% of the code smell-related events that cannot be triggered by Dynamics are successfully triggered by our tool.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。