CN112069080A - Automatic executable script test method and system - Google Patents

Automatic executable script test method and system Download PDF

Info

Publication number
CN112069080A
CN112069080A CN202011007479.3A CN202011007479A CN112069080A CN 112069080 A CN112069080 A CN 112069080A CN 202011007479 A CN202011007479 A CN 202011007479A CN 112069080 A CN112069080 A CN 112069080A
Authority
CN
China
Prior art keywords
action
script
test
actions
executable
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.)
Pending
Application number
CN202011007479.3A
Other languages
Chinese (zh)
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.)
Beijing Hezhong Weiqi Technology Co Ltd
Original Assignee
Beijing Hezhong Weiqi Technology 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 Beijing Hezhong Weiqi Technology Co Ltd filed Critical Beijing Hezhong Weiqi Technology Co Ltd
Priority to CN202011007479.3A priority Critical patent/CN112069080A/en
Publication of CN112069080A publication Critical patent/CN112069080A/en
Pending legal-status Critical Current

Links

Images

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/3684Test management for test design, e.g. generating new test cases
    • 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

Abstract

The invention discloses an automatic executable script test method and system, which comprises the following steps: designing an embedded software test scheme according to the test content; adjusting the sequence of the executed test actions and generating an executable script file; the system automatically executes the script to test the software; packaging the tested action as a specific action object in the testing process; encapsulating corresponding actions and action contents into specific attributes, and finishing the execution of one action by acquiring an action object in the execution process; according to the convention of the script test grammar, corresponding actions can be expanded according to actual conditions. The invention can expand the related actions according to the actual test condition, and the expanded actions according to the convention of the script test grammar are not restricted by the design of the test scheme, thereby improving the efficiency of the embedded software test.

Description

Automatic executable script test method and system
Technical Field
The invention relates to a computer processing method, in particular to an automatic executable script testing method and system.
Background
In the process of implementing embedded software testing, a series of operation actions are often predefined according to the testing purpose and requirements, and the testing of embedded software is implemented by encapsulating a predefined set of execution actions and then analyzing and executing the encapsulated actions in the process of executing a program.
How to efficiently organize, edit and execute test cases in the process of program testing is a dilemma faced by various professional software tests, a great deal of effort needs to be invested for testers to know a tested system, and how to design an executable script test grammar by simplifying test case compiling is combined with the system to analyze and execute. The tester only needs to pay attention to the formulation of the test scheme, the test script can be edited according to the operation graphical interface of the army, and the gravity center of the tester is put into the formulation of the test scheme.
Disclosure of Invention
Based on the above-mentioned shortcomings in the prior art, the invention provides an automated executable script testing method and system.
The invention overcomes the technical problems by adopting the following technical scheme, and specifically comprises the following steps:
an automated executable script testing method, comprising the steps of:
designing an embedded software test scheme according to test contents, and compiling test actions according to script test syntax;
the system encodes fixed actions according to limited and executable actions combed by a test scheme, then develops corresponding action functions, and develops corresponding pages according to corresponding action operations, wherein the interface is as simple as possible, one action is edited in a specified operation step, corresponding actions are added firstly according to the sequence of the test scheme, and a script grammar action is completed by a background according to the actions added by a foreground page;
step two, adjusting the sequence of the executed test actions and generating an executable script file;
generating a series of executable script files according to a series of execution actions compiled by the script test grammar and the series of operations according to a script file format;
step three, the system automatically executes the script to test the software;
and importing the generated executable script file into a system, creating an interpreter example by the system according to the preset parsing script file according to the script test grammar, then establishing a tree structure of the script file in a memory, and starting from a root element for parsing the script file.
As a further scheme of the invention: in the first step, the completion of the script grammar action is executed according to the following sequence:
s1, completing the adding of the start label of the execution action group; according to the specific action adding content, finishing the addition of the action starting label, and acquiring the action code and the action name transmitted from the foreground
S2, adding action codes and action name labels, and acquiring the specific content or value addition of actions;
s3, adding action values or content labels, adding the automatic action finishing labels of the system completely, and respectively adding and finishing limited execution actions through sequential circulation from S1 to S4;
and S4, adding an end tag for executing the action group, and generating a corresponding test script according to test requirements after the system finishes adding all actions.
As a still further scheme of the invention: in the second step, the executable script files are one or more, a plurality of script files can be edited and stored in the system at the same time, or a plurality of script files can be combined with each other to form a test script;
multiple script files may be edited and stored in the system simultaneously.
As a still further scheme of the invention: in the third step, the script file is analyzed to analyze the edited actions according to the tree structure, meanwhile, the system loads the analyzed script file into a specific test action object, the system acquires the action code according to the action object, executes specific operations according to the action code, and finally, the system executes all the actions defined in the script one by one to complete the test of a complete test scheme.
As a still further scheme of the invention: in the first step, the embedded software testing scheme comprises an action classification description unit, wherein the action classification description unit predefines a series of action codes according to commonly used execution actions in the embedded software testing process, and the action codes respectively comprise judgment, circulation, variable definition, writing operation, reading operation, system delay, information input, operation and exit action.
As a still further scheme of the invention: the third step also includes script import, the script import is executed based on the analysis extensible markup language, the system analyzes the data by analyzing the extensible markup language, the system loads the analyzed actions while analyzing the data, the actions are loaded into one action object, the system acquires the attribute content of the action object according to the sequence of script test grammar arrangement, then executes the corresponding action function according to the action code, and finally completes the execution of the whole test scheme.
An automated executable script test system comprising a memory and a processor, the memory having stored therein a computer program which, when executed by the processor, causes the processor to perform the steps of the automated executable script test method described above.
Compared with the prior art, the method has the following advantages that: .
Drawings
FIG. 1 is a flow chart of the operation of an automated executable script test system.
Detailed Description
To facilitate an understanding of the invention, the invention will now be described more fully with reference to the accompanying drawings. Preferred embodiments of the present invention are shown in the drawings. This invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
In addition, an element of the present invention may be said to be "fixed" or "disposed" to another element, either directly on the other element or with intervening elements present. When an element is referred to as being "connected" to another element, it can be directly connected to the other element or intervening elements may also be present. The terms "vertical," "horizontal," "left," "right," and the like as used herein are for illustrative purposes only and do not represent the only embodiments.
Referring to fig. 1, in an embodiment of the present invention, an automated executable script testing method includes the following steps:
designing an embedded software test scheme according to test contents, and compiling test actions according to script test syntax;
the system encodes fixed actions according to limited and executable actions combed by a test scheme, then develops corresponding action functions, and develops corresponding pages according to corresponding action operations, wherein the interface is as simple as possible, one action is edited in a specified operation step, corresponding actions are added firstly according to the sequence of the test scheme, and a script grammar action is completed by a background according to the actions added by a foreground page;
step two, adjusting the sequence of the executed test actions and generating an executable script file;
generating a series of executable script files according to a series of execution actions compiled by the script test grammar and the series of operations according to a script file format;
step three, the system automatically executes the script to test the software;
and importing the generated executable script file into a system, creating an interpreter example by the system according to the preset parsing script file according to the script test grammar, then establishing a tree structure of the script file in a memory, and starting from a root element for parsing the script file.
In one embodiment of the present invention, in the first step, the script syntax action is completed according to the following sequence:
s1, completing the adding of the start label of the execution action group; according to the specific action adding content, finishing the addition of the action starting label, and acquiring the action code and the action name transmitted from the foreground
S2, adding action codes and action name labels, and acquiring the specific content or value addition of actions;
s3, adding action values or content labels, adding the automatic action finishing labels of the system completely, and respectively adding and finishing limited execution actions through sequential circulation from S1 to S4;
and S4, adding an end tag for executing the action group, and generating a corresponding test script according to test requirements after the system finishes adding all actions.
In another embodiment of the present invention, in the second step, one or more executable script files may be provided, multiple script files may be edited and stored in the system at the same time, or multiple script files may be combined with each other to form a test script;
a plurality of script files can be edited and stored in the system at the same time, and generated when to be used;
the multiple script files can be combined with each other, and the edited scripts can be added or deleted at any time along with the change of the test scheme, so that the test script can be expanded.
In another embodiment of the present invention, in the third step, the script file is analyzed to analyze the edited actions according to a tree structure, meanwhile, the system loads the analyzed script file as a specific test action object, the system obtains an action code according to the action object, executes specific operations according to the action code, and finally, the system executes all actions defined in the script one by one to complete the test of a complete test scheme.
In another embodiment of the present invention, in the step one, the embedded software testing scheme includes an action classification description unit, and the action classification description unit pre-defines a series of action codes according to commonly used execution actions in the embedded software testing process, where the action codes are respectively judgment, circulation, variable definition, write operation, read operation, system delay, input information, operation, and exit action, and the action classification can be expanded at any time along with the richness of the testing scheme.
In another embodiment of the present invention, the third step further includes script importing, where the script importing is executed based on parsing xml, the system parses data through parsing xml, and loads parsed actions into one action object, and the system obtains attribute contents of the action object according to a sequence of script test syntax arrangement, then executes corresponding action functions according to action codes, and finally completes execution of the whole test scheme.
In one embodiment of the invention, an automated executable script test system includes a memory and a processor, the memory having stored therein a computer program, the computer program, when executed by the processor, causing the processor to perform the steps of the automated executable script test method as described in the above embodiments.
In detail, the invention aims to simplify the automatic testing process of embedded software, improve the working efficiency of test case compiling by testers and provide a set of relatively mature automatic executable script testing grammar and system. The automatic testing process of the embedded software is simplified mainly through a graphical interface, the compiling and executing efficiency is improved, and good expansibility is provided.
The steps of the test process are arranged and combined to form a set of complete test cases by predefining a group of script grammars for describing execution actions and according to the convention of the simple grammar, and new actions can be expanded at any time according to the convention of the script grammars along with the expansion of the test schemes, wherein the main script grammars comprise execution action groups (detect _ item), actions (action), action codes (action _ code), action names (action _ name), action values or contents (action _ value), the script grammars define a group of general script editing rules, the test cases can be expanded as long as the definition of the script grammars is met, the script test grammars are irrelevant to the test schemes, the optional execution actions can be expanded along with the increase of the test schemes, then the popular script grammars are displayed through a visual interface, and a user can edit the relevant test cases through the interface, the visual interface provides text description, the meaning of the user can be known through the text description, the page supports dragging, and the free change of the script execution sequence can be realized by arbitrarily dragging and editing actions. According to the specification of the script test grammar, the executable script file is generated by combining the test grammar definition and the grammar action classification. Meanwhile, in order to support the realization of script grammar, the invention provides a system which is responsible for editing the script grammar and generating an executable script file, and the system also provides a function of importing the script execution file, and the generated script file is imported into the system, and the system can detect the legality of the script file in advance; the system analyzes the file of the imported script in the execution process, and analyzes the script to obtain the executed action content; the method comprises the following steps of carrying out system loading, loading executed action contents into one object, judging action functions to be executed by acquiring attribute contents of the executed action objects, wherein each action code corresponds to one action function, the action functions encapsulate concrete operation steps of action execution, and testers do not need to know the operation steps; the system completes specific execution according to the action function, the system can execute according to the order of the reprinting of the action object in the execution process, and the completion of the execution can form a test record. The automatic execution of a test scheme can be completed through the steps of the system such as importing, analyzing, loading and executing the script.
The invention adopts the following specific scheme:
(1) and (3) an action grammar description file: a set of action grammar is defined, which comprises action items, action codes and names, and action contents, and then a series of action items are combined into a set of executable scripts.
The action grammar has:
< detect _ item > … < detect _ item > the content in the syntax represents a series of actions;
< action > … < action > a specific action of the content in the grammar;
< action _ code > … < action _ code > the content in the syntax represents an action code;
< action _ name > … < action _ name > the contents in the syntax represent the action specific name;
< action _ value > … < action _ value > the contents in the syntax represent the necessary or content to perform the action;
(2) action classification description file: according to the commonly used execution actions in the test process of the embedded software, a series of action codes are predefined, wherein the action codes are respectively actions such as judgment, circulation, variable definition, writing operation, reading operation, system delay, information input, operation, quitting and the like, and the action classification can be expanded at any time along with the richness of a test scheme.
Judging, namely judging the contents of numbers, character strings, objects and the like;
circulating, defining a group of actions to be continuously executed, and finishing when a certain judgment condition is reached;
defining variables for storing data of the action execution process temporarily;
writing operation, namely changing the action value through a command and observing the reaction of the embedded software to achieve the purpose of testing;
reading operation, namely reading the data content of the fixed storage area and observing the data instant change of the storage area;
the system delays, the waiting time in the test process is set, and a certain action is finished by waiting for a fixed time to use the action;
inputting information; editing a suggestive language description of some important operations;
operation, the data is added, subtracted, multiplied, divided, modulo and the like;
quitting, namely, when the system execution reaches a certain limit condition, quitting the system;
(3) editing and generating action scripts, and importing, analyzing, loading and executing the system. The script test grammar is implemented based on the DOM4J parsing extensible markup language (extensible markup language) document function, and DOM4J is an easy-to-use, open-source class library that allows reading, writing, traversing, creating and modifying XML documents. DOM4J is based on a Java interface, allows plug-and-play documents, implementations of object models, and encourages the creation of small, read-only, fast implementations, or larger implementations with high-speed index navigation. At present, most data is transmitted between a client and a server in an XML form and is established on an XML script file, a DOM4J analytic model firstly creates an example SAXReader of an interpreter, then establishes a tree structure of the XML file in a memory, and then judges whether the XML file is the XML file or generates a new XML file. Parsing the XML file begins with the root element. Generating the XML file is done by a method in the Element object. The system shields the user in the XML generating process, the user only needs to add corresponding actions according to a visual interface, testers edit the actions of the test scheme one by one to form an action group, then the actions are adjusted in sequence, finally an executable script file (the suffix of the script file is XML) is generated,
and importing the script file into a system, analyzing the data by the system through DOM4J, loading the analyzed actions by the system while analyzing, loading the actions into one action object, finally acquiring the attribute content of the action object by the system according to the sequence of the script test grammar arrangement, then executing the corresponding action function according to the action code, and finally finishing the execution of the whole test scheme.
The foregoing is merely illustrative of the preferred embodiments of the present invention and is not to be construed as limiting the claims. The present invention is not limited to the above embodiments, and the specific structure thereof is allowed to vary. But all changes which come within the scope of the invention are intended to be embraced therein.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.

Claims (7)

1. An automated executable script testing method is characterized by comprising the following steps:
designing an embedded software test scheme according to test contents, and compiling test actions according to script test syntax;
the system encodes fixed actions according to limited and executable actions combed by a test scheme, then develops corresponding action functions, and develops corresponding pages according to corresponding action operations, wherein the interface is as simple as possible, one action is edited in a specified operation step, corresponding actions are added firstly according to the sequence of the test scheme, and a script grammar action is completed by a background according to the actions added by a foreground page;
step two, adjusting the sequence of the executed test actions and generating an executable script file;
generating a series of executable script files according to a series of execution actions compiled by the script test grammar and the series of operations according to a script file format;
step three, the system automatically executes the script to test the software;
and importing the generated executable script file into a system, creating an interpreter example by the system according to the preset parsing script file according to the script test grammar, then establishing a tree structure of the script file in a memory, and starting from a root element for parsing the script file.
2. An automated executable script testing method according to claim 1, wherein in the first step, the script syntax actions are performed in the following order:
s1, completing the adding of the start label of the execution action group; according to the specific action adding content, finishing the addition of the action starting label, and acquiring the action code and the action name transmitted from the foreground
S2, adding action codes and action name labels, and acquiring the specific content or value addition of actions;
s3, adding action values or content labels, adding the automatic action finishing labels of the system completely, and respectively adding and finishing limited execution actions through sequential circulation from S1 to S4;
and S4, adding an end tag for executing the action group, and generating a corresponding test script according to test requirements after the system finishes adding all actions.
3. The automated executable script testing method of claim 1, wherein in the second step, the executable script files are one or more, a plurality of script files can be edited and stored in the system at the same time, or a plurality of script files can be combined with each other to form a testing script;
multiple script files may be edited and stored in the system simultaneously.
4. The automated executable script testing method of claim 1, wherein in the third step, the script file is parsed to parse the edited actions according to a tree structure, and meanwhile, the system loads the parsed script file as a specific test action object, the system obtains action codes according to the action objects, executes specific operations according to the action codes, and finally, the system executes all actions defined in the script one by one to complete a test of a complete test scheme.
5. The automated executable script testing method of claim 1, wherein in the first step, the embedded software testing scheme comprises an action classification description unit, and the action classification description unit pre-defines a series of action codes according to commonly used execution actions in the embedded software testing process, wherein the action codes are respectively judgment, circulation, variable definition, writing operation, reading operation, system delay, input information, operation and exit action.
6. The automated executable script test method according to claim 1, characterized in that the third step further comprises script import, the script import is executed based on parsing xml, the system parses the data by parsing xml, the system loads the parsed actions while parsing, and loads the actions into one action object, the system obtains the attribute contents of the action object according to the sequence of script test syntax arrangement, then executes the corresponding action function according to the action code, and finally completes the execution of the whole test scheme.
7. An automated executable script test system comprising a memory and a processor, the memory having stored therein a computer program which, when executed by the processor, causes the processor to perform the steps of the automated executable script test method of any one of claims 1 to 6.
CN202011007479.3A 2020-09-23 2020-09-23 Automatic executable script test method and system Pending CN112069080A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011007479.3A CN112069080A (en) 2020-09-23 2020-09-23 Automatic executable script test method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011007479.3A CN112069080A (en) 2020-09-23 2020-09-23 Automatic executable script test method and system

Publications (1)

Publication Number Publication Date
CN112069080A true CN112069080A (en) 2020-12-11

Family

ID=73682020

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011007479.3A Pending CN112069080A (en) 2020-09-23 2020-09-23 Automatic executable script test method and system

Country Status (1)

Country Link
CN (1) CN112069080A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112988596A (en) * 2021-04-27 2021-06-18 北京全路通信信号研究设计院集团有限公司 Automatic testing method and system based on state transition

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060004827A1 (en) * 2004-05-07 2006-01-05 International Business Machines Corporation XML based scripting language
CN106095679A (en) * 2016-06-12 2016-11-09 南京大学 Graphical interfaces method for generating test case based on Freehandhand-drawing identification
CN106933738A (en) * 2017-02-09 2017-07-07 珠海格力电器股份有限公司 APP method of testings, APP test scripts generating means and APP test script performs devices
CN108446110A (en) * 2018-03-14 2018-08-24 武汉斗鱼网络科技有限公司 Lua scenario generation methods, device, terminal and computer-readable medium
CN110837362A (en) * 2019-11-01 2020-02-25 无锡数信互融科技发展有限公司 Method, system and editor for editing rule of guide type visual graphic modularization
US10757132B1 (en) * 2017-09-08 2020-08-25 Architecture Technology Corporation System and method for evaluating and optimizing training effectiveness

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060004827A1 (en) * 2004-05-07 2006-01-05 International Business Machines Corporation XML based scripting language
CN106095679A (en) * 2016-06-12 2016-11-09 南京大学 Graphical interfaces method for generating test case based on Freehandhand-drawing identification
CN106933738A (en) * 2017-02-09 2017-07-07 珠海格力电器股份有限公司 APP method of testings, APP test scripts generating means and APP test script performs devices
US10757132B1 (en) * 2017-09-08 2020-08-25 Architecture Technology Corporation System and method for evaluating and optimizing training effectiveness
CN108446110A (en) * 2018-03-14 2018-08-24 武汉斗鱼网络科技有限公司 Lua scenario generation methods, device, terminal and computer-readable medium
CN110837362A (en) * 2019-11-01 2020-02-25 无锡数信互融科技发展有限公司 Method, system and editor for editing rule of guide type visual graphic modularization

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112988596A (en) * 2021-04-27 2021-06-18 北京全路通信信号研究设计院集团有限公司 Automatic testing method and system based on state transition

Similar Documents

Publication Publication Date Title
US8402434B2 (en) Graphical user interface (GUI) script generation and documentation
CN110427331B (en) Method for automatically generating performance test script based on interface test tool
CN108399130A (en) Automatically generate the method, apparatus, equipment and readable storage medium storing program for executing of test cases
US10437574B2 (en) System and method for providing code completion features for code modules
US7661053B2 (en) Methods and apparatus for patternizing device responses
US20070061641A1 (en) Apparatus and method for generating test driver
CN109508298B (en) Graphical script test method and system
CN111078555B (en) Test file generation method, system, server and storage medium
CN104834600A (en) Method for testing Android application controls
CN110162457A (en) Test method, device, equipment and the storage medium of user interface
CN113553035A (en) Design and construction method of universal front-end UI component library
CN102782649A (en) Application modification section search device and application modification section search method
CN112069080A (en) Automatic executable script test method and system
CN112631704A (en) Interface element identification method and device, storage medium and electronic equipment
Oliveira pytest Quick Start Guide: Write better Python code with simple and maintainable tests
Pereira et al. An IOPT-net state-space generator tool
KR100369252B1 (en) Software test system and method
CN115098368A (en) Intelligent verification method and device for recognizing brain picture use case
US8191050B2 (en) Information processor, control method therefor, computer program and storage medium
CN113672509A (en) Automatic testing method, device, testing platform and storage medium
CN110533143B (en) Method and device for generating electronic card, storage medium and computer equipment
CN110688321B (en) Method for enhancing mobile application test by combining group intelligence and machine intelligence
US11526336B2 (en) Community-oriented, cloud-based digital annealing platform
CN116955140A (en) SDK test method, device, equipment and storage medium
CN115268907A (en) Method for generating software system control interaction logic by using json data

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