Type-Directed Code Reuse using Integer Linear Programming
Yuepeng Wang, Yu Feng, Ruben Martins, Arati Kaushik, Isil Dillig,, Steven P. Reiss

TL;DR
This paper introduces Hunter, a tool that leverages type similarity and integer linear programming to facilitate code reuse by automatically finding and wrapping third-party library methods, thereby improving programmer productivity.
Contribution
Hunter is a novel tool that uses type similarity metrics and ILP to enhance code reuse and automate wrapper synthesis, outperforming existing tools like S6.
Findings
Hunter outperforms S6 in code reuse tasks.
Hunter significantly increases programmer productivity.
Type-guided ILP approach improves search and synthesis accuracy.
Abstract
In many common scenarios, programmers need to implement functionality that is already provided by some third party library. This paper presents a tool called Hunter that facilitates code reuse by finding relevant methods in large code bases and automatically synthesizing any necessary wrapper code. The key technical idea underlying our approach is to use types to both improve search results and guide synthesis. Specifically, our method computes similarity metrics between types and uses this information to solve an integer linear programming (ILP) problem in which the objective is to minimize the cost of synthesis. We have implemented Hunter as an Eclipse plug-in and evaluate it by (a) comparing it against S6, a state-of-the-art code reuse tool, and (b) performing a user study. Our evaluation shows that Hunter compares favorably with S6 and significantly increases programmer productivity.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Logic, programming, and type systems · Software Testing and Debugging Techniques
