| CPC G06F 11/3688 (2013.01) [G06F 8/71 (2013.01); G06F 11/368 (2013.01)] | 10 Claims |

|
1. A computerized method for implementing impact-centric source code testing based on historical execution analysis, the method comprising:
retrieving, by a server computer, historical testing data associated with a source code base, the historical testing data comprising identification of a plurality of tests previously executed against the source code base;
performing, by the server computer, a compiler scan of the source code base to generate a mapping of one or more of the plurality of tests to each line of code in the source code base using the historical testing data;
storing, by the server computer, each of the mappings in a table in a mapping database, each record in the table comprising an id number, a test class identifier, a test name identifier, a source file identifier, a coverage identifier, a line number identifier, and an update flag;
receiving, by the server computer, a source code file comprising a plurality of modified classes and a plurality of unmodified classes, each class associated with a class name;
for each of the plurality of modified classes:
(i) when a new line of code was added to the modified class, the server computer identifies a new test to be mapped to the new line of code using the compiler scan, generates a new mapping of the new test to the new line of code, and adds the new mapping to the mapping database, and
(ii) when an existing line of code was deleted from the modified class, the server computer deletes a mapping for the deleted line of code from the mapping database;
determining, by the server computer, a plurality of impacted classes in the source code file based on the class names corresponding to the plurality of modified classes;
for each of the plurality of impacted classes in the source code file, identifying, by the server computer, at least one test of the plurality of tests historically executed against the plurality of impacted classes using the mapping database;
for each of the plurality of impacted classes in the source code file for which at least one corresponding test is identified, initiating, by the server computer, the at least one identified test for the impacted class;
generating, by the server computer, a data log comprising a plurality of results generated by the at least one test for each of the plurality of impacted classes;
receiving, by the server computer, a notification when a code commit is requested against the source code base, the notification comprising an identification of modified classes in the source code base associated with the code commit;
displaying, by the server computer, a visualization that comprises identification of: the requested code commit, enumeration of each of a plurality of line numbers for added lines to the source code base, and enumeration of each of a plurality of line numbers for removed lines from the source code base;
rejecting, by the server computer, the code commit when a threshold of modified source code in the code commit is not associated with at least one corresponding test; and
executing the code commit to integrate the modified source code into the source code base upon determining that a threshold of modified source code in the code commit is associated with at least one corresponding test.
|