System and method that assists with identifying unpredicted portions of source code files for software engineering tasks
A system stores a source code file's changes from a software developer's code editor, for a software engineering task. Upon receiving the code editor's request to predict source code for the source code file, the system retrieves the software engineering task's context data, and transforms the context data to be compatible with the data format used to train a machine-learning model to assist with performing software engineering tasks. The machine-learning model uses the transformed context data to predict the source code for the source code file, with source code file portions corresponding to predicted source code portions. The system identifies each portion of the source code file which is differing from a corresponding portion of the predicted source code, via the code editor. The system commits any differing portions of the predicted source code, which are requested and accepted by the code editor, to the source code file.
1 . A system for predicting source code for software engineering tasks, the system comprising:
one or more processors; and
a non-transitory computer readable medium storing a plurality of instructions, which when executed, cause the one or more processors to:
store source code changes in a source code file associated with a software engineering task;
retrieve context data that establishes a context for the software engineering task in response to a request to predict source code for the software engineering task;
transform the context data to be compatible with a data format used to train a machine-learning model;
predict, by the machine-learning model using the transformed context data, source code for the software engineering task;
identify each portion of the source code changes that is determined to differ from a corresponding portion of the predicted source code;
cause each identified portion to be displayed as selectable on a graphical user interface;
cause, in response to a selection of one of the displayed each identified portion, the corresponding portion of the predicted source code to be displayed on the graphical user interface; and
commit to the source code file, the displayed corresponding portion of the predicted source code in response to being selected as a replacement for the selected one of the displayed each identified portion of the source code changes.
2 . The system of claim 1 , wherein the plurality of instructions further causes the one or more processors to output the source code file associated with the software engineering task to the graphical user interface in response to receiving a request to begin making the source code changes to the source code file.
3 . The system of claim 1 , wherein the plurality of instructions further causes the one or more processors to display an issue report on the graphical user interface, the issue report being configured to receive at least one of: a) a clarification of the issue report that describes the software engineering task, or b) an update to the issue report to describe a strategy for completing the software engineering task.
4 . The system of claim 3 , wherein the plurality of instructions further causes the one or more processors to predict, by the machine-learning model, other source code for the source code file based on a modification to at least one of any committed portions of the predicted source code or the issue report.
5 . The system of claim 4 , wherein the plurality of instructions further causes the one or more processors to display the other source code for the source code file on the graphical user interface.
6 . The system of claim 1 , wherein the predicted source code comprises at least one of: a) source code to be added to the source code file, b) source code to be removed from the source code file, c) source code to be replaced in the source code file, or d) any type of the source code for another source code file, and each portion of the source code file comprises at least one of a line of source code, a word of source code, or a single text character of source code.
7 . The system of claim 1 , wherein each portion of the source code file that is determined to differ from a corresponding portion of the predicted source code is identified based on a determination of whether the corresponding portion of the predicted source code has a prediction confidence level that satisfies a threshold.
8 . A computer-implemented method for predicting source code for software engineering tasks, the method comprising:
storing source code changes in a source code file associated with a software engineering task;
retrieving context data that establishes a context for the software engineering task in response to a request to predict source code for the software engineering task;
transforming the context data to be compatible with a data format used to train a machine-learning model;
predicting, by the machine-learning model using the transformed context data, source code for the software engineering task;
identifying each portion of the source code changes that is determined to differ from a corresponding portion of the predicted source code;
causing each identified portion to be displayed as selectable on a graphical user interface;
causing, in response to a selection of one of the displayed each identified portion, the corresponding portion of the predicted source code to be displayed on the graphical user interface; and
committing to the source code file, the displayed corresponding portion of the predicted source code in response to being selected as a replacement for the selected one of the displayed each identified portion of the source code changes.
9 . The method of claim 8 , wherein the computer-implemented method further comprises outputting the source code file associated with the software engineering task to the graphical user interface in response to receiving a request to begin making the source code changes to the source code file.
10 . The method of claim 8 , wherein the computer-implemented method further comprises displaying an issue report on the graphical user interface, the issue report being configured to receive at least one of: a) a clarification of the issue report that describes the software engineering task or b) an update to the issue report to describe a strategy for completing the software engineering task.
11 . The method of claim 10 , wherein the computer-implemented method further comprises predicting, by the machine-learning model, other source code for the source code file based on a modification to at least one of any committed portions of the predicted source code or the issue report.
12 . The method of claim 11 , wherein the computer-implemented method further comprises displaying the other source code for the source code file on the graphical user interface.
13 . The method of claim 8 , wherein the predicted source code comprises at least one of: a) source code to be added to the source code file, b) source code to be removed from the source code file, c) source code to be replaced in the source code file, or d) any type of the source code for another source code file, and each portion of the source code file comprises at least one of a line of source code, a word of source code, or a single text character of source code.
14 . The method of claim 8 , wherein each portion of the source code file that is determined to differ from a corresponding portion of the predicted source code is identified based on a determination of whether the corresponding portion of the predicted source code has a prediction confidence level that satisfies a threshold.
15 . A computer program product, comprising a non-transitory computer-readable medium having a computer-readable program code embodied therein to be executed by one or more processors, the program code including instructions to:
store source code changes in a source code file associated with a software engineering task;
retrieve context data that establishes a context for the software engineering task in response to a request to predict source code for the software engineering task;
transform the context data to be compatible with a data format used to train a machine-learning model;
predict, by the machine-learning model using the transformed context data, the source code for the software engineering task;
identify each portion of the source code changes that is determined to differ from a corresponding portion of the predicted source code;
cause each identified portion to be displayed as selectable on a graphical user interface;
cause, in response to a selection of one of the displayed each identified portion, the corresponding portion of the predicted source code to be displayed on the graphical user interface; and
commit to the source code file, the displayed corresponding portion of the predicted source code in response to being selected as a replacement for the selected one of the displayed each identified portion of the source code changes.
16 . The computer program product of claim 15 , wherein the program code includes further instructions to output the source code file associated with the software engineering task to the graphical user interface in response to receiving a request to begin making the source code changes to the source code file.
17 . The computer program product of claim 15 , wherein the program code includes further instructions to display an issue report on the graphical user interface, the issue report being configured to receive at least one of: a) a clarification of the issue report that describes the software engineering task or b) an update to the issue report to describe a strategy for completing the software engineering task.
18 . The computer program product of claim 17 , wherein the program code includes further instructions to predict, by the machine-learning model, other source code for the source code file based on a modification to at least one of any committed portions of the predicted source code or the issue report; and
display the other source code for the source code file on the graphical user interface.
19 . The computer program product of claim 15 , wherein the predicted source code comprises at least one of: a) source code to be added to the source code file, b) source code to be removed from the source code file, c) source code to be replaced in the source code file, or d) any type of the source code for another source code file, and each portion of the source code file comprises at least one of a line of source code, a word of source code, or a single text character of source code.
20 . The computer program product of claim 15 , wherein each portion of the source code file that is determined to differ from a corresponding portion of the predicted source code is identified based on a determination of whether the corresponding portion of the predicted source code has a prediction confidence level that satisfies a threshold.