Detecting Mistyped Identifiers via Static Code Analysis

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In dynamic programming languages where static resolution is not used, mistyped or misspelled identifiers can go undetected during development and testing, leading to costly software defects.

Innovation Solution

A code testing system performs static analysis by creating an occurrence table to track identifier usage and applies rules to identify and correct mistyped identifiers, using hash values and similarity comparisons to suggest corrections without relying on dynamic execution or predefined dictionaries.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If static resolution is used to detect mistyped identifiers, then detection reliability is improved, but device complexity and programming language restrictions increase

Engineering Contradiction:
Improvedetection reliabilityVSAvoidprogramming language restrictions
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent segments the detection process into two independent phases: (1) gathering and indexing identifier occurrence information from the codebase, and (2) inferring defects by analyzing frequency and similarity patterns. This segmentation allows the system to operate on static code structures without requiring dynamic execution or complex language support, resolving the contradiction between detection reliability and language flexibility.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces an intermediary occurrence table that indexes identifier occurrences across the codebase. This intermediary structure enables the system to detect mistyped identifiers by analyzing statistical patterns (frequency, similarity to other identifiers) rather than relying on direct static resolution mechanisms, thus improving detection capability without imposing language restrictions.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Productivity

If static analysis is performed without running the program, then productivity is improved, but measurement precision of identifier correctness decreases

Engineering Contradiction:
Improveanalysis speedVSAvoididentifier correctness detection
Core Design Contradiction:
ProductivityVSMeasurement precision

Solution Approach 1:

The system uses the codebase itself as the source of reference information for detecting mistyped identifiers. By indexing all identifier occurrences and analyzing their frequency and similarity patterns within the codebase, the system performs self-verification without external references or program execution, achieving both high productivity and accurate detection.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The patent replaces mechanical program execution with a statistical analysis mechanism. Instead of running the program to detect runtime errors, the system uses computational statistics (frequency counting, string similarity comparisons) on static code data to infer identifier correctness, thereby achieving fast analysis without sacrificing detection precision.

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

3Difficulty of detecting and measuring

If occurrence frequency threshold is set low to detect rare identifiers, then detection sensitivity is improved, but false positive rate increases

Engineering Contradiction:
Improvedetection sensitivityVSAvoidfalse positive rate
Core Design Contradiction:
Difficulty of detecting and measuringVSObject-affected harmful factors

Solution Approach 1:

The patent changes the detection parameters from simple frequency thresholds to a multi-parameter analysis including: (1) occurrence frequency, (2) similarity to other identifiers, and (3) contextual patterns. This parameter transformation allows the system to detect rare but valid identifiers while filtering out false positives through comprehensive pattern matching rather than relying on arbitrary frequency cutoffs.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS10216611B2Detecting mistyped identifiers and suggesting corrections using other program identifiers
Publication Date: 2019.02.26 BLACK DUCK SOFTWARE INC
  • US10216611B2 patent drawing
  • US10216611B2 patent drawing
  • US10216611B2 patent drawing

AI summary

A code testing system determines mistyped identifiers in computer language code. For identifiers of objects in the code, such as variables and functions, the instances of the identifiers are identified in the code and recorded in an occurrence table. Uses of an identifier may be identified as copies of one another based on a hash value of the instance and its location in a function. Hash values for an identifier that are not unique may not be recorded in the instance table. For identifiers that are associated with a single occurrence or a single group of copies, these identifiers are identified as candidates for correction. Suggested corrections are determined based on a comparison with other identifiers in the occurrence table to determine similar identifiers in the occurrence table. If so, the candidate identifier may be identified as likely mistyped and the similar identifier is suggested as a correction.