We use cookies to improve your experience with our site.

一种从多种API数据中挖掘有效的方法调用时序约束的方法

Mining Effective Temporal Specifications from Heterogeneous API Data

  • 摘要: 1.本文的创新点
    • 提出了一种综合利用多种API数据挖掘时序约束的方法,这些约束能为缺陷检测提供有效的依据。
    • 针对基于客户端代码挖掘约束的方法的不足,提出了对时序约束的优化方法。
    • 在9个开源的项目上对本方法进行了验证,实验结果表明,本方法所挖掘出的约束的平均准确率高达97.2%。
    2.实现方法
    本方法综合利用了API的源码、API的客户程序以及API的方法注释等多种信息进行方法调用的时序约束的挖掘。本方法首先使用基于客户端代码的约束挖掘来得到一些潜在的约束,然后利用API的源代码对这些约束进行优化。分析API的客户端程序的调用情况,可以总结出一些常用的方法调用模式,这些方法调用模式反映了方法调用的约束。同时,通过分析API源码中的异常抛出有关的特征,可以推理出一些方法调用的约束。例如,错误的方法调用序列通常会导致异常的抛出。此外,方法的注释中往往会明确地声明一些方法调用的约束。API源码和方法注释中的信息可以用来验证从API客户端程序中挖掘出的约束是否正确。因此,综合这三方面的信息,可以高效地挖掘出准确的方法调用的时序约束,以便进行相关的软件缺陷的检查。
    3.结论及未来待解决的问题
    实验表明,综合利用API的源码、API的客户程序以及API的方法注释等多种信息,可以高效地挖掘出准确的方法调用的时序约束,以便进行相关的软件缺陷的检查。
    文章的下一步工作包括两个方面:
    第一,探索其他的利用多种API信息的方式。例如,可以将所有在客户端程序中出现的方法调用的序列作为候选约束,然后利用API的源代码进行优化;和本文的方法相比,这样可以降低约束挖掘的漏报率。
    第二,探索对更加复杂的约束进行处理,例如用自动机或者关联规则表示的时序约束。

     

    Abstract: Temporal specifications for Application Programming Interfaces (APIs) serve as an important basis for many defect detection tools. As these specifications are often not well documented, various approaches have been proposed to automatically mine specifications typically from API library source code or from API client programs. However, the library-based approaches take substantial computational resources and produce rather limited useful specifications, while the client-based approaches suffer from high false positive rates. To address the issues of existing approaches, we propose a novel specification mining approach, called MineHEAD, which exploits heterogeneous API data, including information from API client programs as well as API library source code and comments, to produce effective specifications for defect detection with low cost. In particular, MineHEAD first applies client-based specification mining to produce a collection of candidate specifications, and then exploits the related library source code and comments to identify and refine the real specifications from the candidates. Our evaluation results on nine open source projects show that MineHEAD produces effective specifications with average precision of 97.2%.

     

/

返回文章
返回