一句话:实证分析 Apollo 与 Autoware,揭示自动驾驶软件中代码克隆普遍存在并关联缺陷、共修改与跨模块传播。
随着自动驾驶软件日益复杂,代码克隆虽可加速开发,却可能影响可维护性,但此前缺乏针对该领域的系统研究。本文对 Apollo 和 Autoware 开展实证研究,统计分析代码克隆的分布、模块差异及其与缺陷和共修改的关系。结果表明,约 30% 的代码行涉及克隆,超过 50% 的文件包含克隆;相当一部分克隆引发了缺陷和共修改。按模块看,Perception、Planning、Canbus 和 Sensing 更易出现克隆,也更易出现缺陷倾向和共修改克隆。此外,跨模块克隆会传播缺陷与共修改,削弱软件的模块化设计。
With the continuous improvement of artificial intelligence technology, autonomous driving technology has been greatly developed. Hence automated driving software has drawn more and more attention from both researchers and practitioners. Code clone is a commonly used to speed up the development cycle in software development, but many studies have shown that code clones may affect software maintainability. Currently, there is little research investigating code clones in automated driving software. To bridge this gap, we conduct a comprehensive experience study on the code clones in automated driving software. Through the analysis of Apollo and Autoware, we have presented that code clones are prevalent in automated driving software. about 30% of code lines are involved in code clones and more than 50% of files contain code clones. Moreover, a notable portion of these code clones has caused bugs and co-modifications. Due to the high complexity of autonomous driving, the automated driving software is often designed to be modular, with each module responsible for a single task. When considering each module individually, we have found that Perception, Planning, Canbus, and Sensing modules are more likely to encounter code clones, and more likely to have bug-prone and co-modified clones. Finally, we have shown that there exist cross-module clones to propagate bugs and co-modifications in different modules, which undermine the software's modularity.