Developers often search for application programming interfaces (apis) and their usage patterns to speed up the efficiency of software development. This paper focuses on the api sequence search task, which refers to us...
详细信息
ISBN:
(纸本)9781665452786
Developers often search for application programming interfaces (apis) and their usage patterns to speed up the efficiency of software development. This paper focuses on the api sequence search task, which refers to using a function-relevant textual query to search for apisequences mined from open-source software repositories that can implement this function. However, the severe semantic gap between text and api makes it challenging to discover the correspondence between natural language queries and desired apisequences. Therefore, we propose a method called documentation-guided api sequence search (DGAS), through which we do not need to worry about the semantic gap between text and api. Specifically, DGAS consists of documentation-guided cross-modal attention (DGCA) and documentation-guided cross-modal matching (DGCM). DGCA calculates the cross-modal attention map using features extracted from the same modality (i.e., api documentation sequence and textual query) instead of from different modalities (i.e., apisequence and textual query) to bridge the semantic gap during the cross-modal attention phase. Besides, DGCM takes api documentation as supplementary information of apisequence to bridge the semantic gap during the cross-modal matching phase. We use the api documentation to extend the existing dataset for apisequence generation to construct a dataset for api sequence search to evaluate DGAS. Experimental results show that DGAS outperforms the baseline methods.
暂无评论