Error checking for code
Apparatuses, systems and methods are provided for checking code for errors. The apparatuses, systems and methods may send a target code and a prompt for code checking to a machine learning (ML) chatbot to cause the ML chatbot to check the target code for errors. The apparatuses, systems and methods may determine whether there is an error in the target code based at least partially on a response from the ML chatbot. The apparatuses, systems and methods may, responsive to determining that there is an error in the target code, determine, via an interaction with the ML chatbot, a solution to fix the error. The apparatuses, systems and methods may analyze the solution to determine a number of at least one of (i) a set of steps or (ii) a set of interactions required by the solution. The apparatuses, systems and methods may, responsive to determining that the number exceeds a predetermined threshold, fix the error by implementing the solution with respect to the target code.
1 . A computer system for using a machine learning (ML) chatbot to check errors associated with a target code, the computer system comprising:
one or more processors; and
a memory storing executable instructions thereon that, when executed by the one or more processors, cause the one or more processors to:
receive, from a user device, an indication of the target code, wherein the target code includes a plurality of modules;
for each module of the plurality of modules, send a first prompt for code checking to a respective ML chatbot of a plurality of ML chatbots to cause the respective ML chatbot to check the module for errors;
for each module determined to be having an error:
extract, from a response from the respective ML chatbot, a module-specific solution for fixing the error;
send a second prompt to the respective ML chatbot to update the module based upon the error and the module-specific solution to the error;
determine whether the updated module fixes the error by:
(i) executing the updated module in connection with a test case in a test environment to generate an implementation result, wherein the test case checks for the error and is associated with an expected result defined by the test case, and
(ii) determining whether the implementation result complies with the expected result; and
responsive to determining that the implementation result does not comply with the expected result, send a third prompt to the respective ML chatbot to further update the updated module based upon the implementation result, and repeating steps (i) and (ii) with the further updated module;
responsive to determining that, for the each module determined to be having an error, a respective implementation result complies with a respective expected result, generate an overall solution to the error based upon one or more updated modules; and
transmit, to the user device, an indication of the overall solution for implementation by a user of the user device.
2 . The computer system of claim 1 , wherein to cause the respective ML chatbot to check the module for errors, the executable instructions, when executed by the one or more processors, cause the one or more processors to:
send the first prompt to cause the respective ML chatbot to check the module with the test case for errors.
3 . The computer system of claim 1 , wherein to update the module, the executable instructions, when executed by the one or more processors, cause the one or more processors to:
generate the second prompt based upon the module-specific solution;
send the second prompt to the ML chatbot to generate executable instructions associated with the module-specific solution; and
execute the executable instructions associated with the module-specific solution to update the module.
4 . The computer system of claim 1 , wherein the module-specific solution includes a first step and a second step, the second step comprising a plurality of action options, and wherein to update the module, the executable instructions, when executed by the one or more processors, further cause the one or more processors to:
send the second prompt to the ML chatbot to generate an intermediate updated version of the module based upon the first step;
implement the intermediate updated version of the module in the test environment to obtain an intermediate implementation result;
select an action option from the plurality of action options based upon the intermediate implementation result; and
send a fourth prompt to generate the updated version of the module based upon the selected action option.
5 . The computer system of claim 1 , wherein the executable instructions, when executed by the one or more processors, further cause the one or more processors to:
generate at least one of an image, an audio, or a video associated with the overall solution; and
present the at least one of the image, the audio, or the video to a user.
6 . A computer-implemented method for using a machine learning (ML) chatbot to check errors associated with a target code, the method comprising:
receiving, by one or more processors from a user device, an indication of the target code, wherein the target code includes a plurality of modules;
for each module of the plurality of modules, sending, by the one or more processors, a first prompt for code checking to a respective ML chatbot of a plurality of ML chatbots to cause the respective ML chatbot to check the module for errors;
for each module determined to be having an error;
extracting, by the one or more processors and from a response from the respective ML chatbot, a module-specific solution for fixing the error;
sending, by the one or more processors, a second prompt to the respective ML chatbot to update the module based upon the error and the module-specific solution to the error;
determining, by the one or more processors, whether the updated module fixes the error by:
(i) executing the updated module in connection with a test case in a test environment to generate an implementation result, wherein the test case checks for the error and is associated with an expected result defined by the test case, and
(ii) determining whether the implementation result complies with the expected result; and
responsive to determining that the implementation result does not comply with the expected result, sending, by the one or more processors, a third prompt to the respective ML chatbot to further update the updated module based upon the implementation result, and repeating steps (i) and (ii) with the further updated module;
responsive to determining that, for the each module determined to be having an error, a respective implementation result complies with a respective expected result, generating an overall solution to the error based upon one or more updated modules; and
transmitting, by the one or more processors and to the user device, an indication of the overall solution for implementation by a user of the user device.
7 . The computer-implemented method of claim 6 , wherein causing the respective ML chatbot to check the module for errors includes:
sending, by the one or more processors, the first prompt to cause the respective ML chatbot to check the module with the test case for errors.
8 . The computer-implemented method of claim 6 , wherein updating the module includes:
generating, by the one or more processors, the second prompt based upon the module-specific solution;
sending, by the one or more processors, the second prompt to the ML chatbot to generate executable instructions associated with the module-specific solution; and
executing, by the one or more processors, the executable instructions associated with the module-specific solution to update the module.
9 . The computer-implemented method of claim 6 , wherein the module-specific solution includes a first step and a second step, the second step comprising a plurality of action options, and wherein updating the module includes:
sending, by the one or more processors, the second prompt to the ML chatbot to generate an intermediate updated version of the module;
implementing, by the one or more processors, the intermediate updated version of the module in the test environment to obtain an intermediate implementation result;
selecting, by the one or more processors, an action option from the plurality of action options based upon the intermediate implementation result; and
sending a fourth prompt, by the one or more processors, to generate the updated version of the module based upon the selected action option.
10 . The computer-implemented method of claim 6 , further comprising:
generating, by the one or more processors, at least one of an image, an audio, or a video associated with the overall solution; and
presenting, by the one or more processors, the at least one of the image, the audio, or the video to a user.
11 . A non-transitory computer-readable storage medium comprising computer-readable instructions stored thereon for using a machine learning (ML) chatbot to check errors associated with a target code, wherein the computer-readable instructions when executed on one or more processors cause the one or more processors to:
receive, from a user device, an indication of the target code, wherein the target code includes a plurality of modules;
for each module of the plurality of modules, send a first prompt for code checking to a respective ML chatbot of a plurality of ML chatbots to cause the respective ML chatbot to check the module for errors;
for each module determined to be having an error:
extract, from a response from the respective ML chatbot, a module-specific solution for fixing the error;
send a second prompt to the respective ML chatbot to update the module based upon the error and the module-specific solution to the error;
determine whether the updated module fixes the error by:
(i) executing the updated module in connection with a test case in a test environment to generate an implementation result, wherein the test case checks for the error and is associated with an expected result defined by the test case, and
(ii) determining whether the implementation result complies with the expected result; and
responsive to determining that the implementation result does not comply with the expected result, send a third prompt to the respective ML chatbot to further update the updated module based upon the implementation result, and repeating steps (i) and (ii) with the further updated module;
responsive to determining that, for the each module determined to be having an error, a respective implementation result complies with a respective expected result, generate an overall solution to the error based upon one or more updated modules; and
transmit, to the user device, an indication of the overall solution for implementation by a user of the user device.
12 . The non-transitory computer-readable storage medium of claim 11 , wherein to cause the respective ML chatbot to check the module for errors, the computer-readable instructions, when executed by the one or more processors, further cause the one or more processors to:
send the first prompt to cause the respective ML chatbot to check the module with the test case to check for errors.
13 . The non-transitory computer-readable storage medium of claim 11 , wherein to update the module, the computer-readable instructions, when executed by the one or more processors, cause the one or more processors to:
generate the second prompt based upon the module-specific solution;
send the second prompt to the ML chatbot to generate executable instructions associated with the module-specific solution; and
execute the executable instructions associated with the module-specific solution to update the module.
14 . The non-transitory computer-readable storage medium of claim 11 , wherein the module-specific solution includes a first step and a second step, the second step comprising a plurality of action options, and wherein to update the module, the computer-readable instructions, when executed by the one or more processors, cause the one or more processors to:
send the second prompt to the ML chatbot to generate an intermediate updated version of the module based upon the first step;
implement the intermediate updated version of the module in the test environment to obtain an intermediate implementation result;
select an action option from the plurality of action options based upon the intermediate implementation result; and
send a fourth prompt to generate the updated version of the module based upon the selected action option.
15 . The non-transitory computer-readable storage medium of claim 11 , wherein the computer-readable instructions, when executed by the one or more processors, further cause the one or more processors to:
generate at least one of an image, an audio, or a video associated with the overall solution; and
present the at least one of the image, the audio, or the video to a user.