Search

US-20260127094-A1 - METHOD AND DEVICE FOR MODIFYING A SOFTWARE CODE FILE

US20260127094A1US 20260127094 A1US20260127094 A1US 20260127094A1US-20260127094-A1

Abstract

A method for modifying a software code file containing source code is described, the method including automatically performing: execution of the software code file; parsing a log file obtained further to the execution of the software code contained in the software code file, to identify at least a data structure enabling the identification of one error message generated during the execution of the software code; identifying, in the software code file, a location of software code lines corresponding to the at least one error message, the location being retrieved from information contained in the data structure; matching information related to the at least one error message with patch source code associated with the error message, the patch source code contained in a patch source code file or a patch database; and modifying software code lines in the software code file at the identified location, using the patch source code.

Inventors

  • Nimisha Gupta
  • Manish Sharma
  • Vivek KAUSHIK
  • Rajhas Balaraman
  • Himanshu Pratap

Assignees

  • ORANGE

Dates

Publication Date
20260507
Application Date
20230621
Priority Date
20220630

Claims (13)

  1. 1 . A method for modifying a software code file containing source code, the method comprising automatically performing: execution of said software code file, parsing a log file obtained further to the execution of the software code contained in said software code file, to identify at least a data structure enabling the identification of one error message generated during the execution of said software code, identifying, in the software code file, a location of software code lines corresponding to said at least one error message, said location being retrieved from information contained in said data structure, matching information related to said at least one error message with patch source code associated with said error message, said patch source code being contained in a patch source code file or a patch database, and modifying software code lines in said software code file at the identified location, using said patch source code.
  2. 2 . The method of claim 1 wherein said patch source code comprises an action and said modifying software code lines modify software code lines according to said action.
  3. 3 . The method of claim 1 wherein said parsing comprises: structuring said log file in tree structure, and searching said at least one error message based on an index search in said tree-structured log file.
  4. 4 . The method of claim 1 further comprising structuring said software code file in tree structure.
  5. 5 . The method of claim 3 , further comprising, creating for the at least one data structure, from said tree-structured log file, an error object comprising an error identifier and description information associated with said error object and said location information.
  6. 6 . The method of claim 5 wherein said matching comprises parsing said patch source code file or patch database to retrieve at least one patch source code according to similarity measurement between said error object and said patch source code, associating a confidence score to said at least retrieved patch source code, and upon a determination that said at least one confidence score is above a determined confidence score, selecting patch source code according to the confidence score, and wherein said modifying comprises correcting said software code lines associated with said data structure by said selected patch source code using location information of said error object.
  7. 7 . The method of claim 6 wherein said correcting said software code lines correct said software code lines in said tree-structured software code file.
  8. 8 . The method of claim 6 , further comprising, subsequent to the correcting: executing said software code file, parsing said obtained log file further to said executing, and upon detecting that no error is associated with said selected patch source code, updating said patch source code file or database with metadata associated with said patch source code.
  9. 9 . The method of claim 5 , wherein said error object is a Java script object notation (JSON) object.
  10. 10 . (canceled)
  11. 11 . A non-transitory, computer readable storage medium having stored thereon instructions which, when executed by a processor, cause the processor to implement the method of claim 1 .
  12. 12 . A device for correcting errors in a software code file containing source code, the device comprising one or more processors configured to, alone or in combination, automatically perform: parsing a log file obtained further to an execution of the software code contained in said software code file, to identify at least a data structure enabling the identification of one error message generated during the execution of said software code, identifying, in the software code file, a location of software code lines corresponding to said at least one error message, said location being retrieved from information contained in said data structure, matching information related to said at one error message with patch source code associated with said error message, said patch source code being contained in a patch source code file or a database, and modifying software code lines in said software code file at the identified location, using said patch source code.
  13. 13 . The device of claim 12 wherein said patch source code comprises an action and said modifying software code lines modify software code lines according to said action.

Description

FIELD OF THE INVENTION The present invention relates to the field of error correction during software testing. TECHNICAL BACKGROUND Software developers usually manually review the execution of source codes in order to find errors and correct them manually. They apply patch code to fix manually the errors and then execute again and again the source code to check whether the error has been corrected and move to the next one. It is common that exceptions related to the environment and platform occur quite frequently and fixing these code exceptions take a lot of time and renders the process of error fixing challenging and time consuming. Moreover, it can happen that test engineers lack experience to be able to find easily the errors and the solution to correct them. In addition, usually source code contains millions of codes lines and this makes the process of manual error correction burdensome. More and more software developers need to produce complex source code and in less and less time and for this reason, spending time in debugging software codes is a waste of time and should be avoided as much as possible to improve deliverables. The present invention aims at solving at least one of these drawbacks by providing an automatic solution for software error correction that can help software developers or testers accelerate the test phase of a software. SUMMARY OF THE INVENTION The present invention provides a method for modifying a software code file containing source code comprising automatic run of execution of said software code file,parsing a log file obtained further to the execution of the software code contained in said software code file, to identify at least a data structure enabling the identification of one error message generated during the execution of said software code,identifying, in the software code file, a location of software code lines corresponding to said at least one error message, said location being retrieved from information contained in said data structure,matching information related to said at least one error message with patch source code associated with said error message, said patch source code being contained in a patch source code file or a patch database,modifying software code lines in said software code file at the identified location, using said patch source code. According to some embodiments, said patch source code comprises an action and said modifying software code lines modify software code lines according to said action. According to some embodiments, the method comprises structuring said software code file in tree structuresearching said at least one error message based on an index search in said tree-structured log file. According to some embodiments, the method comprises structuring said software code file in tree structure. According to some embodiments, the method comprises, creating for the at least one data structure, from said tree-structured log file, an error object comprising an error identifier and description information associated with said error object and said location information. According to some embodiments, said matching comprises parsing said patch source code file or patch database to retrieve at least one patch source code according to similarity measurement between said error object and said patch source code,associating a confidence score to said at least retrieved patch source code,when said at least one confidence score is above a determined confidence score, selecting patch source code according to the confidence score,correcting said software code lines associated with said data structure by said selected patch source code using location information of said error object. According to some embodiments, said modifying said software code lines correct said software code lines in said tree-structured software code file. According to some embodiments, the method comprises, further to the correcting executing said software code fileparsing said obtained log file further to said executing and upon detecting that no error is associated with said selected patch source code, updating said patch source code file or database with metadata associated with said patch source code. According to some embodiments, said error object is a Java script object notation (JSON) object. According to another aspect, the present invention concerns a computer program product comprising instructions for performing the method according to the invention when executed by one of more processors. According to another aspect, the present invention concerns a computer readable storage medium having stored thereon instructions for causing one or more processors to perform the method of any one of claims 1 to 8. According to another aspect, the present invention concerns a device for correcting errors in a software code file containing source code comprising one or more processors configured to perform alone or in combination automatic run of parsing a log file obtained furt