Method and apparatus for porting source code

US9378014B2 · US · B2

Patent metadata
FieldValue
Publication numberUS-9378014-B2
Application numberUS-201414263081-A
CountryUS
Kind codeB2
Filing dateApr 28, 2014
Priority dateJul 26, 2013
Publication dateJun 28, 2016
Grant dateJun 28, 2016

How to read this patent

A practical reading order for non-experts. Skip the full description unless you need deep technical detail.

  1. Title

    What the patent document calls the invention.

  2. Abstract

    A short plain-language summary of the technical disclosure.

  3. Assignees and inventors

    Who owns or filed the patent and who is credited as inventor.

  4. Key dates

    Filing, priority, publication, and grant dates set the timeline.

  5. First independent claim

    The legal scope of protection — read this for what is actually claimed.

  6. CPC / IPC classifications

    Technology tags used to group this patent with similar filings.

  7. Citations and related patents

    Prior art links and similar publications in this corpus.

Abstract

Official abstract text for this publication.

A method of porting source code for use in a runtime environment including a tool chain with a compiler for building the source code, in which the method comprises obtaining a source code fragment associated with a build error during the source code build in the runtime environment; creating a signature of the source code fragment; automatically comparing the signature with entries in an error database constructed from a history of previous build errors in the runtime environment and their fixes in the form of source code and/or tool chain modifications; using the comparison to find one or more similar previous build errors to the build error and thus to identify one or more of the source code and/or tool chain modifications as candidate solutions to the build error; compiling the source code with each of the candidate source code and/or tool chain modifications in turn until the source code compiles without reproducing the build error; and storing the build error in the error database and storing the modification with which the source code compiles without reproducing the build error as its fix.

First claim

Opening claim text (preview).

What is claimed is: 1. A computer-executed method of porting source code for use in a runtime environment including a tool chain with a compiler for building the source code, the method comprising: obtaining a source code fragment associated with a build error during a source code build in the runtime environment; creating a signature of the source code fragment; automatically comparing the signature with entries in an error database constructed from a history of previous build errors in the runtime environment and fixes in a form of one of source code and tool chain modifications to produce a comparison; using the comparison to find one or more similar previous build errors to the build error and identify one or more of the source code and tool chain modifications as candidate solutions to the build error; compiling the source code with each of candidate source code and tool chain modifications in turn until the source code compiles without reproducing the build error; and storing the build error in the error database and storing the modification with which the source code compiles without reproducing the build error as a fix, wherein candidate solutions are prioritized according to one of an effectiveness of the fix in the current run time environment and relevancy of the error, and wherein the relevancy of the error is based on a degree to which the signature in the previous build error matches the signature of the source code fragment. 2. A method according to claim 1 , wherein the signature of the source code fragment is created by converting the source code fragment to a non-language specific representation, and creating another signature from an intermediate representation as, a hash signature. 3. A method according to claim 1 , wherein the signature of the source code fragment includes a scope level signature for each of a plurality of scope levels around the error. 4. A method according to claim 1 , wherein an initial learning phase is executed, allowing a training set of build errors and known solutions to be established in the database. 5. A method according to claim 1 , wherein the effectiveness of the fix is based on a score which is incremented each time the fix is used successfully to solve a build error. 6. A method according to claim 1 , wherein the error database stores build errors including build errors in different runtime environments and source code of different applications. 7. A method according to claim 1 , in which build error fields in the error database include an error message and one or more of fragment signatures, an error classification, runtime environment details, and application details, and in which the build error is compared with one of any and all of the build error database fields. 8. A method according to claim 7 , wherein error classes are divided to identify and separate pre-process, compile-time and link-time errors, with a further subdivision as to type of error. 9. A method according to claim 7 , wherein the error class is assigned based on the error message, source code analysis and any error code and diagnostic message provided. 10. A method according to claim 7 , wherein the relevancy of the error includes determination of a degree to which database fields of a similar previous build error match the build error. 11. A method according to claim 1 , further comprising: obtaining an error message when the source code fragment is obtained, classifying the error message when the signature of the source code fragment is created, and automatically comparing the error message classification with the entries in the error database, before comparison of the signature with the entries in the database. 12. A method according to claim 1 , wherein one of entries in the error database and previous build errors from a same application as the source code are compared with the signature first, and if no fixes are found, entries in the error database of previous build errors from any other application are compared with the signature. 13. An apparatus comprising a processor and a memory arranged to correct errors in porting source code for use by with a new runtime environment of the memory including a tool chain with a compiler for building the source code by the processor, the apparatus comprising: the processor and the memory; an input arranged to obtain a source code fragment associated with a build error during source code build in the environment; a signature creator arranged to create a signature of the source code fragment an error database constructed from a history of previous build errors in the environment and their fixes in the form of one of source code and software configuration modifications a comparator arranged to automatically compare the source code signature with entries in the error database and produce a comparison; an identifier arranged to use the comparison to find one or more similar previous build errors to the build error and identify one or more of the source code and software configuration modifications as candidate solutions to the build error, the candidate solutions being prioritized according to one of an effectiveness of the fix in the current run time environment and relevancy of the error, and the relevancy of the error being based on a degree to which the signature in the previous build error matches the signature of the source code fragment; a loop inputter arranged to allow compilation of the source code with each of the identified source code and software configuration modifications in turn until the source code compiles without reproducing the build error; and a database updater arranged to store the build error in the error database, and the modification with which the source code compiles without reproducing the build error as a fix. 14. An apparatus according to claim 13 , wherein the database comprises a system table storing information about the runtime environment, an application table storing details about application codes built, a code fragment table storing code fragments and an indication of whether the fragments can be successfully built and an error table storing previous build errors. 15. A computer-executed method of porting source code for use in a runtime environment including a tool chain with a compiler for building the source code, the method comprising: obtaining an error message and a source code fragment associated with a build error during source code build in the runtime environment; classifying the error message producing an error message classification; automatically comparing the error message classification with entries in an error database constructed from a history of previous build errors in the runtime environment and fixes in a form of source code and tool chain modifications to produce a comparison; using the comparison to find one or more similar previous build errors to the build error and identify one or more of the source code and tool chain modifications as candidate solutions to the build error, the candidate solutions being prioritized according to one of an effectiveness of the fix in the current run time environment and relevancy of the error, and the relevancy of the error is based on a degree to which database fields of a similar previous build error match the build error; compiling the source code with one of each of candidate source code and tool chain modifications in turn until the source code compiles without reproducing the build error; and storing the build error in the error database and storing the modification with which the source code compiles without reproducing the build

Assignees

Inventors

Classifications

  • Software maintenance or management · CPC title

  • Checking; Contextual analysis · CPC title

  • Software reuse · CPC title

  • G06F8/76Primary

    Adapting program code to run in a different environment; Porting · CPC title

  • G06F8/30Primary

    Creation or generation of source code · CPC title

Patent family

Related publications grouped by family.

External sources

Frequently asked questions

Answers are generated from the same data shown on this page.

What does patent US9378014B2 cover?
A method of porting source code for use in a runtime environment including a tool chain with a compiler for building the source code, in which the method comprises obtaining a source code fragment associated with a build error during the source code build in the runtime environment; creating a signature of the source code fragment; automatically comparing the signature with entries in an error …
Who is the assignee on this patent?
Fujitsu Ltd
What technology area does this patent fall under?
Primary CPC classification G06F8/76. Mapped technology areas include Physics.
When was this patent published?
Publication date Tue Jun 28 2016 00:00:00 GMT+0000 (Coordinated Universal Time) (B2). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 8 related publications on this page (citations in our corpus or others sharing the same primary CPC).