Adversarial Code Language Identification via Pattern Mapping
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing automated code review tools face challenges in accurately determining the programming language of code, as conventional methods are susceptible to deception and require manual input or file extensions, which can be misleading.
Innovation Solution
A code scanning tool that generates a pattern map of string patterns from the code and compares them against a master voting map to identify the programming language, using weights associated with learned patterns to determine the language used.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If conventional methods are used to determine programming language based on manual input or file extensions, then the process is simple to implement, but the accuracy is low and susceptible to deception
Solution Approach 1:
The patent replaces manual inspection and file extension checking with automated pattern recognition. The code scanning tool automatically generates pattern maps from code and compares them against learned programming language patterns, substituting human judgment and simple heuristics with systematic automated analysis that is both accurate and scalable.
Solution Approach 2:
The code scanning tool performs self-service by automatically determining programming language without requiring manual input from users. The system autonomously generates pattern maps, compares them against the master voting map, and identifies the programming language based on weighted pattern matching, eliminating the need for user intervention in the language detection process.
2Measurement precision
If automated pattern recognition is used to determine programming language, then the accuracy is improved, but the processing time increases
Solution Approach 1:
The system performs preliminary action by pre-computing and storing learned programming language patterns in a master voting map during an offline training phase. This allows the online code analysis to directly compare generated pattern maps against pre-established patterns without performing complex learning computations, significantly reducing processing time while maintaining high accuracy.
Solution Approach 2:
The patent segments the code analysis process into distinct phases: generating a pattern map from the code, comparing it against the master voting map, and determining the programming language based on weighted pattern matching. This segmentation allows each phase to be optimized independently, improving overall efficiency while maintaining accuracy.
3Reliability
If comprehensive pattern analysis is performed on all code, then the reliability is improved, but the computational resources required increase
Solution Approach 1:
The system applies partial action by using a weighted pattern matching approach where not all patterns contribute equally to the language determination. The master voting map assigns weights to different patterns based on their discriminative power, allowing the system to focus computational resources on the most informative patterns while maintaining high reliability in language identification.
Data Source
AI summary
Techniques to determine a programming language of a set of code based on learned programming language patterns. One technique includes receiving a set of code, generating a pattern map of discovered string patterns from the set of code, comparing the string patterns included within the pattern map against learned programming language patterns included with a master voting map to identify one or more profiled programming languages that utilize the learned programming, language patterns that match the string patterns, generating a score card for the set of code by tallying scores for the one or more profiled programming languages based on the comparing, and determining one or more programming languages used to write the set of code based on the score card.


