Software designers and developers are increasingly relying on application frameworks as first-class design concepts. They instantiate the services that frameworks provide to implement various architectural tactics and patterns. One of the challenges in using frameworks for such tasks is the difficulty of learning and correctly using frameworks' APIs. This paper introduces a learning-based approach called ArCode to help novice programmers correctly use frameworks' APIs to implement architectural tactics and patterns. ArCode has several novel components: a graph-based approach for learning specification of a framework from a limited number of training software, a program analysis algorithm to eliminate erroneous training data, and a recommender module to help programmers use APIs correctly and identify API misuses in their programs. We evaluated our technique across two popular frameworks: JAAS security framework used for authentication and authorization tactic and Java RMI framework used to enable remote method invocation between client and server and other object-oriented patterns. Our evaluation results show (i) the feasibility of using ArCode to learn the specification of a framework; (ii) ArCode generates accurate recommendations for finding the next API call to implement an architectural tactic/pattern based on the context of the programmer's code; (iii) it accurately detects API misuses in the code that implements a tactic/pattern and provides fix recommendations. Comparison of ArCode with two prior techniques (MAPO and GrouMiner) on API recommendation and misuse detection shows that ArCode outperforms these approaches.
翻译:软件设计师和开发商日益依赖应用框架作为头等设计概念;他们即时利用框架所提供的服务,以实施各种建筑策略和模式; 使用框架的难题之一是难以学习和正确使用框架的API; 本文介绍了一种以学习为基础的方法,称为ArCode,以帮助新编程序设计师正确使用框架的API来实施建筑策略和模式; ArCode有几个新的组成部分:一种基于图表的方法,从有限的培训软件中学习框架规格;一种旨在消除错误培训数据的程序分析算法;以及一个建议模块,帮助程序设计师正确使用API,并查明其方案中滥用API的情况。 我们评估了我们的两个流行框架的方法:JAAS安全框架用于认证和授权策略;Java RMI框架,用于帮助新编程序设计师正确使用框架的API和服务器的API; 我们的评价结果显示:(一) 使用Arcode的可行性,以学习框架的规格;(二) Arcode,寻找下一个API呼吁,在方案代码中准确地检测Arrode/Bestroad,在方案执行之前的指南。