搜索替换类
Searching for Replacement Classes
摘要:
软件开发人员必须经常替换系统中的现有组件,以适应不断发展的环境或工具。虽然传统的代码搜索系统在检索具有相关功能的组件时是有效的,但检索可用于直接替换现有功能的组件更具挑战性,因为替换必须考虑更基本的程序属性,例如类型兼容性。为了解决这个问题,我们引入了一个系统,它给出了一个查询类Q,和一个搜索语料库S,返回一个排名的类的子集,可以取代Q和它的功能。ClassMap生成类之间的字段和方法映射,可以为开发人员提供有用的提示,并可用于有效地细化候选替换类的排名。我们的技术利用了基于嵌入的分布式搜索和基于类型的分析的互补优势,使用前者来修剪基于后者的基于优化的方法的候选人。ClassObject检索替换类,以及类之间的类型感知字段/方法映射。我们评估的搜索空间的60万个开源Java类的类。用24个已知的Java类查询ClassMap提供了有意义的替换类和映射,在许多情况下,用功能相同的替换类生成完整的映射。
英文摘要:
Software developers must often replace existing components in their systems to adapt to evolving environments or tooling. While traditional code search systems are effective at retrieving components with related functionality, it is much more challenging to retrieve components that can be used to directly replace existing functionality, as replacements must account for more fundamental program properties such as type compatibility. To address this problem, we introduce ClassFinder, a system which given a query class Q, and a search corpus S, returns a ranked subset of classes that can replace Q and its functionality. ClassFinder produces afield and method mapping between the classes that can provide useful hints to a developer and can be used to effectively refine the ranking of candidate replacement classes. Our technique leverages the complementary strengths of a distributed embeddings-based search and type-based analysis, using the former to prune down candidates for an optimization-based approach based on the latter. ClassFinder retrieves replacement classes, along with a type-aware field/method mapping between classes. We evaluate ClassFinder on a search space of ~600thousand open sourceJava classes. Querying ClassFinder with 24 known Java classes provided meaningful replacement classes and mappings, in many cases producing complete mappings with functionally identical replacement classes.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。