首页 | 官方网站   微博 | 高级检索  
相似文献
 共查询到20条相似文献,搜索用时 171 毫秒
1.
李正  吴敬征  李明树 《软件学报》2018,29(6):1716-1738
API(Application Programming Interface,应用程序编程接口)在现代软件开发过程中被广泛使用.开发人员通过调用API快速构建项目,节省了大量的时间.但由于API数量众多、文档不够完善、维护更新不及时等原因,使开发人员在学习使用API的过程中面临着严峻的挑战.同时,一旦API使用不正确,程序可能会出现缺陷甚至严重的安全问题.本文通过对API相关文献的深入调研,对近些年来国内外学者在该研究领域取得的成果进行了系统总结.首先,介绍了API的基本概念并分析出影响API使用的三个关键问题:API文档质量不高,调用规约不完整以及API调用序列难以确定;接着,从API文档、调用规约和API推荐三个主要方面对研究成果进行全面的分析;最后,对未来研究可能面临的挑战进行了展望.  相似文献   

2.
在为了完善应用程序编程接口(application programming interface,API)文档,提出了基于程序静态分析和自然语言处理的自动检测和修复API文档缺陷的方法。该方法能够自动检测和修复API文档缺陷。实验中缺陷检测结果的准确率和召回率分别达到74.6%和81.4%,能够较为准确地检测到Java API的文档缺陷。在进一步的实验中还对API文档的修复功能进行了评估,结果表明生成的文档正确且简洁,可以有效地修复API文档缺陷。  相似文献   

3.
刘石  李合  王啸吟  张路  谢冰 《计算机科学》2009,36(8):165-168
通过示例代码学习简单算法的实现和具体API的使用方式是程序开发人员在软件开发中进行软件复用的高效手段,也是使用代码搜索引擎的主要目的.代码搜索引擎从网页搜索技术发展而来,提供对网络上源代码资源的检索功能,能够有效定位与搜索内容相关的代码,为程序开发人员提供帮助.但现有的代码搜索引擎没有在搜索结果中区别API的实现代码与使用代码,搜索结果存在冗余,导致用户无法快速有效地找到提供有用信息的代码片段.为了使用户更好更快地找到代码搜索目标,阐述了应用语法与语义分析技术从区分API实现代码和使用代码、相似代码聚类、搜索结果摘要3个方面对代码搜索结果进行优化的方法,给出了一个代码搜索引擎的实现,并在实例研究中展示了该方法的有效性.  相似文献   

4.
应用程序编程接口(Application Programming Interface,API)在软件开发以及代码复用中有着重要作用。然而,API代码和文档存在的不一致情况会误导API的使用者并降低软件开发效率及其稳定性等。针对Java API异常代码及其文档描述不一致的情况,提出了一种基于静态分析代码语法树及方法之间的调用关系的自动检测方法,为验证方法的有效性,利用JDK中的API源代码包及其相应文档作为测试对象根据实验结果。本方法的检测结果能达到71.5%的准确率以及85.9%的召回率,能够较为准确地识别API文档对程序异常描述不一致问题,对API文档的编写和维护具有指导性意义。  相似文献   

5.
为克服阅读理解源代码的困难,根据现有的软件开发辅助工具的特点,对源代码导读和管理工具进行了深入的分析和研究.针对业界大量使用的Java语言,设计并实现了一个旨在以Java源代码导读为主、并具代码抽取等分析管理功能的交互式软件开发辅助工具Javigator.作为Eclipse的插件,能帮助开发人员快速地阅读理解Java源程序,并支撑对关注代码的快速测试及代码重用.Javigator使用灵活方便,可明显降低开发中理解及管理源代码的难度,提高开发的效率.  相似文献   

6.
曾诚 《计算机工程与设计》2005,26(5):1311-1315,1326
为了实现远程文件管理系统的跨操作系统运行,设计了一套基于Java Socket的远程文件类应用程序接口(API),并在这套API的基础上实现了一个图形界面的Client/Server结构的远程文件管理系统。这套API在形式上类似于Sun JDK本地文件类,开发人员使用这套API能方便快速地实现能满足自身需要的远程文件管理系统。  相似文献   

7.
由于静态代码审计工具具有自动化、不容易出错的特点,开发人员经常使用它来检测代码漏洞,但是检测出的代码漏洞的结果会产生大量的警告信息,开发人员必须手动进行检查和纠正。此工具的缺点是浪费开发人员大量的时间。通过对用户的输入以及敏感数据流的追踪来确定警告的缺陷是否真的被利用,从而减少静态检测工具产生的大量警告数量。同时提供给开发者更多真正能对软件产生威胁的警告信息。针对静态代码审计工具的缺点,研究三种不同的方法来提高静态代码审计工具的性能。第一,对于商业性的静态代码分析工具Coverity,重新分析它的结果,并且从安全的角度创建一组具体的相关警告。第二,对开放的源代码分析工具Findbugs进行修改,并只对被用户输入所污染的代码进行分析。第三,研发灰盒代码审计工具,此工具侧重于Java代码中的跨站脚本攻击XSS(Cross Site Scripting),使用数据流分析的方法来确定漏洞的切入点。实验结果证明工程B使警告数量降低了20%,工程E只产生了2%的警告,降低了工具产生警告的数量,为开发人员提供更多的信息来区分此警告是否是真正的安全威胁。  相似文献   

8.
现有的缺陷预测方法大多数是面向项目或个人的,这些方法或没有区分文件之间和开发人员之间的差异性,或只区分了开发人员的差异性。然而,在软件开发中,开发人员之间和代码文件之间的差异性是同时存在的,而且这些差异性都可能会影响缺陷建模或预测的结果。因此,如果缺陷预测方法忽视这些差异性或忽视其中任意一种,针对整个项目或某个开发人员建立缺陷预测模型均可能会影响预测准确性。针对此问题,提出了一种面向单个文件的个性化缺陷预测方法,即将每个开发人员修改每个代码文件的历史数据都作为单独的数据集,建立对应的缺陷模型,并将之用来预测对应开发人员修改对应文件的缺陷情况。通过实验初步确认了在单个文件的个人缺陷数据充分的情况下该方法能够有效地提高缺陷预测的准确性。  相似文献   

9.
C语言程序代码设计中可能会出现词法缺陷、逻辑缺陷、语法缺陷,在传统模式下主要由程序开发人员根据电子集成驱动器(Integrated Drive Electronics,IDE)编程工具、GNU编译器套件(GNU Compiler Collection,GCC)编译结果检查代码中的错误。研究设计了一种可自动检测代码缺陷的综合管理系统,其核心组成部分为知识库和代码缺陷分析器。利用GCC、开源的代码检测软件、正则表达式匹配错误模式,出具评价报告,并向编程者推荐具有针对性的学习内容,以纠正其错误的编程知识和编程习惯。  相似文献   

10.
针对Java系统再工程的需求,利用Microsoft Office软件中强大的VBA工具,设计开发一款适合部门内部使用,主要用户为SE及PG为主的开发人员的Java源代码分析软件。系统以Java程序级代码分析为主,根据程序的各种引用调用关系,生成树状结构图,展示代码结构,建立结构图与代码的链接,实现代码的快速定位查找,方便开发人员查看代码、理解程序结构,降低了对既存Java应用系统维护的风险和成本。  相似文献   

11.
Many software libraries, especially those commercial ones, provide API documentation in natural languages to describe correct API usages. However, developers may still write code that is inconsistent with API documentation, partially because many developers are reluctant to carefully read API documentation as shown by existing research. As these inconsistencies may indicate defects, researchers have proposed various detection approaches, and these approaches need many known specifications. As it is tedious to write specifications manually for all APIs, various approaches have been proposed to mine specifications automatically. In the literature, most existing mining approaches rely on analyzing client code, so these mining approaches would fail to mine specifications when client code is not sufficient. Instead of analyzing client code, we propose an approach, called Doc2Spec, that infers resource specifications from API documentation in natural languages. We evaluated our approach on the Javadocs of five libraries. The results show that our approach performs well on real scale libraries, and infers various specifications with relatively high precisions, recalls, and F-scores. We further used inferred specifications to detect defects in open source projects. The results show that specifications inferred by Doc2Spec are useful to detect real defects in existing projects.  相似文献   

12.
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%.  相似文献   

13.
神经网络在软件工程中的应用极大程度上缓解了传统的人工提取代码特征的压力。已有的研究往往将代码简化为自然语言或者依赖专家的领域知识来提取代码特征,简化为自然语言的处理方法过于简单,容易造成信息丢失,而引入专家制定启发式规则的模型往往过于复杂,可拓展性以及普适性不强。鉴于以上问题,提出了一种基于卷积和循环神经网络的自动代码特征提取模型,该模型借助代码的抽象语法树(AST)来提取代码特征。为了缓解因AST过于庞大而带来的梯度消失问题,对AST进行切割,转换成一个AST序列再作为模型的输入。该模型利用卷积网络提取代码中的结构信息,利用双向循环神经网络提取代码中的序列信息。整个流程不需要专家的领域知识来指导模型的训练,只需要将标注类别的代码作为模型的输入就可以让模型自动地学习如何提取代码特征。应用训练好的分类编码器,在相似代码搜索任务上进行测试,Top1、NDCG、MRR的值分别能达到0.560、0.679和0.638,对比当下前沿的用于代码特征提取的深度学习模型以及业界常用的代码相似检测工具有显著的优势。  相似文献   

14.
软件库调用规约挖掘   总被引:1,自引:1,他引:0  
钟浩  张路  梅宏 《软件学报》2011,22(3):408-416
软件库调用规约是一种描述软件库提供函数正确调用顺序的规约.客户代码应按此规约描述的内容调用函数,否则可能引入缺陷,从而降低软件的可信性.由于能够描述可信软件应该满足的性质,软件库调用规约在可信软件、模型检测等研究中扮演特殊的角色.但是,受制于编写规约的巨大代价,软件库通常并不提供已编写好的调用规约.为此,研究者提出了各种自动挖掘此种规约的方法.阐述了其中代表性的方法及其最新的研究进展,并在此基础上探讨了将来的研究方向.  相似文献   

15.
编译器模糊测试,是测试编译器功能性与安全性的常用技术之一.模糊测试器通过产生语法正确的测试用例,对编译器的深层代码展开测试.近来,基于循环神经网络的深度学习模型被引入编译器模糊测试用例生成过程.针对现有方法生成测试用例的语法正确率不足、生成效率低的问题,提出一种基于前馈神经网络的编译器模糊测试用例生成方法,并设计实现了原型工具FAIR.与现有的基于token序列学习的方法不同,FAIR从抽象语法树中提取代码片段,利用基于自注意力的前馈神经网络捕获代码片段之间的语法关联,通过学习程序设计语言的生成式模型,自动生成多样化的测试用例.实验结果表明,FAIR生成测试用例的解析通过率以及生成效率均优于同类型先进方法.该方法显著提升了检测编译器软件缺陷的能力,已成功检测出GCC和LLVM的20处软件缺陷.此外,该方法具有良好的可移植性,简单移植后的FAIR-JS已在JavaScript引擎中检测到两处软件缺陷.  相似文献   

16.
彭宇峰  代春阳  高传善 《计算机工程》2004,30(22):72-73,113
开放式运行平台(Open Runtime Platform,ORP)是一个高性能的MRTE(Managed Runtime Environment)软件,是用来研究动态编译和垃圾收集技术的开放资源研究平台。ORP是面向J2SE的运行平台,而在其之上运行的类库GNU Classpath与Java 1.2API规范完全兼容,J2ME是针对嵌入式设备及消费类电子产品的Java版本。该文将ORP进行了修改,使之能够获得SUN的连接的有限设备配置(Connected Limited Device Configuration,CLDC)库的支持,并能够运行简单的J2ME程序。  相似文献   

17.
张毅  刘超  董亚卓 《软件》2014,(3):94-95
规约在测试、分析、验证、维护等软件工程的各个阶段都发挥着重要作用。规约挖掘技术试图从程序代码或者程序执行轨迹中自动挖掘软件的规约。寻找相关事件是规约挖掘的第一步,也是最重要的一步。本文给出一种寻找相关事件的静态分析方法,可以把该方法与现有的规约挖掘方法相结合,挖掘更好的规约。  相似文献   

18.
The CentiJ system automatically generates code that simulates multiple inheritance in Java. The generated code inputs a series of instances and outputs specifications that can be combined using multiple inheritance. The multiple inheritance of implementation is obtained by simple message forwarding. The reflection API of Java is used to reverse engineer the instances, and so the program can generate source code, but does not require source code on its input. Advantages of CentiJ include compile‐time type checking, speed of execution, automatic disambiguation (name space collision resolution) and ease of maintenance. Simulation of multiple inheritance was previously available only to Java programmers who performed manual delegation or who made use of dynamic proxies. The technique has been applied at a major aerospace corporation. Copyright © 2002 John Wiley & Sons, Ltd.  相似文献   

19.
The quest for more efficient real-time detection of anomalies in time series data is critically important in numerous applications and systems ranging from intelligent transportation, structural health monitoring, heart disease, and earthquake prediction. Although the range of application is wide, anomaly detection algorithms are usually domain specific and build on experts’ knowledge. Here a new signal processing algorithm – inspired by the deep learning paradigm – is presented that combines wavelets, neural networks, and Hilbert transform. The algorithm performs robustly and is transferable. The proposed neural network structure facilitates learning short and long-term pattern interdependencies; a task usually hard to accomplish using standard neural network training algorithms. The paper provides guidelines for selecting the neural network's buffer size, training algorithm, and anomaly detection features. The algorithm learns the system's normal behavior and does not require the existence of anomalous data for assessing its statistical significance. This is an essential attribute in applications that require customization. Anomalies are detected by analysing hierarchically the instantaneous frequency and amplitude of the residual signal using probabilistic Receiver Operating Characteristics. The method is shown to be able to automatically detect anomalies in the Seismic Electrical Signal that could be used to predict earthquake activity. Furthermore, the method can be used in combination with crowdsourcing of smartphone data to locate road defects such as potholes and bumps for intervention and repair.  相似文献   

20.
When coding to an application programming interface (API), developers often encounter difficulties, unsure of which class to subclass, which objects to instantiate, and which methods to call. Example source code that demonstrates the use of the API can help developers make progress on their task. This paper describes an approach to provide such examples in which the structure of the source code that the developer is writing is matched heuristically to a repository of source code that uses the API. The structural context needed to query the repository is extracted automatically from the code, freeing the developer from learning a query language or from writing their code in a particular style. The repository is generated automatically from existing applications, avoiding the need for handcrafted examples. We demonstrate that the approach is effective, efficient, and more reliable than traditional alternatives through four empirical studies  相似文献   

设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司    京ICP备09084417号-23

京公网安备 11010802026262号