CN109634844B - JS code testing method and device and electronic equipment - Google Patents

JS code testing method and device and electronic equipment Download PDF

Info

Publication number
CN109634844B
CN109634844B CN201811317347.3A CN201811317347A CN109634844B CN 109634844 B CN109634844 B CN 109634844B CN 201811317347 A CN201811317347 A CN 201811317347A CN 109634844 B CN109634844 B CN 109634844B
Authority
CN
China
Prior art keywords
function
code
grammar
compatibility
tested
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811317347.3A
Other languages
Chinese (zh)
Other versions
CN109634844A (en
Inventor
焦玉琨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
3600 Technology Group Co ltd
Original Assignee
3600 Technology Group Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 3600 Technology Group Co ltd filed Critical 3600 Technology Group Co ltd
Priority to CN201811317347.3A priority Critical patent/CN109634844B/en
Publication of CN109634844A publication Critical patent/CN109634844A/en
Application granted granted Critical
Publication of CN109634844B publication Critical patent/CN109634844B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis

Abstract

The invention relates to the technical field of Internet, in particular to a JS code testing method and device and electronic equipment. The JS code testing method comprises the following steps: acquiring a JS code to be tested and a first configuration file corresponding to the JS code to be tested; and simultaneously testing the compatibility of the JS codes to be tested relative to a preset browser set based on the first configuration file, and obtaining a code compatibility test result of the JS codes to be tested. When the JS code to be tested is required to be tested, the compatibility of the JS code to be tested relative to a preset browser set can be directly and simultaneously tested only on the basis of the first configuration file, so that a code compatibility test result of the JS code to be tested is obtained, and compared with the scheme that each browser is used for testing the compatibility of the JS code to be tested in a manual test mode in the prior art, the test efficiency is improved to a greater extent.

Description

JS code testing method and device and electronic equipment
Technical Field
The invention relates to the technical field of Internet, in particular to a JS code testing method and device and electronic equipment.
Background
JS, javascript, is a programming language created to meet the needs of dynamic web page production, and is now being widely used in the production of intelt web pages, so the development amount and test amount of JS codes are gradually increasing. However, in the prior art, the testing efficiency of the JS code is low, for example, when the compatibility of the JS code to be tested by the preset browser set is tested, the compatibility of the JS code to be tested by each preset browser can only be tested by a manual test mode, so the testing efficiency is extremely low.
Disclosure of Invention
Accordingly, an objective of the embodiments of the present invention is to provide a JS code testing method, a JS code testing device, and an electronic device, so as to effectively solve the above problems.
The JS code testing method provided by the embodiment of the invention comprises the following steps:
acquiring a JS code to be tested and a first configuration file corresponding to the JS code to be tested;
and simultaneously testing the compatibility of the JS codes to be tested relative to a preset browser set based on the first configuration file, and obtaining a code compatibility test result of the JS codes to be tested.
Further, the JS code to be tested includes at least one target JS function, and the first configuration file includes at least one piece of function compatibility information for characterizing that the JS function is incompatible with the preset browser set;
The step of simultaneously testing the compatibility of the JS code to be tested relative to a preset browser set based on the first configuration file to obtain a code compatibility test result of the JS code to be tested includes:
based on at least one piece of function compatibility information, respectively determining a function compatibility test result of each target JS function in the JS code to be tested relative to the preset browser set;
determining a code compatibility test result of the JS codes to be tested according to function compatibility test results of all target JS functions in the JS codes to be tested;
and if all the target JS functions in the JS codes to be tested are compatible with the preset browser set, determining that the code compatibility test results of the JS codes to be tested are compatible, otherwise, determining that the code compatibility test results of the JS codes to be tested are incompatible.
Further, the determining, based on at least one piece of the function compatibility information, a function compatibility test result of each objective JS function in the JS code to be tested with respect to the preset browser set includes:
for each target JS function in the JS code to be tested, judging whether function compatibility information corresponding to the target JS function exists in the first configuration file or not respectively;
If the function compatibility information corresponding to the target JS function exists in the first configuration file, determining the function compatibility test result of the target JS function according to the function compatibility information, otherwise, determining the function compatibility test result of the target JS function as compatible.
Further, the function compatibility information includes function labels and function contents corresponding to the function labels, each function label corresponds to a JS function, and the function contents are used for representing compatibility of the JS function corresponding to the function label relative to the browser in the preset browser set;
the determining the function compatibility test result of the target JS function according to the function compatibility information includes:
determining an association type of the function compatibility information based on a preset information association condition, wherein the association type comprises a first association type and a second association type, the first association type is used for representing that function compatibility information associated with the function compatibility information function does not exist in the first configuration file, and the second association type is used for representing that function compatibility information associated with the function compatibility information function exists in the first configuration file;
If the association type of the function compatibility information is the first association type, determining the function compatibility test result of the target JS function according to the function compatibility information;
and if the association type of the function compatibility information is the second association type, determining the function compatibility test result of the target JS function according to the function content of the function compatibility information and the function content of the function compatibility information functionally associated with the function compatibility information.
Further, the determining the function compatibility test result of the target JS function according to the function content of the function compatibility information and the function content of the function compatibility information functionally associated with the function compatibility information includes:
obtaining a browser compatible with a JS function corresponding to the function compatibility information as a first browser according to the function content of the function compatibility information;
the function compatibility information associated with the function compatibility information function is used as associated function compatibility information, and a browser compatible with the JS function corresponding to the associated function compatibility information is obtained as a second browser according to the function content of the associated function compatibility information;
Judging whether the set of the first browser and the second browser is the same as the preset browser set or not;
and if the set of the first browser and the second browser is the same as the preset browser set, determining that the function compatibility test result of the target JS function is compatible, otherwise, determining that the function compatibility test result of the target JS function is incompatible.
Further, when the function compatibility test result of the target JS function is incompatible, the determining the function compatibility test result of the target JS function according to the function compatibility information further includes:
determining an incompatibility type of the function compatibility information based on a preset browser compatibility condition, wherein the incompatibility type comprises a first incompatibility type and a second incompatibility type, the first incompatibility type is used for representing that the incompatibility condition of the function compatibility information is completely incompatibility, and the second incompatibility type is used for representing that the incompatibility condition of the function compatibility information is not completely compatibility;
if the incompatible type of the function compatibility information is the first incompatible type, determining that the function compatibility result of the target JS function is completely incompatible;
And if the incompatible type of the function compatibility information is the second incompatible type, determining that the function compatibility result of the target JS function is not completely compatible.
Further, the JS code testing method further includes:
acquiring a second configuration file corresponding to the JS code to be tested;
and testing the grammar standardability of the JS codes to be tested based on the second configuration file, and obtaining a code grammar standardability test result of the JS codes to be tested.
Further, the second configuration file includes at least one piece of grammar normalization information for characterizing a grammar non-normalization problem of the JS code to be tested;
the step of testing the grammar normalization of the JS code to be tested based on the second configuration file to obtain a code grammar normalization test result of the JS code to be tested, including:
judging whether grammar setting corresponding to the grammar normalization information exists in the JS codes to be tested according to each piece of grammar normalization information;
if the JS codes to be tested have grammar setting corresponding to the grammar normalization information, setting the grammar as non-canonical grammar;
if the non-standard grammar exists in the JS codes, determining that the code grammar standardability test result of the JS codes to be tested is non-standard, otherwise, determining that the code grammar standardability test result of the JS codes to be tested is standard.
Further, if the JS code to be tested has a grammar setting corresponding to the grammar normalization information, the grammar setting is used as an unnormal grammar, including:
determining an irregular type of the grammar normalization information based on a preset grammar normalization condition, wherein the irregular type comprises a first irregular type and a second irregular type, the first irregular type is used for representing that grammar irregular questions of the grammar normalization information are completely irregular, and the second irregular type is used for representing that the irregular questions of the grammar normalization information are incompletely standardized;
if the non-canonical type of the grammar normalization information is the first non-canonical type, setting the grammar as a completely non-canonical grammar;
and if the non-canonical type of the grammar normalization information is the second non-canonical type, setting the grammar as a complete non-canonical grammar.
The JS code testing device provided by the embodiment of the invention comprises:
the device comprises a first configuration file acquisition module, a second configuration file acquisition module and a test module, wherein the first configuration file acquisition module is used for acquiring a JS code to be tested and a first configuration file corresponding to the JS code to be tested;
and the first test result acquisition module is used for simultaneously testing the compatibility of the JS codes to be tested relative to a preset browser set based on the first configuration file and acquiring a code compatibility test result of the JS codes to be tested.
Further, the JS code to be tested includes at least one target JS function, and the first configuration file includes at least one piece of function compatibility information for characterizing that the JS function is incompatible with the preset browser set;
the first test result obtaining module is specifically configured to:
based on at least one piece of function compatibility information, respectively determining a function compatibility test result of each target JS function in the JS code to be tested relative to the preset browser set;
determining a code compatibility test result of the JS codes to be tested according to function compatibility test results of all target JS functions in the JS codes to be tested;
and if all the target JS functions in the JS codes to be tested are compatible with the preset browser set, determining that the code compatibility test results of the JS codes to be tested are compatible, otherwise, determining that the code compatibility test results of the JS codes to be tested are incompatible.
The first test result obtaining module is further specifically configured to:
for each target JS function in the JS code to be tested, judging whether function compatibility information corresponding to the target JS function exists in the first configuration file or not respectively;
If the function compatibility information corresponding to the target JS function exists in the first configuration file, determining the function compatibility test result of the target JS function according to the function compatibility information, otherwise, determining the function compatibility test result of the target JS function as compatible.
Further, the function compatibility information includes function labels and function contents corresponding to the function labels, each function label corresponds to a JS function, and the function contents are used for representing compatibility of the JS function corresponding to the function label relative to the browser in the preset browser set;
the first test result obtaining module is specifically further configured to:
determining an association type of the function compatibility information based on a preset information association condition, wherein the association type comprises a first association type and a second association type, the first association type is used for representing that function compatibility information associated with the function compatibility information function does not exist in the first configuration file, and the second association type is used for representing that function compatibility information associated with the function compatibility information function exists in the first configuration file;
If the association type of the function compatibility information is the first association type, determining the function compatibility test result of the target JS function according to the function compatibility information;
and if the association type of the function compatibility information is the second association type, determining the function compatibility test result of the target JS function according to the function content of the function compatibility information and the function content of the function compatibility information functionally associated with the function compatibility information.
The first test result obtaining module is further specifically configured to:
obtaining a browser compatible with a JS function corresponding to the function compatibility information as a first browser according to the function content of the function compatibility information;
the function compatibility information associated with the function compatibility information function is used as associated function compatibility information, and a browser compatible with the JS function corresponding to the associated function compatibility information is obtained as a second browser according to the function content of the associated function compatibility information;
judging whether the set of the first browser and the second browser is the same as the preset browser set or not;
And if the set of the first browser and the second browser is the same as the preset browser set, determining that the function compatibility test result of the target JS function is compatible, otherwise, determining that the function compatibility test result of the target JS function is incompatible.
Further, when the function compatibility test result of the objective JS function is incompatible, the first test result obtaining module is further specifically configured to:
determining an incompatibility type of the function compatibility information based on a preset browser compatibility condition, wherein the incompatibility type comprises a first incompatibility type and a second incompatibility type, the first incompatibility type is used for representing that the incompatibility condition of the function compatibility information is completely incompatibility, and the second incompatibility type is used for representing that the incompatibility condition of the function compatibility information is not completely compatibility;
if the incompatible type of the function compatibility information is the first incompatible type, determining that the function compatibility result of the target JS function is completely incompatible;
and if the incompatible type of the function compatibility information is the second incompatible type, determining that the function compatibility result of the target JS function is not completely compatible.
Further, the JS code testing device further includes:
the second configuration file acquisition module is used for acquiring a second configuration file corresponding to the JS code to be tested;
and the second test result acquisition module is used for testing the grammar normalization of the JS codes to be tested based on the second configuration file and acquiring a code grammar normalization test result of the JS codes to be tested.
Further, the second configuration file includes at least one piece of grammar normalization information for representing grammar non-normalization problems of the JS codes to be tested;
the second test result obtaining module is specifically configured to:
judging whether grammar setting corresponding to the grammar normalization information exists in the JS codes to be tested according to each piece of grammar normalization information;
if the JS codes to be tested have grammar setting corresponding to the grammar normalization information, setting the grammar as non-canonical grammar;
if the non-standard grammar exists in the JS codes, determining that the code grammar standardability test result of the JS codes to be tested is non-standard, otherwise, determining that the code grammar standardability test result of the JS codes to be tested is standard.
The second test result obtaining module is further specifically configured to: determining an irregular type of the grammar normalization information based on a preset grammar normalization condition, wherein the irregular type comprises a first irregular type and a second irregular type, the first irregular type is used for representing that grammar irregular questions of the grammar normalization information are completely irregular, and the second irregular type is used for representing that the irregular questions of the grammar normalization information are incompletely standardized;
if the non-canonical type of the grammar normalization information is the first non-canonical type, setting the grammar as a completely non-canonical grammar;
and if the non-canonical type of the grammar normalization information is the second non-canonical type, setting the grammar as a complete non-canonical grammar.
The electronic device provided by the embodiment of the invention comprises a processor, a memory and the JS code testing device, wherein the JS code testing device comprises one or more software function modules which are stored in the memory and executed by the processor.
The embodiment of the invention also provides a computer readable storage medium, on which a computer program is stored, which can realize the JS code testing method when being executed.
The JS code testing method, the JS code testing device and the electronic equipment provided by the embodiment of the invention can acquire the JS code to be tested and the first configuration file corresponding to the JS code to be tested, and simultaneously test the compatibility of the JS code to be tested relative to a preset browser set based on the first configuration file, so as to acquire a code compatibility testing result of the JS code to be tested. Therefore, compared with the scheme in the prior art that each browser is used for testing the compatibility of the JS code to be tested respectively in a manual test mode, the test efficiency is improved to a greater extent.
The foregoing description is only an overview of the present invention, and is intended to be implemented in accordance with the teachings of the present invention in order that the same may be more clearly understood and to make the same and other objects, features and advantages of the present invention more readily apparent.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present disclosure and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person of ordinary skill in the art.
Fig. 1 is a schematic block diagram of an electronic device according to an embodiment of the present invention.
Fig. 2 is a flowchart of a JS code testing method according to an embodiment of the present invention.
Fig. 3 is a schematic flow chart of another part of the JS code testing method according to an embodiment of the present invention.
Fig. 4 is a schematic block diagram of a JS code testing device provided by an embodiment of the present invention.
Fig. 5 is another schematic structural block diagram of a portion of a JS code testing device provided by an embodiment of the present invention.
Icon: 100-an electronic device; a 110-JS code testing device; 111-a first profile acquisition module; 112-a first test result acquisition module; 113-a second profile acquisition module; 114-a second test result acquisition module; a 120-processor; 130-memory.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present disclosure. The components of the embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present disclosure provided in the accompanying drawings is not intended to limit the scope of the disclosure, as claimed, but is merely representative of selected embodiments of the disclosure. All other embodiments, which can be made by those skilled in the art based on the embodiments of this disclosure without making any inventive effort, are intended to be within the scope of this disclosure.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures.
Referring to fig. 1, a schematic block diagram of an electronic device 100 applying a JS code testing method and apparatus is provided in an embodiment of the present invention. Further, in an embodiment of the present invention, the electronic device 100 includes a code testing apparatus 110, a processor 120, and a memory 130.
The processor 120 and the memory 130 are electrically connected directly or indirectly to each other for data transmission or interaction, for example, the components may be electrically connected to each other through one or more communication buses or signal lines. The JS code testing device 110 includes at least one software module that can be stored in the memory 130 in the form of software or Firmware (Firmware) or cured in the Operating System (OS) of the electronic device 100. The processor 120 is configured to execute executable modules stored in the memory 130, such as software functional modules and computer programs included in the JS code test device 110. The processor 120 may execute the computer program after receiving the execution instructions.
The processor 120 may be an integrated circuit chip with signal processing capability. Processor 120 may also be a general-purpose processor, such as a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a discrete gate or transistor logic, a discrete hardware component, or the like, that may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the present invention. Further, the general purpose processor may be a microprocessor or any conventional processor or the like.
The Memory 130 may be, but is not limited to, random access Memory (Random Access Memory, RAM), read Only Memory (ROM), programmable Read Only Memory (Programmable Read-Only Memory, PROM), erasable programmable Read Only Memory (Erasable Programmable Read-Only Memory, EPROM), electrically erasable programmable Read Only Memory Electric Erasable Programmable Read-Only Memory, EEPROM), and the like. The memory 130 is used for storing a program, and the processor 120 executes the program after receiving an execution instruction.
It should be understood that the configuration shown in fig. 1 is merely illustrative, and that the electronic device 100 provided in the embodiment of the present invention may have fewer or more components than those shown in fig. 1, or may have a different configuration than those shown in fig. 1. In addition, the components shown in fig. 1 may be implemented by software, hardware, or a combination thereof.
Referring to fig. 2, fig. 2 is a flowchart of a JS code testing method according to an embodiment of the present invention, where the JS code testing method is applied to the electronic device shown in fig. 1, and the specific flow and steps of the JS code testing method are described in detail below with reference to fig. 2. It should be noted that, the method provided by the present invention is not limited by the sequence shown in fig. 2 and the following, and the specific flow and steps of the JS code testing method are described in detail below with reference to fig. 2.
Step S100, a JS code to be tested and a first configuration file corresponding to the JS code to be tested are obtained.
The first configuration file is pre-created and is used for testing compatibility of the JS codes to be tested relative to a preset browser set. The preset browser set includes a plurality of different types of browsers, such as an IE browser, a Google browser, a fire fox browser, a 360-degree safe browser, a dog search browser, a window browser in the world, and the like. In the embodiment of the invention, specific flow and steps of the JS code testing method will be described in detail by taking an example that an IE browser, a Google browser and a fire fox browser are included in a preset browser set.
And step S200, based on the first configuration file, simultaneously testing the compatibility of the JS codes to be tested relative to a preset browser set, and obtaining a code compatibility test result of the JS codes to be tested.
The JS code to be tested comprises at least one target JS function. Wherein the objective JS function is event-driven, or when called, executes a reusable code block for implementing the corresponding function. For example, JS functions such as function currentStyle (), function getcomputedsstyle (), function const (), and the like.
In the embodiment of the present invention, the first configuration file may include at least one piece of function compatibility information for characterizing that the JS function is incompatible with respect to the preset browser set. It should be noted that, in the embodiment of the present invention, for a JS function, if there is an incompatible browser in the preset browser set, the JS function is incompatible with respect to the preset browser set. Based on the above, based on the first configuration file, the compatibility of the JS code to be tested relative to the preset browser set is tested at the same time, and a code compatibility test result of the JS code to be tested is obtained, which may include the following steps.
Based on at least one piece of function compatibility information, function compatibility test results of all target JS functions in the JS codes to be tested relative to a preset browser set are respectively determined, and code compatibility test results of the JS codes to be tested are determined according to the function compatibility test results of all the target JS functions in the JS codes to be tested. And if all the target JS functions in the JS codes to be tested are compatible with the preset browser set, determining the code compatibility test result of the JS codes to be tested as compatible, otherwise, determining the code compatibility test result of the JS codes to be tested as incompatible.
Further, in the embodiment of the present invention, based on at least one piece of function compatibility information, determining a function compatibility test result of each objective JS function in the JS code to be tested with respect to a preset browser set, respectively, may include the following steps.
And respectively judging whether function compatibility information corresponding to the target JS function exists in the first configuration file aiming at each target JS function in the JS code to be tested. Because, in the embodiment of the present invention, the function compatibility information is used to characterize that the JS function is incompatible with respect to the preset browser set, if the function compatibility information corresponding to the target JS function exists in the first configuration file, a function compatibility test result of the target JS function is determined according to the function compatibility information, otherwise, the function compatibility test result of the target JS function is determined as compatible.
Optionally, in the embodiment of the present invention, the function compatibility information includes function labels and function contents corresponding to the function labels, where each function label corresponds to a JS function, and the function contents are used to characterize compatibility of the JS function corresponding to the function label with respect to a browser in a preset browser set.
For example, the function compatibility information may be "currentStyle": "true: IE ", wherein" currentStyle "is a function tag, its corresponding JS function is currentStyle (), and the corresponding function of JS function currentStyle () is to obtain a non-inter-line style of html page element," true: IE "is a function content used to characterize that JS function currentStyle () is compatible with respect to the IE browser in the preset browser set, i.e., incompatible with respect to google browser and firefox browser in the preset browser set, so it will be appreciated that this function compatibility information can also be written as" "currentStyle": "false: chrome, firefox'. In the embodiment of the invention, in order to ensure the simplicity of the code, the writing of 'currentStyle' is preferred: "true: IE "". For another example, the function compatibility information may be "getComputedStyle": "false: IE ", wherein" getComputedStyle "is a function tag, its corresponding JS function is getComputedStyle (), and the corresponding function of the JS function getComputedStyle () is to obtain a non-interline style of an html page element," false: IE "is a function content for characterizing that the JS function getcomputedstate () is incompatible with respect to the IE browser in the preset browser set, that is, compatible with respect to the google browser and the firefox browser in the preset browser set, so it can be understood that the function compatibility information can also be written as" getcomputedstate: "true: chrome, firefox ". In the embodiment of the invention, in order to ensure the simplicity of the code, the writing "getComputedStyle" is preferred: "false: IE ". For another example, the function compatibility information may be "setAttribute": "false: IE ", wherein" setAttribute "is a function tag, its corresponding JS function is setAttribute (), and the corresponding function of JS function setAttribute () is set object attribute," false ": IE "is a function content used to characterize that the JS function setAttribute () is not compatible with respect to the IE browser in the preset browser set, i.e., compatible with respect to the google browser and the firefox browser in the preset browser set, and therefore, it can be understood that this function compatibility information can also be written as" const ": "false: chrome, firefox ". In the embodiment of the invention, in order to ensure the simplicity of the code, the writing "setAttribute" is preferred: "true: firefox ".
From the above, it can be seen that the two kinds of JS functions may be included in the JS code to be tested, and the corresponding functions of the two kinds of JS functions are the same, but the compatible browsers are different. For example, the JS function currentStyle () and the JS function getComputedStyle () correspond to the same function, but the JS function currentStyle () is compatible with the IE browser, and the JS function getComputedStyle () is compatible with the google browser and the firefox browser. In this case, in the embodiment of the present invention, the first configuration file is further configured to set a preset information association condition, which is used to determine an association type of the function compatibility information, where the association type includes a first association type and a second association type. The first association type is used to characterize that there is no function compatibility information associated with the function compatibility information function in the first configuration file, for example, function compatibility information "setAttribute": "false: IE ". The second association type is used to characterize the presence of function compatibility information associated with the function compatibility information function in the first configuration file, e.g., function compatibility information "currentStyle": "true: IE "and function compatibility information" getComputedStyle ": "false: IE ". In practical implementation, to ensure the cleanliness of the code, the function compatibility information of which the association type is the second association type and the function compatibility information of which the function is associated may be written as a piece of integral information, for example, the function compatibility information "currentStyle": "true: IE "and function compatibility information" getComputedStyle ": "false: IE "write" currentStyle ": "true: IE "; "getComputedStyle": "true: chrome, firefox ".
Based on the above description, in the embodiment of the present invention, determining the function compatibility test result of the objective JS function according to the function compatibility information may include the following steps.
And determining the association type of the function compatibility information. If the association type of the function compatibility information is the first association type, determining a function compatibility test result of the target JS function according to the function compatibility information. If the association type of the function compatibility information is the second association type, determining a function compatibility test result of the target JS function according to the function content of the function compatibility information and the function content of the function compatibility information functionally associated with the function compatibility information.
In actual implementation, first, a browser compatible with the JS function corresponding to the function compatibility information may be obtained as the first browser according to the function content of the function compatibility information. And then, function compatibility information associated with the function compatibility information function is used as associated function compatibility information, and a browser compatible with the JS function corresponding to the associated function compatibility information is obtained as a second browser according to the function content of the associated function compatibility information. And finally, judging whether the set of the first browser and the second browser is the same as the preset browser set. And if the set of the first browser and the second browser is the same as the preset browser set, determining that the function compatibility test result of the target JS function is compatible, otherwise, determining that the function compatibility test result of the target JS function is incompatible.
For example, when the JS function currentStyle () and the JS function getcomputedsstyle () are included in the JS code to be tested at the same time, the function compatibility information "currentStyle" in the first configuration file may be used: "true: IE ", obtains a browser compatible with the JS function currentStyle (), i.e., an IE browser, as the first browser, and at the same time, will be compatible with the function compatibility information" currentStyle ": "true: IE "associated function compatibility information" getComputedStyle ": "false: IE' is used as the associated function compatibility information, and a browser compatible with JS functions getComputedstyle (), namely, a Google browser and a fire fox browser, is obtained as a second browser. And if the set of the first browser and the second browser is the same as the preset browser, determining that the function compatibility test result of the JS function currentStyle () is compatible. The function compatibility test result of the JS function getComputedStyle () can also be determined to be compatible by the same judging mode.
In order to further determine the incompatibility degree of the target JS function relative to the preset browser set, in the embodiment of the present invention, the first configuration file further sets a preset browser compatibility condition, and is used for determining an incompatibility type of the function compatibility information, where the incompatibility type includes a first incompatibility type and a second incompatibility type. The first incompatible type is used for representing the incompatibility of the function as being completely incompatible, and the second incompatible type is used for representing the incompatibility of the function as being not completely compatible. Aiming at certain piece of function compatibility information, if the incompatible type is a first incompatible type, the represented JS function cannot realize the corresponding function on an incompatible browser in a preset browser set, and if the incompatible type is a second incompatible type, the represented JS function can realize the corresponding function on the incompatible browser in the preset browser set, but the realization effect cannot meet the preset requirement.
For example, the first configuration file has function compatibility information "setAttribute": "false: IE "and function compatibility information" str ": "false: IE6, IE7 ", while the corresponding function of the JS function setatttribute () cannot be implemented on the IE browser, the function compatibility information" setatttribute ": "false: the incompatible type of the IE 'is judged to be the first incompatible type, the corresponding function of the JS function str () can realize the corresponding function on the IE6 and the IE7, but the realization effect can not meet the preset requirement, and the function compatibility information str': "false: the incompatible type of IE6, IE 7' is determined to be the second incompatible type. In practical implementation, to ensure the cleanliness of the code, the function compatibility information of the incompatible type being the first incompatible type may be written into one program segment, the function compatibility information of the incompatible type being the second incompatible type may be written into another program segment, for example, function compatibility information of an incompatible type of a first incompatible type is written to the program section "block" {..
Based on the above description, in the embodiment of the present invention, when the function compatibility test result of the target JS function is incompatible, the function compatibility test result of the target JS function is determined according to the function compatibility information, and the following steps may be further included.
Judging the incompatible type of the function compatibility information, if the incompatible type of the function compatibility information is a first incompatible type, determining the function compatibility result of the target JS function as completely incompatible, and if the incompatible type of the function compatibility information is a second incompatible type, determining the function compatibility result of the target JS function as incompletely compatible.
In the embodiment of the invention, after the code compatibility test result of the JS code to be tested is obtained, a code compatibility test report can be generated according to the code compatibility test result. The code compatibility test report may include an objective function whose function compatibility test result is completely incompatible and a completely incompatible browser in the corresponding preset browser set, and similarly, the code compatibility test report may also include an objective function whose function compatibility test result is not completely compatible and a completely incompatible browser in the corresponding preset browser set.
The overall process of simultaneously testing the compatibility of the JS code to be tested with respect to the preset browser set based on the first configuration file and obtaining the code compatibility test result of the JS code to be tested will be described below by way of example.
For example, the first profile is:
the code to be tested comprises a JS function cursor as an objective function: hand (), JS function currentStyle (), JS function getComputedStyle (), JS function "setAttribute"), and JS function str ().
For the JS function cursor: hand (), the first configuration file does not exist with the JS function cursor: and (3) function compatibility information corresponding to hand (), a JS function cursor: the function compatibility test result of hand () is determined to be compatible.
For the JS function currentStyle (), function compatibility information "currentStyle" corresponding to the JS function currentStyle () exists in the first configuration file: "true: IE ", function compatibility information" currentStyle ": "true: the association type of the IE "is a second association type, and the function compatibility information" currentStyle ": "true: the association function compatibility information of the IE "is" getComputedStyle ": "false: IE ". Further, the browser compatible with the JS function currentStyle () is an IE browser, the browser compatible with the JS function getComputedstyle () is a Google browser and a fire fox browser, and the set of the IE browser, the Google browser and the fire fox browser is the same as the set of the preset browser, so that the function compatibility test result of the JS function currentStyle () is determined to be compatible. The function compatibility test result of the JS function getComputedStyle () is also compatible by the same judging method. It can be understood that if the JS function currentStyle () exists in the JS code to be tested and the JS function getComputedStyle () does not exist, the function compatibility test result of the JS function currentStyle () is determined to be incompatible, and similarly, if the JS function getComputedStyle () exists in the JS code to be tested and the JS function currentStyle () does not exist, the function compatibility test result of the JS function getComputedStyle () is determined to be incompatible.
For the JS function "setAttribute" (), function compatibility information "setAttribute" () corresponding to the JS function "setAttribute" () exists in the first configuration file: "false: IE ", and the association type of the JS function" setAttribute "() is the first association type, then the function compatibility test result of the JS function" setAttribute "() is determined to be incompatible, further, because of the function compatibility information" setAttribute ": "false: the incompatible type of the IE "is the first incompatible type, then it may be further determined that the function compatibility test result of the JS function" setAttribute "is determined to be completely incompatible.
For the JS function str (), function compatibility information "str" corresponding to the JS function str () exists in the first configuration file: "false: IE6, IE7 ", and the association type of JS function str () is the first association type, the function compatibility test result of JS function str () is determined to be incompatible, further, because of the function compatibility information" str ": "false: if the incompatible type of IE6, IE7 "is the second incompatible type, then it may be further determined that the result of the function compatibility test of JS function str () is determined to be not fully compatible.
After that, it is determined that the code compatibility test result of the JS code to be tested is incompatible, and a code compatibility test report including the JS function "setAttribute" completely incompatible IE browser, the JS function str () not completely compatible IE6 browser and IE7 browser may be generated.
Optionally, in the embodiment of the present invention, the JS code testing method further includes:
step S300, a second configuration file corresponding to the JS codes to be tested is obtained.
The second configuration file is pre-created and is used for testing the grammar normalization of the JS codes to be tested.
And step S400, testing the grammar standardability of the JS codes to be tested based on the second configuration file, and obtaining a code grammar standardability test result of the JS codes to be tested.
In the embodiment of the present invention, the second configuration file may include at least one piece of syntax normalization information for characterizing a syntax non-normalization problem of the JS function. Based on the above, the method for testing the grammar normalization of the JS codes to be tested based on the second configuration file, and obtaining the code grammar normalization test result of the JS codes to be tested, may comprise the following steps.
And judging whether the JS codes to be tested have grammar setting corresponding to the grammar normalization information or not according to each piece of grammar normalization information. If the JS code to be tested has grammar setting corresponding to the grammar normalization information, the grammar setting is used as the non-canonical grammar. If the JS codes have the nonstandard grammar, determining that the code grammar standardability test result of the JS codes to be tested is nonstandard, otherwise, determining that the code grammar standardability test result of the JS codes to be tested is standardability.
Optionally, in the embodiment of the present invention, the grammar normalization information includes grammar tags and judgment standard content corresponding to the grammar tags, each grammar tag corresponds to a grammar setting, and the judgment standard content is used for characterizing that the grammar normalization of the grammar setting corresponding to the grammar tag is not normalized.
For example, the syntax normalization information may be "bitwise": and true, wherein "bitwise" is a grammar tag, and the corresponding grammar is set as to whether a forbidden bit operator (such as ≡) is set in the JS code, and true is a judging standard content for characterizing that if the forbidden bit operator (such as ≡) is set in the JS code to be tested, the grammar in the code of the JS code to be tested is confirmed to be set as an nonstandard grammar, and the code grammar normalization test result of the JS code to be tested can be further confirmed to be nonstandard. For another example, the grammar normalization information may be "include": true, wherein "include" is a grammar tag, and its corresponding grammar is set to be used in sentences such as if and while to define a code block, true is a judging standard content, and is used for characterizing that if the code block is used in sentences such as if and while in the JS code to be tested, the grammar in the code of the JS code to be tested is confirmed to be set as an nonstandard grammar, and further, the code grammar normalization test result of the JS code to be tested can be confirmed to be nonstandard. For another example, "noarg": and true, wherein "noarg" is a grammar tag, the corresponding grammar is set to be whether an image is used or not, true is a judging standard content, and the true is used for characterizing that if the image is used in the JS code to be tested, the grammar in the code of the JS code to be tested is confirmed to be an irregular grammar, and the code grammar normalization test result of the JS code to be tested can be further confirmed to be irregular.
In order to further determine the degree of non-normative grammar of the objective JS function, in the embodiment of the present invention, the second configuration file further sets a preset condition of normative grammar for determining an irregular type of the normative grammar information, where the irregular type includes a first irregular type and a second irregular type, the first irregular type is used for characterizing that the non-normative grammar problem of the normative grammar information is completely irregular, and the second irregular type is used for characterizing that the non-normative grammar problem of the normative grammar information is incompletely normative. For a certain non-standard grammar, if the non-standard type of the corresponding grammar normalization information is a first non-standard type, the characterizing of the non-standard grammar is that the JS code cannot be executed by using the non-standard grammar in the JS code to realize the corresponding function of each JS function, and if the non-standard type of the corresponding grammar normalization information is a second non-standard type, the characterizing of the non-standard grammar is that the JS code can be executed by using the non-standard grammar in the JS code to realize the corresponding function of each JS function, but the realizing effect cannot meet the preset requirement.
For example, the second configuration file has syntax standardability information "bitwise": true and "noarg": true, because the JS code is provided with the disable bit operator (e.g., ≡: the non-standard type of true is confirmed as the first non-standard type, and as the values are used in JS codes, the JS codes can be executed to realize the corresponding functions of the JS functions, but the realization effect can not meet the preset requirement, the method is that "noarg": the non-canonical type of true is identified as the second non-canonical type. In practical implementations, to ensure the regularity of the code, the syntax normalization information of the non-canonical type being the first non-canonical type may be written into one program segment, and then the syntax normalization information of the non-canonical type being the second non-canonical type may be written into another program segment, for example, the syntax normalization information of the non-canonical type being the first non-canonical type is written into the program segment "block" {..}, and the syntax normalization information of the non-canonical type being the second non-canonical type is written into the program segment "rolling" {..}
Based on the above description, in the embodiment of the present invention, if there is a grammar setting corresponding to the grammar normalization information in the JS code to be tested, the grammar setting is used as an unnormalized grammar, and specifically may include the following steps.
Judging the non-standard type of the grammar normalization information, setting the grammar as a complete non-standard grammar if the non-standard type of the grammar normalization information is a first non-standard type, and setting the grammar as a complete non-standard grammar if the non-standard type of the grammar normalization information is a second non-standard type.
In the embodiment of the invention, after the code grammar normalization test result of the JS code to be tested is obtained, a code grammar normalization test report can be generated according to the code grammar normalization test result. The code grammar normalization test report may include each non-canonical grammar and each corresponding non-canonical type.
The overall process of testing the grammar normalization of the JS code to be tested based on the second configuration file and obtaining the code grammar normalization test result of the JS code to be tested will be described below by way of example.
For example, the second profile is:
the forbidden bit operator (e.g., ≡), and the parameters.caller and parameters.calle are used in the code to be tested.
For a first piece of syntax normative information "bitwise": true, confirming that the code grammar standardability test result of the JS code to be tested is nonstandard, and because of grammar standardability information "bitwise": if the non-canonical type of true is the first non-canonical type, confirming that a forbidden bit operator (such as.
"noarg" for the seventh piece of grammar normalization information: true, confirm that the code grammar standardability test result of the JS code to be tested is nonstandard, and because of grammar standardability information "noarg": if the non-canonical type of true is the second non-canonical type, confirming that the values of values are used in the JS code to be tested as the incomplete canonical grammar.
Based on the same inventive concept as the above-mentioned method for predicting virtual network resources to be issued, the embodiment of the invention further provides a JS code test device 110. Referring to fig. 4, the js code testing device 110 includes a first configuration file acquisition module 111 and a first test result acquisition module 112.
The first configuration file acquisition module is used for acquiring the JS codes to be tested and the first configuration files corresponding to the JS codes to be tested.
For the description of the first profile obtaining module 111, reference may be made to the above detailed description of step S100, that is, step S100 may be performed by the first profile obtaining module 111, which is not described herein.
The first test result obtaining module is used for simultaneously testing the compatibility of the JS codes to be tested relative to the preset browser set based on the first configuration file and obtaining code compatibility test results of the JS codes to be tested.
The JS codes to be tested comprise at least one target JS function, and the first configuration file comprises at least one piece of function compatibility information for representing incompatibility of the JS function relative to a preset browser set. Based on this, optionally, in the embodiment of the present invention, the first test result obtaining module is specifically configured to:
based on at least one piece of function compatibility information, respectively determining a function compatibility test result of each target JS function in the JS codes to be tested relative to a preset browser set;
determining a code compatibility test result of the JS code to be tested according to function compatibility test results of all target JS functions in the JS code to be tested;
and if all the target JS functions in the JS codes to be tested are compatible with the preset browser set, determining the code compatibility test result of the JS codes to be tested as compatible, otherwise, determining the code compatibility test result of the JS codes to be tested as incompatible.
Optionally, in an embodiment of the present invention, the first test result obtaining module is further specifically configured to:
for each target JS function in the JS code to be tested, judging whether function compatibility information corresponding to the target JS function exists in the first configuration file or not respectively;
if the function compatibility information corresponding to the target JS function exists in the first configuration file, determining a function compatibility test result of the target JS function according to the function compatibility information, otherwise, determining the function compatibility test result of the target JS function as compatible.
The function compatibility information comprises function labels and function contents corresponding to the function labels, each function label corresponds to a JS function, and the function contents are used for representing compatibility of the JS function corresponding to the function label relative to a browser in a preset browser set. Based on this, optionally, in the embodiment of the present invention, the first test result obtaining module is further specifically configured to:
determining an association type of the function compatibility information based on a preset information association condition, wherein the association type comprises a first association type and a second association type, the first association type is used for representing that function compatibility information associated with the function compatibility information function does not exist in a first configuration file, and the second association type is used for representing that function compatibility information associated with the function compatibility information function exists in the first configuration file;
If the association type of the function compatibility information is the first association type, determining a function compatibility test result of the target JS function according to the function compatibility information;
if the association type of the function compatibility information is the second association type, determining a function compatibility test result of the target JS function according to the function content of the function compatibility information and the function content of the function compatibility information functionally associated with the function compatibility information.
Optionally, in an embodiment of the present invention, the first test result obtaining module is further specifically configured to:
obtaining a browser compatible with a JS function corresponding to the function compatibility information as a first browser according to the function content of the function compatibility information;
the function compatibility information associated with the function compatibility information function is used as associated function compatibility information, and a browser compatible with the JS function corresponding to the associated function compatibility information is obtained as a second browser according to the function content of the associated function compatibility information;
judging whether the set of the first browser and the second browser is the same as a preset browser set or not;
and if the set of the first browser and the second browser is the same as the preset browser set, determining that the function compatibility test result of the target JS function is compatible, otherwise, determining that the function compatibility test result of the target JS function is incompatible.
When the function compatibility test result of the objective JS function is incompatible, optionally, in the embodiment of the present invention, the first test result obtaining module is further specifically configured to:
determining an incompatible type of the function compatibility information based on a preset browser compatibility condition, wherein the incompatible type comprises a first incompatible type and a second incompatible type, the first incompatible type is used for representing that the incompatible condition of the function compatibility information is completely incompatible, and the second incompatible type is used for representing that the incompatible condition of the function compatibility information is not completely compatible;
if the incompatible type of the function compatibility information is the first incompatible type, determining the function compatibility result of the target JS function as completely incompatible;
if the incompatible type of the function compatibility information is the second incompatible type, the function compatibility result of the target JS function is determined to be incompletely compatible.
For the description of the first test result obtaining module 112, reference may be made to the above detailed description of step S200, that is, step S200 may be performed by the first test result obtaining module 112, which is not described herein.
Referring to fig. 5, optionally, in an embodiment of the present invention, the JS code testing device further includes:
And the second configuration file acquisition module is used for acquiring a second configuration file corresponding to the JS code to be tested.
For the description of the second profile obtaining module 113, reference may be made specifically to the detailed description of step S300, that is, step S300 may be performed by the second profile obtaining module 113, which is not described herein.
And the second test result acquisition module is used for testing the grammar normalization of the JS codes to be tested based on the second configuration file and acquiring a code grammar normalization test result of the JS codes to be tested.
The second configuration file comprises at least one piece of grammar normalization information for representing grammar non-normalization problems of the JS codes to be tested. Based on this, optionally, in the embodiment of the present invention, the second test result obtaining module is specifically configured to:
judging whether the JS codes to be tested have grammar setting corresponding to the grammar normalization information or not according to each piece of grammar normalization information;
if the JS code to be tested has grammar setting corresponding to the grammar normalization information, the grammar setting is used as non-canonical grammar;
if the JS codes have the nonstandard grammar, determining that the code grammar standardability test result of the JS codes to be tested is nonstandard, otherwise, determining that the code grammar standardability test result of the JS codes to be tested is standardability.
Optionally, in the embodiment of the present invention, the second test result obtaining module is further specifically configured to:
determining an irregular type of the grammar normalization information based on a preset grammar normalization condition, wherein the irregular type comprises a first irregular type and a second irregular type, the first irregular type is used for representing the grammar non-normalization problem of the grammar normalization information as complete irregular, and the second irregular type is used for representing the non-normalization problem of the grammar normalization information as incomplete irregular;
if the non-canonical type of the grammar normalization information is a first non-canonical type, setting the grammar as a completely non-canonical grammar;
and if the non-canonical type of the grammar normalization information is the second non-canonical type, setting the grammar as a complete non-canonical grammar.
For the description of the second test result obtaining module 114, reference may be made to the above detailed description of step S400, that is, step S400 may be performed by the second test result obtaining module 114, which is not described herein.
In summary, the method, the device and the electronic device for testing the JS codes provided by the embodiment of the invention can acquire the JS codes to be tested and the first configuration files corresponding to the JS codes to be tested, and simultaneously test the compatibility of the JS codes to be tested relative to a preset browser set based on the first configuration files, so as to acquire a code compatibility test result of the JS codes to be tested. Therefore, compared with the scheme in the prior art that each browser is used for testing the compatibility of the JS code to be tested respectively in a manual test mode, the test efficiency is improved to a greater extent.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other manners. The apparatus and method embodiments described above are merely illustrative, for example, flow diagrams and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in various embodiments of the present disclosure may be integrated together to form a single part, or each module may be separately included, or two or more modules may be integrated to form a single part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored on a computer readable storage medium. Based on such understanding, the technical solution of the present disclosure may be embodied in essence or a part contributing to the prior art or a part of the technical solution, or in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, an electronic device, or a network device, etc.) to perform all or part of the steps of the methods of the various embodiments of the present disclosure. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, randomAccess Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes. It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one does not exclude the inclusion of another element in a process, method, article, or apparatus that comprises an element.
The foregoing is merely an alternative embodiment of the present disclosure, and is not intended to limit the present disclosure, so that various modifications and variations will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure should be included in the protection scope of the present disclosure.
A1. The JS code testing method is characterized by comprising the following steps of:
acquiring a JS code to be tested and a first configuration file corresponding to the JS code to be tested;
and simultaneously testing the compatibility of the JS codes to be tested relative to a preset browser set based on the first configuration file, and obtaining a code compatibility test result of the JS codes to be tested.
A2. The JS code test method of claim A1, wherein the JS code to be tested includes at least one target JS function, and the first configuration file includes at least one piece of function compatibility information for characterizing that the JS function is incompatible with the preset browser set;
the step of simultaneously testing the compatibility of the JS code to be tested relative to a preset browser set based on the first configuration file to obtain a code compatibility test result of the JS code to be tested includes:
Based on at least one piece of function compatibility information, respectively determining a function compatibility test result of each target JS function in the JS code to be tested relative to the preset browser set;
determining a code compatibility test result of the JS codes to be tested according to function compatibility test results of all target JS functions in the JS codes to be tested;
and if all the target JS functions in the JS codes to be tested are compatible with the preset browser set, determining that the code compatibility test results of the JS codes to be tested are compatible, otherwise, determining that the code compatibility test results of the JS codes to be tested are incompatible.
A3. The JS code testing method of claim A2, wherein the determining, based on at least one piece of the function compatibility information, a function compatibility test result of each target JS function in the JS code to be tested with respect to the preset browser set, includes:
for each target JS function in the JS code to be tested, judging whether function compatibility information corresponding to the target JS function exists in the first configuration file or not respectively;
If the function compatibility information corresponding to the target JS function exists in the first configuration file, determining the function compatibility test result of the target JS function according to the function compatibility information, otherwise, determining the function compatibility test result of the target JS function as compatible.
A4. The JS code test method of claim A3, wherein the function compatibility information includes function labels and function content corresponding to the function labels, each function label corresponding to a JS function, the function content being used to characterize compatibility of the JS function corresponding to the function label with respect to a browser in the preset browser set;
the determining the function compatibility test result of the target JS function according to the function compatibility information includes:
determining an association type of the function compatibility information based on a preset information association condition, wherein the association type comprises a first association type and a second association type, the first association type is used for representing that function compatibility information associated with the function compatibility information function does not exist in the first configuration file, and the second association type is used for representing that function compatibility information associated with the function compatibility information function exists in the first configuration file;
If the association type of the function compatibility information is the first association type, determining the function compatibility test result of the target JS function according to the function compatibility information;
and if the association type of the function compatibility information is the second association type, determining the function compatibility test result of the target JS function according to the function content of the function compatibility information and the function content of the function compatibility information functionally associated with the function compatibility information.
A5. The JS code test method of claim A4, wherein the determining the function compatibility test result for the target JS function based on the function content of the function compatibility information and the function content of the function compatibility information functionally associated with the function compatibility information, includes:
obtaining a browser compatible with a JS function corresponding to the function compatibility information as a first browser according to the function content of the function compatibility information;
the function compatibility information associated with the function compatibility information function is used as associated function compatibility information, and a browser compatible with the JS function corresponding to the associated function compatibility information is obtained as a second browser according to the function content of the associated function compatibility information;
Judging whether the set of the first browser and the second browser is the same as the preset browser set or not;
and if the set of the first browser and the second browser is the same as the preset browser set, determining that the function compatibility test result of the target JS function is compatible, otherwise, determining that the function compatibility test result of the target JS function is incompatible.
A6. The JS code test method of claim A4, wherein when the function compatibility test result of the target JS function is incompatible, the determining the function compatibility test result of the target JS function from the function compatibility information further includes:
determining an incompatibility type of the function compatibility information based on a preset browser compatibility condition, wherein the incompatibility type comprises a first incompatibility type and a second incompatibility type, the first incompatibility type is used for representing that the incompatibility condition of the function compatibility information is completely incompatibility, and the second incompatibility type is used for representing that the incompatibility condition of the function compatibility information is not completely compatibility;
if the incompatible type of the function compatibility information is the first incompatible type, determining that the function compatibility result of the target JS function is completely incompatible;
And if the incompatible type of the function compatibility information is the second incompatible type, determining that the function compatibility result of the target JS function is not completely compatible.
A7. The JS code test method of claim A1, further comprising:
acquiring a second configuration file corresponding to the JS code to be tested;
and testing the grammar standardability of the JS codes to be tested based on the second configuration file, and obtaining a code grammar standardability test result of the JS codes to be tested.
A8. The JS code testing method of claim A7, wherein the second configuration file includes at least one piece of grammar normalization information for characterizing a grammar non-normalization problem of the JS code to be tested;
the step of testing the grammar normalization of the JS code to be tested based on the second configuration file to obtain a code grammar normalization test result of the JS code to be tested, including:
judging whether grammar setting corresponding to the grammar normalization information exists in the JS codes to be tested according to each piece of grammar normalization information;
if the JS codes to be tested have grammar setting corresponding to the grammar normalization information, setting the grammar as non-canonical grammar;
If the non-standard grammar exists in the JS codes, determining that the code grammar standardability test result of the JS codes to be tested is non-standard, otherwise, determining that the code grammar standardability test result of the JS codes to be tested is standard.
A9. The JS code test method of claim A8, wherein if there is a grammar setting corresponding to the grammar normalization information in the JS code to be tested, then setting the grammar as an unnormalized grammar includes:
determining an irregular type of the grammar normalization information based on a preset grammar normalization condition, wherein the irregular type comprises a first irregular type and a second irregular type, the first irregular type is used for representing that grammar irregular questions of the grammar normalization information are completely irregular, and the second irregular type is used for representing that the irregular questions of the grammar normalization information are incompletely standardized;
if the non-canonical type of the grammar normalization information is the first non-canonical type, setting the grammar as a completely non-canonical grammar;
and if the non-canonical type of the grammar normalization information is the second non-canonical type, setting the grammar as a complete non-canonical grammar.
B10. A JS code test device, characterized by:
the device comprises a first configuration file acquisition module, a second configuration file acquisition module and a test module, wherein the first configuration file acquisition module is used for acquiring a JS code to be tested and a first configuration file corresponding to the JS code to be tested;
and the first test result acquisition module is used for simultaneously testing the compatibility of the JS codes to be tested relative to a preset browser set based on the first configuration file and acquiring a code compatibility test result of the JS codes to be tested.
B11. The JS code test device of claim B10, wherein the JS code to be tested includes at least one target JS function, and the first configuration file includes at least one piece of function compatibility information for characterizing that the JS function is incompatible with the preset browser set;
the first test result obtaining module is specifically configured to:
based on at least one piece of function compatibility information, respectively determining a function compatibility test result of each target JS function in the JS code to be tested relative to the preset browser set;
determining a code compatibility test result of the JS codes to be tested according to function compatibility test results of all target JS functions in the JS codes to be tested;
And if all the target JS functions in the JS codes to be tested are compatible with the preset browser set, determining that the code compatibility test results of the JS codes to be tested are compatible, otherwise, determining that the code compatibility test results of the JS codes to be tested are incompatible.
B12. The JS code test device of claim B10, wherein the first test result acquisition module is further specifically configured to:
for each target JS function in the JS code to be tested, judging whether function compatibility information corresponding to the target JS function exists in the first configuration file or not respectively;
if the function compatibility information corresponding to the target JS function exists in the first configuration file, determining the function compatibility test result of the target JS function according to the function compatibility information, otherwise, determining the function compatibility test result of the target JS function as compatible.
B13. The JS code test device of claim B12, wherein the function compatibility information includes function labels and function content corresponding to the function labels, each function label corresponding to a JS function, the function content being used to characterize compatibility of the JS function corresponding to the function label with respect to a browser in the preset browser set;
The first test result obtaining module is specifically further configured to:
determining an association type of the function compatibility information based on a preset information association condition, wherein the association type comprises a first association type and a second association type, the first association type is used for representing that function compatibility information associated with the function compatibility information function does not exist in the first configuration file, and the second association type is used for representing that function compatibility information associated with the function compatibility information function exists in the first configuration file;
if the association type of the function compatibility information is the first association type, determining the function compatibility test result of the target JS function according to the function compatibility information;
and if the association type of the function compatibility information is the second association type, determining the function compatibility test result of the target JS function according to the function content of the function compatibility information and the function content of the function compatibility information functionally associated with the function compatibility information.
B14. The JS code test device of claim B13, wherein the first test result acquisition module is further specifically configured to:
Obtaining a browser compatible with a JS function corresponding to the function compatibility information as a first browser according to the function content of the function compatibility information;
the function compatibility information associated with the function compatibility information function is used as associated function compatibility information, and a browser compatible with the JS function corresponding to the associated function compatibility information is obtained as a second browser according to the function content of the associated function compatibility information;
judging whether the set of the first browser and the second browser is the same as the preset browser set or not;
and if the set of the first browser and the second browser is the same as the preset browser set, determining that the function compatibility test result of the target JS function is compatible, otherwise, determining that the function compatibility test result of the target JS function is incompatible.
B15. The JS code test device of claim B13, wherein when the function compatibility test result of the target JS function is incompatible, the first test result acquisition module is further specifically configured to:
determining an incompatibility type of the function compatibility information based on a preset browser compatibility condition, wherein the incompatibility type comprises a first incompatibility type and a second incompatibility type, the first incompatibility type is used for representing that the incompatibility condition of the function compatibility information is completely incompatibility, and the second incompatibility type is used for representing that the incompatibility condition of the function compatibility information is not completely compatibility;
If the incompatible type of the function compatibility information is the first incompatible type, determining that the function compatibility result of the target JS function is completely incompatible;
and if the incompatible type of the function compatibility information is the second incompatible type, determining that the function compatibility result of the target JS function is not completely compatible.
B16. The JS code test device of claim B10, further comprising:
the second configuration file acquisition module is used for acquiring a second configuration file corresponding to the JS code to be tested;
and the second test result acquisition module is used for testing the grammar normalization of the JS codes to be tested based on the second configuration file and acquiring a code grammar normalization test result of the JS codes to be tested.
B17. The JS code test device of claim B16, wherein the second configuration file includes at least one piece of grammar normalization information for characterizing a grammar non-normalization problem of the JS code to be tested;
the second test result obtaining module is specifically configured to:
judging whether grammar setting corresponding to the grammar normalization information exists in the JS codes to be tested according to each piece of grammar normalization information;
If the JS codes to be tested have grammar setting corresponding to the grammar normalization information, setting the grammar as non-canonical grammar;
if the non-standard grammar exists in the JS codes, determining that the code grammar standardability test result of the JS codes to be tested is non-standard, otherwise, determining that the code grammar standardability test result of the JS codes to be tested is standard.
B18. The JS code test device of claim B17, wherein the second test result acquisition module is further specifically configured to:
determining an irregular type of the grammar normalization information based on a preset grammar normalization condition, wherein the irregular type comprises a first irregular type and a second irregular type, the first irregular type is used for representing that grammar irregular questions of the grammar normalization information are completely irregular, and the second irregular type is used for representing that the irregular questions of the grammar normalization information are incompletely standardized;
if the non-canonical type of the grammar normalization information is the first non-canonical type, setting the grammar as a completely non-canonical grammar;
and if the non-canonical type of the grammar normalization information is the second non-canonical type, setting the grammar as a complete non-canonical grammar.
C19. An electronic device comprising a processor, a memory, and the JS code test device of claims B10-B18, the JS code test device including one or more software functional modules stored in the memory and executed by the processor.
D20. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed, implements the JS code test method of any one of claims A1-A9.

Claims (18)

1. The JS code testing method is characterized by comprising the following steps of:
acquiring a JS code to be tested and a first configuration file corresponding to the JS code to be tested;
based on the first configuration file, simultaneously testing the compatibility of the JS codes to be tested relative to a preset browser set, and obtaining a code compatibility test result of the JS codes to be tested;
the to-be-tested JS code comprises at least one target JS function, the first configuration file comprises at least one piece of function compatibility information for representing that the JS function is incompatible with the preset browser set, the function compatibility information comprises function labels and function contents, each function label corresponds to one JS function, and the function contents are used for representing that the JS function corresponding to the function label is compatible or incompatible with a browser in the preset browser set;
The step of simultaneously testing the compatibility of the JS code to be tested relative to a preset browser set based on the first configuration file to obtain a code compatibility test result of the JS code to be tested includes:
based on at least one piece of function compatibility information, respectively determining a function compatibility test result of each target JS function in the JS code to be tested relative to the preset browser set;
determining a code compatibility test result of the JS codes to be tested according to function compatibility test results of all target JS functions in the JS codes to be tested;
and if all the target JS functions in the JS codes to be tested are compatible with the preset browser set, determining that the code compatibility test results of the JS codes to be tested are compatible, otherwise, determining that the code compatibility test results of the JS codes to be tested are incompatible.
2. The JS code testing method of claim 1, wherein the determining, based on at least one piece of the function compatibility information, a function compatibility test result of each target JS function in the JS code to be tested with respect to the preset browser set, includes:
For each target JS function in the JS code to be tested, judging whether function compatibility information corresponding to the target JS function exists in the first configuration file or not respectively;
if the function compatibility information corresponding to the target JS function exists in the first configuration file, determining the function compatibility test result of the target JS function according to the function compatibility information, otherwise, determining the function compatibility test result of the target JS function as compatible.
3. The JS code test method of claim 2, wherein the function compatibility information includes function labels and function content corresponding to the function labels, each function label corresponding to a JS function, the function content being used to characterize compatibility of the JS function corresponding to the function label with respect to a browser in the preset browser set;
the determining the function compatibility test result of the target JS function according to the function compatibility information includes:
determining an association type of the function compatibility information based on a preset information association condition, wherein the association type comprises a first association type and a second association type, the first association type is used for representing that function compatibility information associated with the function compatibility information function does not exist in the first configuration file, and the second association type is used for representing that function compatibility information associated with the function compatibility information function exists in the first configuration file;
If the association type of the function compatibility information is the first association type, determining the function compatibility test result of the target JS function according to the function compatibility information;
and if the association type of the function compatibility information is the second association type, determining the function compatibility test result of the target JS function according to the function content of the function compatibility information and the function content of the function compatibility information functionally associated with the function compatibility information.
4. The JS code test method of claim 3, wherein the determining the function compatibility test result for the target JS function based on the function content of the function compatibility information and the function content of the function compatibility information functionally associated with the function compatibility information includes:
obtaining a browser compatible with a JS function corresponding to the function compatibility information as a first browser according to the function content of the function compatibility information;
the function compatibility information functionally associated with the function compatibility information is used as associated function compatibility information, and a browser compatible with a JS function corresponding to the associated function compatibility information is obtained as a second browser according to the function content of the associated function compatibility information;
Judging whether the set of the first browser and the second browser is the same as the preset browser set or not;
and if the set of the first browser and the second browser is the same as the preset browser set, determining that the function compatibility test result of the target JS function is compatible, otherwise, determining that the function compatibility test result of the target JS function is incompatible.
5. The JS code test method of claim 3, wherein when the function compatibility test result of the target JS function is incompatible, the determining the function compatibility test result of the target JS function from the function compatibility information further includes:
determining an incompatibility type of the function compatibility information based on a preset browser compatibility condition, wherein the incompatibility type comprises a first incompatibility type and a second incompatibility type, the first incompatibility type is used for representing that the incompatibility condition of the function compatibility information is completely incompatibility, and the second incompatibility type is used for representing that the incompatibility condition of the function compatibility information is not completely compatibility;
if the incompatible type of the function compatibility information is the first incompatible type, determining that the function compatibility result of the target JS function is completely incompatible;
And if the incompatible type of the function compatibility information is the second incompatible type, determining that the function compatibility result of the target JS function is not completely compatible.
6. The JS code test method of claim 1, further comprising:
acquiring a second configuration file corresponding to the JS code to be tested;
and testing the grammar standardability of the JS codes to be tested based on the second configuration file, and obtaining a code grammar standardability test result of the JS codes to be tested.
7. The JS code testing method of claim 6, wherein the second configuration file includes at least one piece of grammar normalization information for characterizing a grammar non-normalization problem of the JS code to be tested;
the step of testing the grammar normalization of the JS code to be tested based on the second configuration file to obtain a code grammar normalization test result of the JS code to be tested, including:
judging whether grammar setting corresponding to the grammar normalization information exists in the JS codes to be tested according to each piece of grammar normalization information;
if the JS codes to be tested have grammar setting corresponding to the grammar normalization information, setting the grammar as non-canonical grammar;
If the non-standard grammar exists in the JS codes, determining that the code grammar standardability test result of the JS codes to be tested is non-standard, otherwise, determining that the code grammar standardability test result of the JS codes to be tested is standard.
8. The JS code test method of claim 7, wherein if there is a grammar setting corresponding to the grammar normalization information in the JS code to be tested, then setting the grammar as an unnormalized grammar includes:
determining an irregular type of the grammar normalization information based on a preset grammar normalization condition, wherein the irregular type comprises a first irregular type and a second irregular type, the first irregular type is used for representing that grammar irregular questions of the grammar normalization information are completely irregular, and the second irregular type is used for representing that the irregular questions of the grammar normalization information are incompletely standardized;
if the non-canonical type of the grammar normalization information is the first non-canonical type, setting the grammar as a completely non-canonical grammar;
and if the non-canonical type of the grammar normalization information is the second non-canonical type, setting the grammar as an incomplete canonical grammar.
9. A JS code test device, characterized by:
the device comprises a first configuration file acquisition module, a second configuration file acquisition module and a test module, wherein the first configuration file acquisition module is used for acquiring a JS code to be tested and a first configuration file corresponding to the JS code to be tested;
the first test result obtaining module is used for simultaneously testing the compatibility of the JS codes to be tested relative to a preset browser set based on the first configuration file and obtaining a code compatibility test result of the JS codes to be tested;
the to-be-tested JS code comprises at least one target JS function, the first configuration file comprises at least one piece of function compatibility information for representing that the JS function is incompatible with the preset browser set, the function compatibility information comprises function labels and function contents, each function label corresponds to one JS function, and the function contents are used for representing that the JS function corresponding to the function label is compatible or incompatible with a browser in the preset browser set;
the first test result obtaining module is specifically configured to:
based on at least one piece of function compatibility information, respectively determining a function compatibility test result of each target JS function in the JS code to be tested relative to the preset browser set;
Determining a code compatibility test result of the JS codes to be tested according to function compatibility test results of all target JS functions in the JS codes to be tested;
and if all the target JS functions in the JS codes to be tested are compatible with the preset browser set, determining that the code compatibility test results of the JS codes to be tested are compatible, otherwise, determining that the code compatibility test results of the JS codes to be tested are incompatible.
10. The JS code test device of claim 9, wherein the first test result acquisition module is further specifically configured to:
for each target JS function in the JS code to be tested, judging whether function compatibility information corresponding to the target JS function exists in the first configuration file or not respectively;
if the function compatibility information corresponding to the target JS function exists in the first configuration file, determining the function compatibility test result of the target JS function according to the function compatibility information, otherwise, determining the function compatibility test result of the target JS function as compatible.
11. The JS code test device of claim 10, wherein the function compatibility information includes function labels and function content corresponding to the function labels, each function label corresponding to a JS function, the function content being used to characterize compatibility of the JS function corresponding to the function label with respect to a browser in the preset browser set;
The first test result obtaining module is specifically further configured to:
determining an association type of the function compatibility information based on a preset information association condition, wherein the association type comprises a first association type and a second association type, the first association type is used for representing that function compatibility information associated with the function compatibility information function does not exist in the first configuration file, and the second association type is used for representing that function compatibility information associated with the function compatibility information function exists in the first configuration file;
if the association type of the function compatibility information is the first association type, determining the function compatibility test result of the target JS function according to the function compatibility information;
and if the association type of the function compatibility information is the second association type, determining the function compatibility test result of the target JS function according to the function content of the function compatibility information and the function content of the function compatibility information functionally associated with the function compatibility information.
12. The JS code test device of claim 11, wherein the first test result acquisition module is further specifically configured to:
Obtaining a browser compatible with a JS function corresponding to the function compatibility information as a first browser according to the function content of the function compatibility information;
the function compatibility information functionally associated with the function compatibility information is used as associated function compatibility information, and a browser compatible with a JS function corresponding to the associated function compatibility information is obtained as a second browser according to the function content of the associated function compatibility information;
judging whether the set of the first browser and the second browser is the same as the preset browser set or not;
and if the set of the first browser and the second browser is the same as the preset browser set, determining that the function compatibility test result of the target JS function is compatible, otherwise, determining that the function compatibility test result of the target JS function is incompatible.
13. The JS code test device of claim 11, wherein when the function compatibility test result of the target JS function is incompatible, the first test result acquisition module is further specifically configured to:
determining an incompatibility type of the function compatibility information based on a preset browser compatibility condition, wherein the incompatibility type comprises a first incompatibility type and a second incompatibility type, the first incompatibility type is used for representing that the incompatibility condition of the function compatibility information is completely incompatibility, and the second incompatibility type is used for representing that the incompatibility condition of the function compatibility information is not completely compatibility;
If the incompatible type of the function compatibility information is the first incompatible type, determining that the function compatibility result of the target JS function is completely incompatible;
and if the incompatible type of the function compatibility information is the second incompatible type, determining that the function compatibility result of the target JS function is not completely compatible.
14. The JS code test device of claim 9, further comprising:
the second configuration file acquisition module is used for acquiring a second configuration file corresponding to the JS code to be tested;
and the second test result acquisition module is used for testing the grammar normalization of the JS codes to be tested based on the second configuration file and acquiring a code grammar normalization test result of the JS codes to be tested.
15. The JS code test device of claim 14, wherein the second configuration file includes at least one piece of grammar normalization information for characterizing a grammar non-normalization problem of the JS code to be tested;
the second test result obtaining module is specifically configured to:
judging whether grammar setting corresponding to the grammar normalization information exists in the JS codes to be tested according to each piece of grammar normalization information;
If the JS codes to be tested have grammar setting corresponding to the grammar normalization information, setting the grammar as non-canonical grammar;
if the non-standard grammar exists in the JS codes, determining that the code grammar standardability test result of the JS codes to be tested is non-standard, otherwise, determining that the code grammar standardability test result of the JS codes to be tested is standard.
16. The JS code test device of claim 15, wherein the second test result acquisition module is further specifically configured to:
determining an irregular type of the grammar normalization information based on a preset grammar normalization condition, wherein the irregular type comprises a first irregular type and a second irregular type, the first irregular type is used for representing that grammar irregular questions of the grammar normalization information are completely irregular, and the second irregular type is used for representing that the irregular questions of the grammar normalization information are incompletely standardized;
if the non-canonical type of the grammar normalization information is the first non-canonical type, setting the grammar as a completely non-canonical grammar;
and if the non-canonical type of the grammar normalization information is the second non-canonical type, setting the grammar as an incomplete canonical grammar.
17. An electronic device comprising a processor, a memory, and the JS code testing apparatus of claims 9-16, the JS code testing apparatus including one or more software functional modules stored in the memory and executed by the processor.
18. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed, implements the JS code test method of any one of claims 1-8.
CN201811317347.3A 2018-11-06 2018-11-06 JS code testing method and device and electronic equipment Active CN109634844B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811317347.3A CN109634844B (en) 2018-11-06 2018-11-06 JS code testing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811317347.3A CN109634844B (en) 2018-11-06 2018-11-06 JS code testing method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN109634844A CN109634844A (en) 2019-04-16
CN109634844B true CN109634844B (en) 2023-12-22

Family

ID=66067321

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811317347.3A Active CN109634844B (en) 2018-11-06 2018-11-06 JS code testing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN109634844B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102054100A (en) * 2010-12-17 2011-05-11 中国科学院计算技术研究所 Static analysis-based method and system for detecting RTL (Resistor Transistor Logic) design errors
CN103164213A (en) * 2011-12-19 2013-06-19 中国移动通信集团四川有限公司 Method, device and system of testing compatibility of Web browser
CN103942137A (en) * 2013-01-23 2014-07-23 腾讯科技(深圳)有限公司 Browser compatibility testing method and device
CN104156307A (en) * 2014-07-03 2014-11-19 安徽景行信息科技有限公司 Browser compatibility detecting method and system
CN107103237A (en) * 2016-02-23 2017-08-29 阿里巴巴集团控股有限公司 A kind of detection method and device of malicious file
CN107133165A (en) * 2017-03-22 2017-09-05 腾讯科技(深圳)有限公司 Browser compatibility detection method and device
CN107729249A (en) * 2017-10-18 2018-02-23 北京奇虎科技有限公司 Browser compatibility method of testing, device, system and electronic equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010013043A1 (en) * 1998-03-12 2001-08-09 Richard J. Wagner System and method for determining browser package and version compatibility of a web document
US20110173589A1 (en) * 2010-01-13 2011-07-14 Microsoft Corporation Cross-Browser Interactivity Testing
US9208054B2 (en) * 2011-02-14 2015-12-08 Fujitsu Limited Web service for automated cross-browser compatibility checking of web applications
US20140201625A1 (en) * 2012-04-24 2014-07-17 Concepts in Data Management, SRL System and method for generating a browser compatible document

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102054100A (en) * 2010-12-17 2011-05-11 中国科学院计算技术研究所 Static analysis-based method and system for detecting RTL (Resistor Transistor Logic) design errors
CN103164213A (en) * 2011-12-19 2013-06-19 中国移动通信集团四川有限公司 Method, device and system of testing compatibility of Web browser
CN103942137A (en) * 2013-01-23 2014-07-23 腾讯科技(深圳)有限公司 Browser compatibility testing method and device
CN104156307A (en) * 2014-07-03 2014-11-19 安徽景行信息科技有限公司 Browser compatibility detecting method and system
CN107103237A (en) * 2016-02-23 2017-08-29 阿里巴巴集团控股有限公司 A kind of detection method and device of malicious file
CN107133165A (en) * 2017-03-22 2017-09-05 腾讯科技(深圳)有限公司 Browser compatibility detection method and device
CN107729249A (en) * 2017-10-18 2018-02-23 北京奇虎科技有限公司 Browser compatibility method of testing, device, system and electronic equipment

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
A Selenium based approach to automatic test script generation for refactoring JavaScript code;Ruifeng Chen等;2013 IEEE/ACIS 12th International Conference on Computer and Information Science (ICIS);第341-346页 *
Chapter 5 - A Framework for Detecting and Diagnosing Configuration Faults in Web Applications;Cyntrica Eaton;Advances in Computers;第85卷;第137-181页 *
基于MVC设计模式的源代码检测平台的设计与实现;王安娜;中国优秀硕士学位论文全文数据库 信息科技辑(第10期);I138-29 *
针对JavaScript浏览器兼容性的变异测试方法;程勇 等;计算机应用;第37卷(第4期);第1143-1148+1173页 *

Also Published As

Publication number Publication date
CN109634844A (en) 2019-04-16

Similar Documents

Publication Publication Date Title
CN107563201B (en) Associated sample searching method and device based on machine learning and server
CN109101815B (en) Malicious software detection method and related equipment
CN111367595B (en) Data processing method, program running method, device and processing equipment
CN111026663B (en) Software defect detection method, device, computer equipment and storage medium
CN111222137A (en) Program classification model training method, program classification method and device
CN110909361A (en) Vulnerability detection method and device and computer equipment
CN108984328B (en) Stack backtracking method and device
CN110737892B (en) Detection method aiming at APC injection and related device
CN111984666A (en) Database access method and device, computer readable storage medium and computer equipment
CN109634844B (en) JS code testing method and device and electronic equipment
CN111290747B (en) Method, system, equipment and medium for creating function hook
CN111258905B (en) Defect positioning method and device, electronic equipment and computer readable storage medium
CN111026604B (en) Log file analysis method and device
CN110262948B (en) Page data monitoring method, device and equipment
CN110727565B (en) Network equipment platform information collection method and system
CN115437930B (en) Webpage application fingerprint information identification method and related equipment
US11250127B2 (en) Binary software composition analysis
CN110019295B (en) Database retrieval method, device, system and storage medium
CN115688099A (en) Computer virus retrieval method and device, computer equipment and storage medium
CN105740260A (en) Method and device for extracting template file data structure
CN109710833B (en) Method and apparatus for determining content node
CN114492324A (en) Component data statistical method and device
CN103761247A (en) Processing method and device for error files
CN112433943A (en) Method, device, equipment and medium for detecting environment variable based on abstract syntax tree
CN107506299B (en) Code analysis method and terminal equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20231128

Address after: Room 03, 2nd Floor, Building A, No. 20 Haitai Avenue, Huayuan Industrial Zone (Huanwai), Binhai New Area, Tianjin, 300450

Applicant after: 3600 Technology Group Co.,Ltd.

Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park)

Applicant before: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant