
CROKAGE: Effective Solution Recommendation for Programming Tasks by Leveraging Crowd Knowledge
Author(s) -
Rodrigo F. G. Silva,
Marcelo de Almeida Maia
Publication year - 2021
Language(s) - English
Resource type - Conference proceedings
DOI - 10.5753/cbsoft_estendido.2021.17295
Subject(s) - computer science , python (programming language) , java , programming language , code (set theory) , task (project management) , relevance (law) , information retrieval , artificial intelligence , management , set (abstract data type) , political science , law , economics
Developers often search for relevant code examples on the web for their programming tasks. Unfortunately, they face three major problems. First, they frequently need to read and analyse multiple results from the search engines to obtain a satisfactory solution. Second, the search is impaired due to a lexical gap between the query (task description) and the information in the solution (e.g., code example). Third, the retrieved solution may not be comprehensible, i.e., the code segment might miss a succinct explanation. To address these three problems, we propose CROKAGE (Crowd Knowledge Answer Generator), a tool that takes the description of a programming task (the query) as input and delivers a comprehensible solution for the task. Our solutions contain not only relevant code examples but also their succinct explanations written by human developers. We evaluate and compare our approach against ten baselines, including the state-of-art. We show that CROKAGE outperforms the ten baselines in suggesting relevant solutions for 902 programming tasks (i.e., queries) of three popular programming languages: Java, Python and PHP. Furthermore, we use 24 programming tasks (queries) to evaluate our solutions with 29 developers and confirm that CROKAGE outperforms the state-of-art tool in terms of relevance of the suggested code examples, benefit of the code explanations and the overall solution quality (code + explanation).