Patent ID: 8166463

Claim:
A method for code coverage utilizing efficient dynamic mutation of logic (EDML), the method comprising: reading a source code; locating instrumentation points; inserting self modifying code (SMC) at the instrumentation points producing instrumented code; inserting additional functions in the source code to enable reading and resetting of code coverage statistics; compiling the instrumented code; running executables for a period of time during which zero or more instrumentation points are executed; executing instructions to record execution of the instrumented code, in response to executing instrumentation points, wherein the instrumented code overwrites themselves at certain points so that a next execution of the instrumentation points skips over the instrumented code at the certain points so as not to record execution, in which skipping over the instrumented code at the certain points is based on a global generation value being less than or equal to a constant value where the constant value is dynamically overwritten with a current global generation value every time the instrumented code is mutated; and wherein incrementing the global generation value causes all sites of the instrumentation points to become active for recording execution, and when the all sites of the instrumentation points are executed no more recording execution occurs until the global generation value changes again; gathering code coverage statistics; resetting the code coverage statistics in memory back to an original state before the executable was run; iterating over all instrumentation points when the code coverage statistics are gathered; and determining whether in-memory code is modified, wherein if in-memory code is determined to be modified, the instrumentation points are reached, and wherein if in-memory code is determined not to be modified the instrumentation points are not reached.