IP Library › Granted Patent US 11,556,455
Granted Patent B2
US 11,556,455 · App. 16/985,171 · Granted Jan 17, 2023

Automated identification of posts related to software patches

Inventors: Sonal Mahajan (Fremont, CA); Mukul R. Prasad (San Jose, CA)
Assignee: FUJITSU LIMITED
G06F11/3624
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,556,455
App. No.
16/985,171
Granted
Jan 17, 2023
Kind
B2
Abstract

Operations may include obtaining a buggy code snippet of source code of a software program in which the buggy code snippet includes a particular error. The operations may also include determining a respective first similarity between the buggy code snippet and a plurality of bug patterns of previously identified bug scenarios. In addition, the operations may include selecting a particular bug pattern based on a determined particular first similarity between the particular bug pattern and the buggy code snippet. Moreover, the operations may include determining a respective second similarity between the particular bug pattern and example code snippets obtained from a plurality of posts. The operations may also include selecting a particular post as providing a potential solution to correct the particular error based on a determined particular second similarity between the particular bug pattern and a particular example code snippet of the particular post.

Claims (65)

1. A method comprising:

obtaining a buggy code snippet of source code of a software program in which the buggy code snippet includes a particular error;

determining a respective first similarity between the buggy code snippet and each of a plurality of bug patterns of previously identified bug scenarios;

selecting a particular bug pattern from the plurality of bug patterns based on a determined particular first similarity between the particular bug pattern and the buggy code snippet, wherein determining the particular first similarity includes:

building a first Abstract Program Graph (APG) that represents the buggy code snippet;

building a second APG that represents the particular bug pattern; and

determining the particular first similarity based on overlap between the first APG and the second APG;

determining a respective second similarity between the particular bug pattern and each of a plurality of example code snippets each obtained from a respective post of a plurality of posts obtained from one or more websites; and

selecting, from the plurality of posts, a particular post as providing a potential solution to correct the particular error of the buggy code snippet based on a determined particular second similarity between the particular bug pattern and a particular example code snippet of the particular post, wherein determining the particular second similarity includes:

building a third APG that represents the particular example code snippet; and

determining the particular second similarity based on overlap between the second APG and the third APG.

2. The method of claim 1 , further comprising performing one or more repair operations with respect to the particular error based on the selected post.

3. The method of claim 1 , wherein selecting the particular bug pattern from the plurality of bug patterns includes:

determining a similarity score that indicates the particular first similarity between the particular bug pattern and the buggy code snippet; and

selecting the particular bug pattern in response to the similarity score indicating that the particular bug pattern has a highest degree of similarity with the buggy code snippet as compared to the other bug patterns of the plurality of bug patterns.

4. The method of claim 1 , wherein selecting the particular post from the plurality of posts includes:

determining a similarity score that indicates the particular second similarity between the particular bug pattern and the particular example code snippet; and

selecting the particular post in response to the similarity score indicating that the particular example code snippet has a highest degree of similarity with the particular bug pattern as compared to the other posts of the plurality of posts.

5. The method of claim 1 , wherein each of the plurality of bug patterns is formatted according to a syntax of a software language of the software program.

6. The method of claim 5 , wherein the syntax includes one or more of a plurality of characteristics in which the plurality of characteristics includes:

supporting semantic abstractions that allow for specifying of different methods that are of a similar type as exhibiting common semantic behavior;

using wildcards to abstract out particular program elements; and

allowing for expressing numeric constraints on values.

7. One or more non-transitory computer-readable storage media configured to store instructions that, in response to being executed, cause a system to perform operations, the operations comprising:

obtaining a buggy code snippet of source code of a software program in which the buggy code snippet includes a particular error;

determining a respective first similarity between the buggy code snippet and each of a plurality of bug patterns of previously identified bug scenarios;

selecting a particular bug pattern from the plurality of bug patterns based on a determined particular first similarity between the particular bug pattern and the buggy code snippet, wherein determining the particular first similarity includes:

building a first Abstract Program Graph (APG) that represents the buggy code snippet;

building a second APG that represents the particular bug pattern; and

determining the particular first similarity based on overlap between the first APG and the second APG;

determining a respective second similarity between the particular bug pattern and each of a plurality of example code snippets each obtained from a respective post of a plurality of posts obtained from one or more websites; and

selecting, from the plurality of posts, a particular post as providing a potential solution to correct the particular error of the buggy code snippet based on a determined particular second similarity between the particular bug pattern and a particular example code snippet of the particular post, wherein determining the particular second similarity includes:

building a third APG that represents the particular example code snippet; and

determining the particular second similarity based on overlap between the second APG and the third APG.

8. The one or more computer-readable storage media of claim 7 , wherein the operations further comprise performing one or more repair operations with respect to the particular error based on the selected post.

9. The one or more computer-readable storage media of claim 7 , wherein selecting the particular bug pattern from the plurality of bug patterns includes:

determining a similarity score that indicates the particular first similarity between the particular bug pattern and the buggy code snippet; and

selecting the particular bug pattern in response to the similarity score indicating that the particular bug pattern has a highest degree of similarity with the buggy code snippet as compared to the other bug patterns of the plurality of bug patterns.

10. The one or more computer-readable storage media of claim 7 , wherein selecting the particular post from the plurality of posts includes:

determining a similarity score that indicates the particular second similarity between the particular bug pattern and the particular example code snippet; and

selecting the particular post in response to the similarity score indicating that the particular example code snippet has a highest degree of similarity with the particular bug pattern as compared to the other posts of the plurality of posts.

11. The one or more computer-readable storage media of claim 7 , wherein each of the plurality of bug patterns is formatted according to a syntax of a software language of the software program.

12. The one or more computer-readable storage media of claim 7 , wherein the syntax includes one or more of a plurality of characteristics in which the plurality of characteristics includes:

supporting semantic abstractions that allow for specifying of different methods that are of a similar type as exhibiting common semantic behavior;

using wildcards to abstract out particular program elements; and

allowing for expressing numeric constraints on values.

13. A system comprising:

one or more processors; and

one or more non-transitory computer-readable storage media configured to store instructions that, in response to being executed by the one or more processors, cause the system to perform operations, the operations comprising:

obtaining a buggy code snippet of source code of a software program in which the buggy code snippet includes a particular error;

determining a respective first similarity between the buggy code snippet and each of a plurality of bug patterns of previously identified bug scenarios;

selecting a particular bug pattern from the plurality of bug patterns based on a determined particular first similarity between the particular bug pattern and the buggy code snippet, wherein determining the particular first similarity includes:

building a first Abstract Program Graph (APG) that represents the buggy code snippet;

building a second APG that represents the particular bug pattern; and

determining the particular first similarity based on overlap between the first APG and the second APG;

determining a respective second similarity between the particular bug pattern and each of a plurality of example code snippets each obtained from a respective post of a plurality of posts obtained from one or more websites; and

selecting, from the plurality of posts, a particular post as providing a potential solution to correct the particular error of the buggy code snippet based on a determined particular second similarity between the particular bug pattern and a particular example code snippet of the particular post, wherein determining the particular second similarity includes:

building a third APG that represents the particular example code snippet; and

determining the particular second similarity based on overlap between the second APG and the third APG.

14. The system of claim 13 , wherein selecting the particular bug pattern from the plurality of bug patterns includes:

determining a first similarity score that indicates the particular first similarity between the particular bug pattern and the buggy code snippet;

selecting the particular bug pattern in response to the first similarity score indicating that the particular bug pattern has a highest degree of similarity with the buggy code snippet as compared to the other bug patterns of the plurality of bug patterns;

determining a second similarity score that indicates the particular second similarity between the particular bug pattern and the particular example code snippet; and

selecting the particular post in response to the second similarity score indicating that the particular example code snippet has a highest degree of similarity with the particular bug pattern as compared to the other posts of the plurality of posts.

15. The system of claim 13 , wherein each of the plurality of bug patterns is formatted according to a syntax of a software language of the software program.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 5, 2020
From: MAHAJAN, SONAL; PRASAD, MUKUL R.
To: FUJITSU LIMITED
Reel/Frame 053408/0570 →
Continuity (1)
Related Publication 20220043738A1 · Feb 10, 2022