ICSE2022
SnR: Constraint-Based Type Inference for Incomplete Java Code Snippets
Yiwen Dong, Tianxiao Gu, Yongqiang Tian, Chengnian Sun
10 citations
Abstract
Code snippets are prevalent on websites such as Stack Overflow and are effective in demonstrating API usages concisely. However they are usually difficult to be used directly because most code snippets not only are syntactically incomplete but also lack dependency information, and thus do not compile. For example, Java snippets usually do not have import statements or required library names; only 6.88% of Java snippets on Stack Overflow include import statements necessary for compilation.