A Hybrid Approach for Inference between Behavioral Exception API Documentation and Implementations, and Its Applications
Hoan Anh Nguyen, Hung Dang Phan, Syeda Khairunnesa Samantha, Son Nguyen, Aashish Yadavally, Shaohua Wang, Hridesh Rajan, Tien N. Nguyen
摘要
Automatically producing behavioral exception (BE) API documentation helps developers correctly use the libraries. The state-of-theart approaches are either rule-based, which is too restrictive in its applicability, or deep learning (DL)-based, which requires large training dataset. To address that, we propose StatGen, a novel hybrid approach between statistical machine translation (SMT) and tree-structured translation to generate the BE documentation for any code and vice versa. We consider the documentation and source code of an API method as the two abstraction levels of the same intent. StatGen is specifically designed for this two-way inference, and takes advantage of their structures for higher accuracy.
We conducted several experiments to evaluate StatGen. We show that it achieves high precision (75% and 75%), and recall (81% and 84%), in inferring BE documentation from source code and vice versa. StatGen achieves higher precision, recall, and BLEU score than the state-of-the-art, DL-based baseline models. We show Stat-Gen's usefulness in two applications. First, we use it to generate the BE documentation for Apache APIs that lack of documentation by learning from the documentation of the equivalent APIs in JDK. 44% of the generated documentation were rated as useful and 42% as somewhat useful. In the second application, we use StatGen to detect the inconsistency between the BE documentation and corresponding implementations of several JDK8 packages.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 2 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
引用它的顶会 Paper2
它引用的 Paper2
相关 Paper
- API-Misuse Detection Driven by Fine-Grained API-Constraint Knowledge GraphXiaoxue Ren, Xinyuan Ye, Zhenchang Xing, Xin Xia 等ASE 2020 · 62 次引用
- Learning to Handle ExceptionsJian Zhang, Xu Wang, Hongyu Zhang, Hailong Sun 等ASE 2020 · 19 次引用
- Detecting and Explaining Self-Admitted Technical Debts with Attention-based Neural NetworksXin Wang, Jin Liu, Li Li, Xiao Chen 等ASE 2020 · 25 次引用
- Structural Language Models of CodeUri Alon, Roy Sadaka, Omer Levy, Eran YahavICML 2020 · 115 次引用
- M3: Semantic API MigrationsBruce Collie, Philip Ginsbach, Jackson Woodruff, Ajitha Rajan 等ASE 2020 · 14 次引用
