Debugger-Based Code Coverage for Scriptable Languages

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing code coverage tools for scriptable programming languages, such as VBScript, require source code modification through instrumentation, which is resource-intensive and introduces complexity, making them disruptive to program development.

Innovation Solution

A method that uses a debugger with proactively generated breakpoints to detect code coverage without modifying the source code, employing a custom debugger to update a coverage data structure and correlate the results with the source code, allowing for code coverage detection without the need for instrumenting log statements.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If source code instrumentation is used to detect code coverage, then measurement precision is improved, but device complexity and resource intensity increase

Engineering Contradiction:
Improvecode coverage measurement accuracyVSAvoidsource code modification complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent introduces a debugger as an intermediary between the source code and the coverage detection mechanism. Instead of directly instrumenting the source code, the debugger acts as a mediator that intercepts execution flow through breakpoints, collecting coverage information without modifying the original source code. This resolves the contradiction by maintaining measurement precision while eliminating the complexity of source code instrumentation.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent replaces the mechanical approach of source code instrumentation (modifying code structure) with a software-based interception mechanism using debugger breakpoints. Instead of physically altering the source code to insert log statements, the system uses virtual breakpoints that pause execution at specific locations, achieving the same measurement goal without code modification. This substitution eliminates the complexity and resource intensity of instrumentation.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

2Measurement precision

If log statements are injected into source code to track execution, then measurement precision is improved, but productivity decreases due to resource intensity

Engineering Contradiction:
Improvecode coverage tracking accuracyVSAvoidprogram development efficiency
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The debugger serves as an intermediary that handles coverage tracking without requiring changes to the source code. By using breakpoints as a mediation mechanism, the system can track execution paths and measure code coverage accurately while leaving the original source code unchanged, thus maintaining full productivity and eliminating the resource intensity associated with instrumentation.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

Instead of modifying the original source code by injecting log statements, the patent creates a virtual copy of the execution trace through debugger breakpoints. This copying approach allows the system to track coverage information by observing execution at breakpoint locations without altering the original code, thereby maintaining productivity while achieving accurate measurement.

Inventive Principle:
Principle #26Copying

3Measurement precision

If instrumentation is added to source code for coverage detection, then measurement precision is improved, but ease of operation deteriorates

Engineering Contradiction:
Improvecode coverage detection accuracyVSAvoidprogram development convenience
Core Design Contradiction:
Measurement precisionVSEase of operation

Solution Approach 1:

The debugger acts as an intermediary layer that provides coverage detection capabilities without requiring developers to modify their source code. Developers can simply run the program through the debugger with coverage enabled, and the system automatically tracks execution through breakpoints. This maintains ease of operation by eliminating the need for developers to learn and apply instrumentation techniques while preserving measurement precision.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS8954926B2Code coverage detection with scriptable language unmodified source
Publication Date: 2015.02.10 MICROSOFT TECHNOLOGY LICENSING LLC
  • US8954926B2 patent drawing
  • US8954926B2 patent drawing
  • US8954926B2 patent drawing

AI summary

Code coverage detection for interpreted scriptable programming languages avoids source code modification. Each program element of the script is performed by (a) using a debugger to proactively computationally indicate in a coverage data structure that the element was reached, and integrally (b) running non-logger executable code which corresponds to the element. Coverage of lines, statements, and other program elements during script execution can be measured even though the source code has not been instrumented with injected log statements. Proactively generated breakpoints pass control from each coverage-tracked program element into a code coverage debugger which updates the coverage data structure. Comments are skipped. Code coverage detection may be invoked from a command line, an Integrated Development Environment, or another context. The coverage data structure is correlated with the source code to produce a coverage map that is displayed to users showing which source code was performed.