JS code testing method, storage medium, device and system

A technology of JS code and test method, applied in the field of human-machine identification, can solve the problems of inconvenient use and cumbersome process, and achieve the effects of good test performance, fast running speed and high test efficiency

Active Publication Date: 2019-07-16
WUHAN DOUYU NETWORK TECH CO LTD
View PDF14 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005]However, since a large amount of JavaScript code is generated according to various conditions when generating JavaScript code, for example, when verifying whether the logged-in user name is correct, because the user name may It is all Chinese, all English, a combination of characters or other arbitrary methods, etc. Therefore, when testing, it is necessary to test various types of user names, that is, there are a large number of JavaScript codes for testing. If these large numbers of JavaScript codes are all placed in the browser to execute, the process is cumbersome, and it is very inconvenient to use

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
  • JS code testing method, storage medium, device and system
  • JS code testing method, storage medium, device and system
  • JS code testing method, storage medium, device and system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0033] The present invention will be described in further detail below in conjunction with the accompanying drawings and embodiments.

[0034] see figure 1 As shown, the embodiment of the present invention provides a test method of JS code, which is used to test whether the JS code is correct. In the embodiment of the present invention, the JS code to be detected is automatically generated JavaScript code to realize the addition function. Take the JavaScript code as an example, the JavaScript code is as follows:

[0035] function AddFunc(a,b)

[0036] {

[0037] return a+b;

[0038]}

[0039] Var result1 = AddFunc(2,3);

[0040] Var result2 = AddFunc(-5,3);

[0041] Var result3 = AddFunc(-5,-3);

[0042] Var result4 = AddFunc(0,0);

[0043] Var result5 = AddFunc(4294967295,2);

[0044] The above auto-generated JavaScript code is an addition function, which is used to calculate the result of adding two variables.

[0045] A kind of testing method of JS code in the embo...

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 discloses a JS code testing method, which relates to the technical field of man-machine identification, and comprises the following steps of integrating a JS engine in a JS code, compiling a JS engine interface for executing the JS code, and calling the JS engine interface to obtain an execution result of the JS code; compiling a compiled language code with the same function as the JS code, and executing the compiled language code to obtain an execution result of the compiled language code; and comparing whether the execution result of the JS code is consistent with the executionresult of the compiled language code, and judging whether the JS code is correct or not according to the comparison result. The JS code testing method provided by the invention is fast in running speed, can be suitable for testing a large number of JavaScript codes, and is relatively higher in testing efficiency and good in testing performance.

Description

technical field [0001] The invention relates to the technical field of man-machine identification, in particular to a JS code testing method, storage medium, equipment and system. Background technique [0002] JS, short for JavaScript, is the most popular scripting language on the Internet, and it can run in all major browsers, such as Internet Explorer, Chrome, Mozilla Firefox, Netscape, and Opera. [0003] At present, the programming language of WEB programs is JavaScript, which is a dynamic scripting language. When it is released, it is equivalent to the release of source code, which makes it extremely easy to be cracked. For some core JavaScript codes, many developers will write code to generate JavaScript. code, which can be frequently replaced and enhanced its security. At the same time, in order to ensure the accuracy of the automatically generated JavaScript code, a method is needed to test the automatically generated JavaScript code to verify whether the automatica...

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): G06F11/36
CPCG06F11/3692G06F11/3688
Inventor 周志刚张文明陈少杰
Owner WUHAN DOUYU NETWORK TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products