Source Code Annotation Language for Bug Detection

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing software development techniques face challenges in detecting and managing programming errors in complex software applications due to the complexity and size of modern software, with existing specification languages being either too complex or not expressive enough to effectively detect a desirable range of errors.

Innovation Solution

A source code annotation language that uses contracts to define mappings from precondition states to postcondition states, allowing explicit definition of property and qualifier annotations, which can be applied to various annotation targets such as global variables, function parameters, and buffer characteristics to detect errors like buffer overruns.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If existing specification languages are used to detect programming errors, then some bugs can be detected, but the languages are either too complex or not expressive enough to detect a desirable range of errors

Engineering Contradiction:
Improvebug detection capabilityVSAvoidspecification language complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent changes the parameters of specification languages by introducing a hierarchical structure with multiple levels of abstraction. Instead of using a single complex specification language, the invention employs a family of specification languages with varying degrees of complexity, allowing users to select the appropriate level based on their needs. This resolves the contradiction by providing expressive power when needed while maintaining simplicity when sufficient.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent segments the specification language into modular components that can be independently selected and combined. The specification system is divided into separate elements such as preconditions, postconditions, invariants, and various property specifications, which can be applied selectively to different parts of the code. This modularity reduces overall complexity while maintaining the ability to detect a broad range of errors.

Inventive Principle:
Principle #1Segmentation

2Reliability

If complex specification languages are used to describe program behavior, then more bugs can be detected, but the burden on programmers to write specifications becomes similar to re-writing the program in a new language

Engineering Contradiction:
Improvebug detection capabilityVSAvoidprogrammer burden
Core Design Contradiction:
ReliabilityVSEase of operation

Solution Approach 1:

The patent introduces dynamic adaptability in the specification process, allowing the complexity of specifications to adjust based on the program's needs. The system can automatically infer certain specifications from the code structure and only require explicit specifications where necessary. This dynamic approach reduces the programmer burden while maintaining comprehensive bug detection capability.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent employs templates and patterns that can be copied and reused across different parts of the program. Once a specification pattern is established for a particular type of operation, it can be replicated elsewhere, significantly reducing the effort required to write specifications. This copying mechanism maintains high reliability through consistent specification application while minimizing the ongoing burden on programmers.

Inventive Principle:
Principle #26Copying

3Ease of operation

If simple specification languages are used, then the programmer burden is reduced, but the languages are not expressive enough to describe the program in a useful way or allow detection of a desirable range of errors

Engineering Contradiction:
Improveprogrammer burdenVSAvoidbug detection capability
Core Design Contradiction:
Ease of operationVSReliability

Solution Approach 1:

The patent creates a universal specification framework that can handle multiple types of bug detection through a unified system. The same basic specification language structure supports detection of buffer overruns, null pointer dereferences, logic errors, and other programming mistakes. This multi-functionality maintains ease of operation by using a consistent language while achieving broad bug detection capability through flexible application of specifications.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Data Source

PatentUS7584458B2Source code annotation language
Publication Date: 2009.09.01 MICROSOFT TECHNOLOGY LICENSING LLC
  • US7584458B2 patent drawing
  • US7584458B2 patent drawing
  • US7584458B2 patent drawing

AI summary

Techniques and tools for implementing a source code annotation language are described. In one aspect, keywords are added to a function interface to define a contract for the function independent of function call context. In another aspect, annotations are inserted at global variables, formal parameters, return values, or user-defined types. The annotations include, for example, properties and qualifiers. A property can indicate, for example, a characteristic of a buffer. In another aspect, an annotation indicates that a value has usability properties sufficient to allow a function to rely on the value, where the usability properties depend on value type.