Fault localization is to identify faulty source code. It could be done on various granularities, e.g., classes, methods, and statements. Most of the automated fault localization (AFL) approaches are coarse-grained because it is challenging to accurately locate fine-grained faulty software elements, e.g., statements. SBFL, based on dynamic execution of test cases only, is simple, intuitive, and generic (working on various granularities). However, its accuracy deserves significant improvement. To this end, in this paper, we propose a hybrid fine-grained AFL approach based on both dynamic spectrums and static statement types. The rationale of the approach is that some types of statements are significantly more/less error-prone than others, and thus statement types could be exploited for fault localization. On a crop of faulty programs, we compute the error-proneness for each type of statements, and assign priorities to special statement types that are steadily more/less error-prone than others. For a given faulty program under test, we first leverage traditional spectrum-based fault localization algorithm to identify all suspicious statements and to compute their suspicious scores. For each of the resulting suspicious statements, we retrieve its statement type as well as the special priority associated with the type. The final suspicious score is the product of the SBFL suspicious score and the priority assigned to the statement type. A significant advantage of the approach is that it is simple and intuitive, making it efficient and easy to interpret/implement. We evaluate the proposed approach on widely used benchmark Defects4J. The evaluation results suggest that the proposed approach outperforms widely used SBFL, reducing the absolute waste effort (AWE) by 9.3% on average.
翻译:错误本地化是用来识别错误源代码。 它可以针对各种颗粒, 例如, 类别、 方法和语句。 多数自动错误本地化( AFL) 方法都是粗略的, 因为精确定位微小错误软件元素( 例如, 语句) 具有挑战性。 SBFL 仅仅基于动态执行测试案例, 简单、 直观和通用( 工作于各种颗粒) 。 但是, 它的准确性值得大幅改进。 为此, 在本文中, 我们提出一种基于动态频谱和静态声明类型的混合精细精细的 AFL 方法。 这种方法的原理是, 某些类型的声明比其他的错误软件要容易发现错误错误。 某些声明类型可能会被利用为错误本地化。 我们计算出每种类型声明的错误易读取性, 给特殊声明类型( 更稳定/ 不易出错误的) 。 对于一个测试中的错误, 我们首先利用传统的光谱缩缩缩略的语句使用传统的本地化方法, 将所有可疑的Sl 格式的排序算算出S 。