Patent attributes
For each detected bug, historical code with similar characteristics and bug corrections from a historical bug dataset can be displayed in a source code editor. Relevant training and/or testing data can be found by comparing an internal representation of the code under development with an internal representation of the original buggy code in the historical bug dataset. Training and/or testing data that is relevant to the current code can be distinguished from irrelevant training and/or testing data by determining that the code syntax tokens from the current and historical data overlap to at least a specified percentage. Code can be devolved into a set of metrics. The degree of overlap between the metric sets can be determined. If a computed risk factor for the bug correction meets or exceeds a specified threshold, the bug correction can be automatically applied. Additional testing can be automatically performed on and/or added to the corrected code.