CN111352843B - Method and system for realizing test script verification - Google Patents
Method and system for realizing test script verification Download PDFInfo
- Publication number
- CN111352843B CN111352843B CN202010132505.9A CN202010132505A CN111352843B CN 111352843 B CN111352843 B CN 111352843B CN 202010132505 A CN202010132505 A CN 202010132505A CN 111352843 B CN111352843 B CN 111352843B
- Authority
- CN
- China
- Prior art keywords
- verification
- script
- test
- test script
- logic
- 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
Links
- 238000012795 verification Methods 0.000 title claims abstract description 232
- 238000012360 testing method Methods 0.000 title claims abstract description 156
- 238000000034 method Methods 0.000 title claims abstract description 21
- 238000004088 simulation Methods 0.000 claims abstract description 23
- 230000005540 biological transmission Effects 0.000 claims description 8
- 238000010200 validation analysis Methods 0.000 claims 3
- 238000011161 development Methods 0.000 description 5
- 238000006467 substitution reaction Methods 0.000 description 3
- 230000002159 abnormal effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000007547 defect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3604—Software analysis for verifying properties of programs
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
Abstract
The invention provides a method and a system for realizing test script verification, wherein the method comprises the following steps: s1, creating a script verification template; s2, creating a test script, and setting a verification interface in the test script; s3, generating a script verification example according to the test script and the script verification template; s4, running a test script on the simulation test platform, and starting a script verification example through a verification interface; s5, verifying the test script by the configuration script verification example, and returning a script verification result through the verification interface; the system comprises: the device comprises a script verification template creating module, a test script creating module, a script verification instance generating module, a test script running module and a test script verification module. The invention can obtain the action result of the test script behavior, judge whether the action result of the script behavior meets the requirement, and judge whether each test action or each test cycle of the test script meets the test expectation.
Description
Technical Field
The invention belongs to the technical field of test script development, and particularly relates to a method and a system for realizing test script verification.
Background
When a test engineer in a test platform develops a test script, the script file is generally compiled one by one according to the definition rules of the test flow and the test script, each coordinate point, each time delay, each executed command and the like in the script need to be assisted by a third-party tool (coordinate display software, a timer and the like), and the development period is long and errors are easy to occur. And the existing script editor has no error prompt (such as label error, command error and the like), a test engineer is required to actually run the script after the script editor is written so as to judge whether the script accords with the test flow, and once the script editor has errors, the script editor needs to return to modify, which is very tedious and error-prone.
Therefore, it is very necessary to provide a method and a system for implementing test script verification to overcome the above-mentioned drawbacks in the prior art.
Disclosure of Invention
Aiming at the defects that the test script of the existing test platform in the prior art is long in development period and easy to make mistakes, and once a mistake is made, the test script needs to be changed again, the invention provides a method and a system for realizing test script verification, so as to solve the technical problems.
In a first aspect, the present invention provides a method for implementing test script verification, including the following steps:
s1, creating a script verification template;
s2, creating a test script, and setting a verification interface in the test script;
s3, generating a script verification example according to the test script and the script verification template;
s4, running a test script on the simulation test platform, and starting a script verification example through a verification interface;
and S5, verifying the test script by the configuration script verification example, and returning a script verification result through the verification interface.
Further, the step S1 specifically includes the following steps:
s11, defining a name space of the script verification template;
s12, defining transmission parameters of a script verification template;
s13, defining the verification result type of the script verification template; the verification result types comprise verification passing, verification failure, returned information and operation errors. The script verification template provides basic functions of script verification, repeated development and resource waste are avoided, developers create script verification examples according to the name space, the transmission parameters and the verification result types defined by the script verification template, and interaction with a test script and a simulation test platform is achieved.
Further, the step S4 specifically includes the following steps:
s41, running a test script on the simulation test platform;
and S42, starting a script verification example by the test script through the verification interface, and transmitting judgment logic and logic parameters to the script verification example. The contents needing to be verified in the test script are transmitted to the script verification instance in the form of parameters through a verification interface.
Further, the step S5 specifically includes the following steps:
s51, initializing a self running environment by a configuration script verification example;
s52, the configuration script verification example carries out logic judgment according to the judgment logic transmitted by the verification interface and carries out operation on the logic parameters transmitted by the verification interface;
and S53, returning a logic judgment result and an operation simulation result of the logic parameter by the configuration script verification example through the verification interface. The script verification result of the script verification example to the test script is returned to the test script and the simulation test platform through the verification interface.
Further, the judgment logic in step S52 includes counting the number of instructions in the test script and verifying the command type in the test script.
Further, step S5 is followed by the following steps:
and S6, the simulation test platform stores and records the script verification result returned by the script verification example.
In a second aspect, the present invention provides a system for implementing test script verification, including:
the script verification template creating module is used for creating a script verification template;
the test script creating module is used for creating a test script and setting a verification interface in the test script;
the script verification example generating module is used for generating a script verification example according to the test script and the script verification template;
the test script running module is used for running a test script on the simulation test platform and starting a script verification example through the verification interface;
and the test script verification module is used for configuring a script verification example to verify the test script and returning a script verification result through the verification interface.
Further, the script verification template creation module includes:
the name space definition unit is used for defining the name space of the script verification template;
the transmission parameter definition unit is used for defining the transmission parameters of the script verification template;
the verification result type definition unit is used for defining the verification result type of the script verification template; the verification result types comprise verification passing, verification failure, returned information and operation errors.
Further, the test script execution module comprises:
the test script running unit is used for running a test script on the simulation test platform;
and the script verification example starting unit is used for configuring the test script to start the script verification example through the verification interface and transmitting the judgment logic and the logic parameters to the script verification example.
Further, the test script verification module comprises:
the environment initialization unit is used for initializing the self running environment by the configuration script verification example;
the logic judgment and operation unit is used for configuring the script verification example to carry out logic judgment according to the judgment logic transmitted by the verification interface and operate the logic parameters transmitted by the verification interface;
and the result returning unit is used for returning the logic judgment result and the operation result of the logic parameter by the configuration script verification example through the verification interface.
The invention has the beneficial effects that,
the method and the system for realizing the test script verification, provided by the invention, can complete the development of the script verification example in the simulation test platform, can meet the requirements of the simulation test platform and the test script, can obtain the action result of the test script behavior, and can judge whether the action result of the script behavior meets the requirements; the invention enables test developers who know the simulation test platform to develop a proper script verification example program, enables each test action or each test cycle of the test script to be judged whether to accord with the test expectation, and if the abnormal record is abnormal, the invention is used for counting the failure probability of the current test after the whole test is finished and checking the failure reason, thereby having more detailed state information, being capable of well assisting in analyzing and judging the reason of the low-probability test failure and improving the product quality.
In addition, the invention has reliable design principle, simple structure and very wide application prospect.
Therefore, compared with the prior art, the invention has prominent substantive features and remarkable progress, and the beneficial effects of the implementation are also obvious.
Drawings
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present invention, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained based on these drawings without creative efforts.
FIG. 1 is a first schematic flow chart of the method of the present invention;
FIG. 2 is a second schematic flow chart of the method of the present invention;
FIG. 3 is a schematic diagram of the system of the present invention;
in the figure, 1-script verification template creation module; 1.1-namespace definition unit; 1.2-transfer parameter definition unit; 1.3-a verification result type definition unit; 2-a test script creating module; 3-a script verification instance generation module; 4-a test script running module; 4.1-test script run unit; 4.2-script verification instance starting unit; 5-test script verification module; 5.1-environment initialization unit; 5.2-logic judgment and operation unit; 5.3-result return unit.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present invention, the technical solution in the embodiment of the present invention will be clearly and completely described below with reference to the drawings in the embodiment of the present invention, and it is obvious that the described embodiment is only a part of the embodiment of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example 1:
as shown in FIG. 1, the present invention provides a method for implementing test script verification, which comprises the following steps:
s1, creating a script verification template;
s2, creating a test script, and setting a verification interface in the test script;
s3, generating a script verification example according to the test script and the script verification template;
s4, running a test script on the simulation test platform, and starting a script verification example through a verification interface;
and S5, verifying the test script by the configuration script verification example, and returning a script verification result through the verification interface.
Example 2:
as shown in FIG. 2, the present invention provides a method for implementing test script verification, which comprises the following steps:
s1, creating a script verification template; the method comprises the following specific steps:
s11, defining a name space of the script verification template;
s12, defining transmission parameters of a script verification template;
s13, defining the verification result type of the script verification template; the verification result type comprises verification pass,
Failure to verify, return information, and run errors;
s2, creating a test script, and setting a verification interface in the test script;
s3, generating a script verification example according to the test script and the script verification template;
s4, running a test script on the simulation test platform, and starting a script verification example through a verification interface;
s5, verifying the test script by the configuration script verification example, and returning a script verification result through the verification interface; the method comprises the following specific steps:
s51, initializing a self running environment by a configuration script verification example;
s52, the configuration script verification example carries out logic judgment according to the judgment logic transmitted by the verification interface and carries out operation on the logic parameters transmitted by the verification interface; the judgment logic comprises the statistics of the number of the test script instructions and the verification of the command types in the test script;
s53, returning a logic judgment result and an operation result of the logic parameter by the configuration script verification example through the verification interface;
and S6, the simulation test platform stores and records the script verification result returned by the script verification example.
In the above embodiment 2, in step S4, the test script operable on the simulation test platform obtains the operation result of how many current wifi states are in the open state and the current hard disk busy value is or the logical parameter transmitted by the platform;
in step S52, the command type in the test script may be mouse click, mouse movement, keyboard input, and verification result.
Example 3:
as shown in FIG. 3, the present invention provides a system for implementing test script verification, comprising:
the script verification template creating module 1 is used for creating a script verification template; the script verification template creation module 1 includes:
a namespace definition unit 1.1 for defining the namespace of the script verification template;
a transmission parameter definition unit 1.2, which is used for defining the transmission parameters of the script verification template;
the verification result type definition unit 1.3 is used for defining the verification result type of the script verification template;
the verification result type comprises verification passing, verification failure, returned information and operation errors;
the test script creating module 2 is used for creating a test script and setting a verification interface in the test script;
the script verification example generating module 3 is used for generating a script verification example according to the test script and the script verification template;
the test script running module 4 is used for running a test script on the simulation test platform and starting a script verification example through a verification interface; the test script execution module 4 includes:
the test script running unit 4.1 is used for running a test script on the simulation test platform;
the script verification example starting unit 4.2 is used for configuring the test script to start the script verification example through the verification interface and transmitting judgment logic and logic parameters to the script verification example;
the test script verification module 5 is used for configuring a script verification example to verify the test script and returning a script verification result through a verification interface; the test script verification module 5 includes:
the environment initialization unit 5.1 is used for initializing the self running environment by the configuration script verification instance;
the logic judgment and operation unit 5.2 is used for carrying out logic judgment according to the judgment logic transmitted by the verification interface and operating the logic parameters transmitted by the verification interface by the configuration script verification example;
and the result returning unit 5.3 is used for returning the logic judgment result and the operation result of the logic parameter by the configuration script verification example through the verification interface.
Although the present invention has been described in detail by referring to the drawings in connection with the preferred embodiments, the present invention is not limited thereto. Various equivalent modifications or substitutions can be made on the embodiments of the present invention by those skilled in the art without departing from the spirit and scope of the present invention, and these modifications or substitutions are within the scope of the present invention/any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (10)
1. A method for realizing test script verification is characterized by comprising the following steps:
s1, creating a script verification template;
s2, creating a test script, and setting a verification interface in the test script;
s3, generating a script verification example according to the test script and the script verification template;
s4, running a test script on the simulation test platform, and starting a script verification example through a verification interface;
and S5, verifying the test script by the configuration script verification example, and returning a script verification result through the verification interface.
2. The method for implementing test script verification as claimed in claim 1, wherein the step S1 comprises the following steps:
s11, defining a name space of the script verification template;
s12, defining transmission parameters of a script verification template;
s13, defining the verification result type of the script verification template; the verification result types comprise verification passing, verification failure, returned information and operation errors.
3. The method for implementing test script verification as claimed in claim 1, wherein step S4 comprises the following steps:
s41, running a test script on the simulation test platform;
and S42, the test script starts a script verification example through a verification interface and transmits judgment logic and logic parameters to the script verification example.
4. The method for implementing test script verification as claimed in claim 3, wherein the step S5 comprises the following steps:
s51, initializing a self running environment by a configuration script verification example;
s52, the configuration script verification example carries out logic judgment according to the judgment logic transmitted by the verification interface and carries out operation on the logic parameters transmitted by the verification interface;
and S53, returning a logic judgment result and an operation result of the logic parameter by the configuration script verification example through the verification interface.
5. The method of claim 4, wherein the judging logic in step S52 includes statistics of the number of instructions in the test script and the verification of the command type in the test script.
6. The method for implementing test script validation of claim 1, further comprising the following steps after step S5:
and S6, the simulation test platform stores and records the script verification result returned by the script verification example.
7. A system for implementing test script validation, comprising:
the script verification template creating module (1) is used for creating a script verification template;
the test script creating module (2) is used for creating a test script and setting a verification interface in the test script;
the script verification example generating module (3) is used for generating a script verification example according to the test script and the script verification template;
the test script running module (4) is used for running a test script on the simulation test platform and starting a script verification example through a verification interface;
and the test script verification module (5) is used for configuring a script verification example to verify the test script and returning a script verification result through the verification interface.
8. The system for implementing test script verification as claimed in claim 7, wherein the script verification template creation module (1) comprises:
a namespace definition unit (1.1) for defining a namespace of a script verification template;
a delivery parameter definition unit (1.2) for defining delivery parameters of the script verification template;
a verification result type defining unit (1.3) for defining the verification result type of the script verification template; the verification result types comprise verification passing, verification failure, returned information and operation errors.
9. The system for implementing test script validation of claim 7, wherein the test script execution module (4) comprises:
the test script running unit (4.1) is used for running the test script on the simulation test platform;
and the script verification example starting unit (4.2) is used for configuring the test script to start the script verification example through the verification interface and transmitting judgment logic and logic parameters to the script verification example.
10. A system for implementing test script verification as claimed in claim 7, wherein the test script verification module (5) comprises:
the environment initialization unit (5.1) is used for initializing the self running environment by the configuration script verification instance;
the logic judgment and operation unit (5.2) is used for carrying out logic judgment on the configuration script verification example according to the judgment logic transmitted by the verification interface and operating the logic parameters transmitted by the verification interface;
and the result returning unit (5.3) is used for returning the logic judgment result and the operation result of the logic parameter by the configuration script verification example through the verification interface.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010132505.9A CN111352843B (en) | 2020-02-29 | 2020-02-29 | Method and system for realizing test script verification |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010132505.9A CN111352843B (en) | 2020-02-29 | 2020-02-29 | Method and system for realizing test script verification |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111352843A CN111352843A (en) | 2020-06-30 |
CN111352843B true CN111352843B (en) | 2022-11-25 |
Family
ID=71194208
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010132505.9A Active CN111352843B (en) | 2020-02-29 | 2020-02-29 | Method and system for realizing test script verification |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111352843B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104360951A (en) * | 2014-12-09 | 2015-02-18 | 迈普通信技术股份有限公司 | Script testing method and device |
CN106325888A (en) * | 2016-09-30 | 2017-01-11 | 深圳市九洲电器有限公司 | Unit test script writing method and system for set top box |
WO2019232828A1 (en) * | 2018-06-06 | 2019-12-12 | 平安科技(深圳)有限公司 | Script deployment method and apparatus, and computer device and storage medium |
-
2020
- 2020-02-29 CN CN202010132505.9A patent/CN111352843B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104360951A (en) * | 2014-12-09 | 2015-02-18 | 迈普通信技术股份有限公司 | Script testing method and device |
CN106325888A (en) * | 2016-09-30 | 2017-01-11 | 深圳市九洲电器有限公司 | Unit test script writing method and system for set top box |
WO2019232828A1 (en) * | 2018-06-06 | 2019-12-12 | 平安科技(深圳)有限公司 | Script deployment method and apparatus, and computer device and storage medium |
Non-Patent Citations (1)
Title |
---|
测试脚本自动生成器的设计与实现;赵斌飞等;《计算机科学》;20080625(第06期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN111352843A (en) | 2020-06-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106528100B (en) | System and method for model-based techniques and processes for safety-critical software development | |
CN108509336B (en) | Operating system standard formalization verification and test method | |
Rumpe | Agile Modeling with the UML | |
US8914679B2 (en) | Software testing automation framework | |
US20040143819A1 (en) | Generic software testing system and mechanism | |
CN108536581B (en) | Runtime formal verification method for source code | |
Cunha et al. | PETTool: a pattern-based GUI testing tool | |
Mens et al. | A method for testing and validating executable statechart models | |
CN109933521A (en) | Automated testing method, device, computer equipment and storage medium based on BDD | |
CN113282492A (en) | Operating system kernel formal verification method | |
EP3693860A1 (en) | Generation of test models from behavior driven development scenarios based on behavior driven development step definitions and similarity analysis using neuro linguistic programming and machine learning mechanisms | |
Engels et al. | Model-based verification and validation of properties | |
CN112416336B (en) | Software architecture design method for aerospace embedded system | |
Amirat et al. | Automatic generation of PROMELA code from sequence diagram with imbricate combined fragments | |
Bolis et al. | Model-driven testing for web applications using abstract state machines | |
CN111352843B (en) | Method and system for realizing test script verification | |
CN104077225A (en) | Script debugging method and script debugging device both based on JavaScript | |
CN112860587B (en) | UI automatic test method and device | |
US20230030253A1 (en) | Method for analyzing a programmable logic controller program | |
CN109669868A (en) | The method and system of software test | |
CN112231165B (en) | Memory fault simulation method based on link library injection and memory mapping modes | |
CN111813647A (en) | Method and system for verifying data analysis function of main equipment | |
CN116860324B (en) | Development data processing method, development data processing apparatus, and readable storage medium | |
CN112148608B (en) | Mobile terminal automated software testing method based on control function labeling | |
US7904289B2 (en) | Method and system for testing functionality of a chip checker |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |