Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

JavaScript function parameter mismatch detection method based on static program analysis

A technology of static program analysis and detection method, applied in the field of software and computer

Pending Publication Date: 2020-09-22
NANJING UNIV
View PDF3 Cites 4 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0006] There is currently a lack of detection tools for JavaScript function actual participation formal parameter mismatch

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • JavaScript function parameter mismatch detection method based on static program analysis
  • JavaScript function parameter mismatch detection method based on static program analysis
  • JavaScript function parameter mismatch detection method based on static program analysis

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0014] The present invention specifically comprises the following steps:

[0015] 1) Import the project to be analyzed, and extract the information related to the functions defined and called in the project. This information is obtained by building an abstract syntax tree, traversing the abstract syntax tree, and analyzing it from the grammatical level.

[0016] 2) Construct the function call graph of the custom function of the entire project, and then obtain the definition-call pair according to the function call graph, and combine the function call obtained in step 1) and the relevant information of the function definition to obtain each pair of definition-call with information right.

[0017] 3) Infer the parameter types of defining functions and calling functions by combining static program analysis, natural language processing and probability models. For defining functions, type inference is performed on parameters through natural language processing methods, and at the...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention relates to a JavaScript function parameter mismatch detection method based on a static program analysis and natural language processing method. The method comprises the steps of, constructing an abstract syntax tree AST for each file in a JavaScript project, traversing the AST tree, and extracting program related information of a definition function and a construction function of thewhole project; scanning and analyzing the JavaScript file of the whole project, respectively obtaining specific positions of a definition function and a calling function, and constructing a functioncalling graph of the project; according to the extracted annotation information, deducing the type of the parameter through a natural language processing method in combination with probability; and according to the extracted information, detecting the inconsistency of the parameter number, the parameter name and the parameter type, and giving a detection report that the JavaScript function parameters in the project are not matched.

Description

technical field [0001] The invention belongs to the field of computer technology, especially the field of software technology. The present invention proposes a JavaScript function parameter mismatch detection method based on static program analysis, combined with natural language processing technology, the method can detect various types of JavaScript function parameter mismatch, including inconsistency in the number of parameters and inconsistency in parameter naming Inconsistency with the parameter type. Background technique [0002] With the rapid development of Web applications, JavaScript is widely used in client-side and server-side projects, which puts high demands on the stability and reliability of JavaScript applications. However, JavaScript's loosetype and dynamic nature make JavaScript-based applications more error-prone. [0003] In order to enhance the robustness of JavaScript applications, researchers have proposed a variety of testing techniques for Web app...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F8/41G06F11/36
CPCG06F8/43G06F11/3608
Inventor 许蕾查春柳陈林徐宝文
Owner NANJING UNIV
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products