在软件开发中, 错误定位是修复软件缺陷的必要前提. 为此, 研究者们提出了一系列自动化的错误定位方法. 这些方法利用了测试用例运行时的覆盖路径和运行结果等信息, 大幅减少了定位错误代码的难度. 在竞争性众包软件开发中, 往往存在多个竞争性实现(解决方案), 提出一种专门面向众包软件工程的错误定位方法. 主要思想是, 在定位错误语句时, 将其多个竞争性实现作为参考程序. 针对程序中的各个语句, 在参考程序中搜索参考语句, 并利用参考语句计算其错误概率. 给定一个错误程序和相应的测试用例, 首先运行测试用例并使用广泛流行的基于频谱的错误定位方法计算其初始错误概率. 然后, 根据此语句与其参考语句的相似性调整错误概率. 在118个真实的错误程序上进行实验, 结果表明所提方法相比基于频谱的方法, 定位错误的成本降低了25%以上.
Fault localization is an essential precondition for repairing in software development. To this end, researchers have proposed automated fault localization (AFL) methods to facilitate the task. Such approaches have taken full advantage of information such as the execution tracks and execution results of given test cases and receive significant effectiveness in reducing the difficulty of fault localization. In competitive crowdsourcing software development, one task could receive multiple competitive implementations (solutions). This study proposes a novel approach for AFL in crowdsourcing software engineering. The key insight of the proposed approach is that when locating faulty statements in a program, it regards competitive implementations as reference programs. By searching for reference statements in reference programs for each statement in buggy program, it calculates the suspicious score of the statement by leveraging its references. Given a set of test cases and a buggy program, the test scenario is run and the initial suspicious score for each statement in the buggy program is calculated by wildly used SBFL approach. After that, suspicious score of each statement is adapted according to its similarity with statements in competitive implementations. The proposed approach is evaluated on 118 real word buggy programs that are accompanied with competitive implementations. The evaluation results suggest that compared with SBFL approaches, the cost of fault localization is reduced by more than 25%.