Next Syntactic-Unit Code Completion and Applications.

Published in 37th IEEE/ACM International Conference on Automated Software Engineering: New Ideas and Emerging Results (NIER) Track, 2022

Recommended citation: Anh Tuan Nguyen, Aashish Yadavally, and Tien N. Nguyen. 2022. Next Syntactic-Unit Code Completion and Applications. In 37th IEEE/ACM International Conference on Automated Software Engineering (ASE ’22), October 10–14, 2022, Rochester, MI, USA. ACM, New York, NY, USA, 6 pages. https://doi.org/10.1145/3551349.3559544

Code completion is an important feature in an IDE to improve developers’ productivity. Existing code completion approaches focus on completing the current code token, next token or statement, or code pattern. We propose AstCC, a code completion approach to suggest the next syntactic unit via an AST-based statistical language model. AstCC learns from a large code corpus to derive the next AST subtree representing a syntactic unit, and then fills in the template with the concrete variables from the current program scope. Our empirical evaluation shows that AstCC can correctly suggest the next syntactic unit in 33% of the cases, and in 62% of the cases, it correctly suggests within five candidates. We will also explain the potential applications of AstCC in automated program repair, automated test case generation, and syntactic pattern mining

Download paper here.