CN116701237A - Test script generation and test method, equipment and storage medium - Google Patents

Test script generation and test method, equipment and storage medium Download PDF

Info

Publication number
CN116701237A
CN116701237A CN202310997148.6A CN202310997148A CN116701237A CN 116701237 A CN116701237 A CN 116701237A CN 202310997148 A CN202310997148 A CN 202310997148A CN 116701237 A CN116701237 A CN 116701237A
Authority
CN
China
Prior art keywords
job
target
test
test script
name
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.)
Granted
Application number
CN202310997148.6A
Other languages
Chinese (zh)
Other versions
CN116701237B (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.)
Beijing Jidu Technology Co Ltd
Original Assignee
Beijing Jidu 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 Jidu Technology Co Ltd filed Critical Beijing Jidu Technology Co Ltd
Priority to CN202310997148.6A priority Critical patent/CN116701237B/en
Publication of CN116701237A publication Critical patent/CN116701237A/en
Application granted granted Critical
Publication of CN116701237B publication Critical patent/CN116701237B/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/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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the application provides a test script generation and test method, test script generation and test equipment and a storage medium. According to the embodiment of the application, the test script adapted to each operation scene can be automatically generated according to the grammar structure of the professional language describing the test case, corresponding target test data and target test script are acquired and executed aiming at the target operation scene with test requirements, and the accuracy of the execution result of the target test data in the target operation scene is checked based on the corresponding relation among the operation steps, the operation actions, the operation parameters and the operation results. By means of the method, for a developer, the automatic test of parameters of a professional tester can be achieved without the need of simply executing output data, executing programs and the like according to the test script, so that labor cost can be reduced, accuracy of program codes can be improved, overall test period of project codes before the project codes are on line is shortened, and test efficiency is improved.

Description

Test script generation and test method, equipment and storage medium
Technical Field
The present application relates to the field of software testing technologies, and in particular, to a method, an apparatus, and a storage medium for generating and testing a test script.
Background
In a traditional test scenario, a tester usually expresses a service test case through natural language, and a professional technician writes a test script according to the test case described by the tester, and further, the service function is tested by executing the test script.
However, with the continuous development of software technology, requirements for software testing are also higher, and especially in the days of intelligent devices becoming more common, testing work is also increasingly complex. In this case, the service function is tested by adopting the conventional test mode, which is not only inefficient, but also requires excessive labor cost.
Disclosure of Invention
Aspects of the application provide a test script generation and test method, equipment and a storage medium, which are used for realizing automatic generation of a test script and automatic test, reducing manual participation and improving test efficiency.
The embodiment of the application provides a test script generation method, which comprises the following steps: acquiring job description information corresponding to a target job scene, wherein the job description information at least comprises an execution sequence among a plurality of job steps and job actions associated with each job step; generating at least an operation name conforming to the grammar structure for each operation step according to the grammar structure of the special language describing the test case, wherein the operation name is used for describing the operation action associated with the corresponding operation step; for each operation step, generating an operation sentence corresponding to the operation step at least according to an operation name corresponding to the operation step and a sentence ending symbol required by the grammar structure; and generating a target test script corresponding to the target job scene according to the execution sequence among the plurality of job steps and the operation sentences corresponding to the plurality of job steps respectively.
In this embodiment, according to the acquired job description information corresponding to the target job scene, the test case corresponding to the target job scene can be automatically generated, in this way, for a developer, only a simple setting operation is required to be executed according to the job description information, so that the test case conforming to the grammar structure of the special language describing the test case can be automatically generated, the whole process can complete the self-test work without the participation of professional testers, not only can the labor cost be reduced, but also the accuracy of the program code can be improved, the whole test period of the project code before the online is shortened, and the test efficiency is improved.
In an alternative embodiment, the job description information further includes necessary job parameters and/or a correspondence between job results and job actions, and the method further includes: determining a target operation step associated with the necessary operation parameters according to the operation description information, and generating transfer parameters conforming to the grammar structure aiming at an operation name corresponding to the target operation step; and/or determining a target job result associated with a target job step according to the job description information, and generating an output parameter conforming to the grammar structure aiming at an operation name corresponding to the target job step.
In this embodiment, the operation steps described in the operation description information, the operation actions associated with the operation steps, and the operation parameters and/or operation results corresponding to the operation actions may be automatically converted into operation names conforming to the grammar structure of the special language describing the test case, which provides a basis for the subsequent automatic generation of operation sentences and test scripts, and helps to improve the processing efficiency.
In an alternative embodiment, for each job step, generating an operation sentence corresponding to the job step at least according to an operation name corresponding to the job step and a sentence ending symbol required by the grammar structure, including: and splicing the operation name, the transmission parameter and/or the output parameter corresponding to each operation step and the sentence ending symbol required by the grammar structure according to the corresponding relation between the operation action associated with each operation step and the corresponding necessary operation parameter and/or the operation result, so as to obtain the corresponding operation sentence.
In the embodiment, the literal operation description information can be converted into the operation statement and the corresponding test script which can be recognized by the computer equipment based on the grammar structure of the special language, and the whole conversion process does not need manual check, so that the accuracy can be ensured, the generation efficiency of the test script can be improved, and a foundation is provided for subsequent automatic test.
In an alternative embodiment, according to a grammar structure of a special language describing the test case, generating at least an operation name conforming to the grammar structure for each operation step includes: acquiring an execution sequence set for the plurality of job steps and job actions set in association with each job step in response to a first setting operation executed according to the job description information; and generating operation names corresponding to each operation step and the associated operation action according to the grammar structure of the special language describing the test case.
In an alternative embodiment, the method further comprises: responding to a second setting operation executed according to the job description information, and acquiring necessary job parameters and/or job results set for each job action; according to a grammar structure of a special language describing the test case, generating an operation name corresponding to a necessary operation parameter associated with each operation action conforming to the grammar structure and taking the operation name as a transmission parameter; and/or generating an operation name corresponding to the operation result associated with each operation action conforming to the grammar structure and taking the operation name as an output parameter.
In this embodiment, under the condition of ensuring that each operation sentence and test script are automatically generated, a worker can set each operation step and its associated operation action, and the operation parameters of each operation action and/or the operation names corresponding to the operation results through a visual operation interface, so that the operation mode is more flexible, and specific actual setting requirements can be met.
The embodiment of the application also provides an automatic test method, which comprises the following steps: acquiring target test data and a target test script corresponding to a target operation scene, wherein the target test script is generated based on a grammar structure of a special language describing a test case, and comprises a plurality of operation sentences, and each operation sentence at least comprises operation steps in the target operation scene and operation names corresponding to associated operation actions of the operation steps; according to the grammar structure, carrying out grammar and semantic analysis on the target test script, and determining target operation sentences with lexical and/or semantic errors; outputting corresponding prompt information under the condition that the existence of the target operation statement is determined; executing the target test script to test the target test data under the condition that the analysis passes; and in the execution process, determining incorrect logic error data and corresponding error reasons in the target test data, and outputting the incorrect logic error data and the corresponding error reasons as test results.
In an alternative embodiment, obtaining target test data and target test scripts corresponding to a target job scenario includes: responding to the executed first selection operation, and acquiring a selected target job scene; and responding to a second selection operation executed for the target job scene, and acquiring the selected target test data and target test script.
In the embodiment of the application, the test script generated based on the grammar structure of the special language describing the test case can be directly read and executed by the computer equipment, and the corresponding target test script can be executed for the target operation scene to automatically test each operation function in the target operation scene, thereby being beneficial to improving the test efficiency; in addition, in the process of executing the test script, the test script can be automatically analyzed and checked, and corresponding prompt information is output according to the check result, so that the test script or test data can be conveniently and timely modified by a tester, and the accuracy of further test results can be guaranteed.
In an alternative embodiment, executing the target test script includes: determining an object structure corresponding to each operation statement in the target test script in an executable program, and determining a program object corresponding to each operation name in each operation statement in the object structure; and according to the object structure and the program object, converting each operation sentence and each operation name in the target test script into each program object corresponding to each object structure in the executable program to obtain executable target program codes. Therefore, according to the specific development language type, the test script can be correspondingly converted into the target program code which can be read and executed by the development language, the test process can be processed as required, and the flexibility is improved.
The embodiment of the application also provides a computer device, which comprises: a processor and a memory storing a computer program for implementing the test script generation method or the automated test method when the processor executes the computer program.
Embodiments of the present application also provide a computer-readable storage medium storing a computer program/instruction that, when executed by a processor, causes the processor to implement the test script generation method or the automated test method.
In the embodiment of the application, based on the grammar structure corresponding to the special language describing the test case, the test script adapted to each job scene can be automatically generated, the test script comprises operation sentences corresponding to each operation step, each operation sentence comprises operation names corresponding to each operation step and the corresponding operation action, and the operation actions requiring to input the operation parameters and/or output the operation results and the operation names corresponding to the operation parameters and/or the operation results. Based on the above, for the target job scenario with the test requirement, the target test data and the target test script corresponding to the target job scenario can be obtained, and by executing the target test script, the execution result of the target test data under the target job scenario can be checked based on the corresponding relation among the indicated job steps, job actions, job parameters and/or job results, so as to confirm whether the execution result is accurate. Further, under the condition that the logic error is detected, corresponding prompt information is output for a developer to modify the program code. By means of the method, for a developer, the automatic test of parameters of a professional tester can be achieved without the need of simply executing output data, executing programs and the like according to the test script, so that labor cost can be reduced, accuracy of program codes can be improved, overall test period of project codes before the project codes are on line is shortened, and test efficiency is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
FIG. 1 is a flowchart of a test script generation method according to an embodiment of the present application;
FIG. 2 is a flow chart of an automated test method according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be clearly and completely described below with reference to specific embodiments of the present application and corresponding drawings. It will be apparent that the described embodiments are only some, but not all, embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
In order to solve the problems that a large amount of labor cost is required to be input and the testing efficiency is low in a traditional testing mode, the embodiment of the application provides a test script generation method and a method for automatically testing a test script generated based on the method. Based on the method, the automatic generation of the test script and the automatic test through the computer equipment can be realized, the manual participation is reduced, and the test efficiency is improved.
The method provided by the embodiment of the application is described below with reference to the accompanying drawings.
Fig. 1 is a flowchart of a test script generating method according to an embodiment of the present application, where, as shown in fig. 1, the method includes:
s1, acquiring job description information corresponding to a target job scene, wherein the job description information at least comprises an execution sequence among a plurality of job steps and job actions associated with each job step;
s2, generating at least an operation name which accords with the grammar structure for each operation step according to the grammar structure of the special language describing the test case, wherein the operation name is used for describing the operation action associated with the corresponding operation step;
s3, generating an operation sentence corresponding to each operation step at least according to the operation name corresponding to the operation step and the sentence ending symbol required by the grammar structure;
s4, generating a target test script corresponding to the target job scene according to the execution sequence among the plurality of job steps and the operation sentences corresponding to the plurality of job steps.
In the embodiment of the present application, in order to generate a test script corresponding to each job scenario, job description information corresponding to a target job scenario may be acquired first, where the job description information includes at least an execution sequence among a plurality of job steps and a job action associated with each job step. In the embodiment of the application, the grammar structure of the special language describing the test case is provided, based on the grammar structure of the special language describing the test case, at least an operation name conforming to the grammar structure can be generated for each operation step, wherein the operation name is used for describing the operation action associated with the corresponding operation step. For each operation step, generating an operation sentence corresponding to the operation step at least according to an operation name corresponding to the operation step and a sentence ending character required by a grammar structure, and further generating a target test script corresponding to a target operation scene according to an execution sequence among a plurality of operation steps and operation sentences corresponding to the plurality of operation steps.
In the embodiment of the application, the job description information is determined by a project according to specific user requirements before development, and can be completed by a professional team. Accordingly, the method for acquiring the job description information is not limited, for example, in the case that the job description information is a readable program file, a corresponding program file may be acquired from a designated storage location, and the corresponding job description information may be read and acquired to be used for displaying the read job description information and indicating a subsequent setting operation of a worker. For another example, in the case where the job description information is a normal text file, the text file prepared in advance may be uploaded to a designated directory to be read and the corresponding job description information may be obtained, so as to be used for displaying the read job description information and indicating a subsequent setting operation by a worker. For another example, without showing the specific content of the job description information, the operator may also directly open the text file to view the job description information therein to perform the subsequent operation according to the job description information recorded therein. The specific manner may be determined according to actual requirements, and is not limited herein.
According to the embodiment of the application, the test case corresponding to the target operation scene can be automatically generated according to the acquired operation description information corresponding to the target operation scene, in this way, for a developer, the test case which accords with the grammar structure of the special language for describing the test case can be automatically generated only by executing simple setting operation according to the operation description information, the whole process can complete self-test work without the participation of professional testers, the labor cost can be reduced, the accuracy of the program codes can be improved, the whole test period of the project codes before the project codes are on line is shortened, and the test efficiency is improved.
In the embodiment of the present application, the specific format corresponding to the generated test script and the specific type of the specific language according to the specific format are not limited, and any grammar structure and file type of the specific language which can be used for the test device to read and execute are applicable to the embodiment of the present application. Optionally, the types corresponding to the grammar structure of the special language provided by the embodiment of the application include, but are not limited to, extensible markup language (Extensible Markup Language, XML), javaScript, javaScript object exchange format (JavaScript Object Notation, JSON), hypertext markup language (Hyper Text Markup Language, HTML) file, test case definition language (Testcase DefineLanguage, TDL), and the like; accordingly, the test script file format generated based on the syntax structure of the specific language may be xml format, js format, html format, shell format, and the like. Optionally, in the embodiment of the present application, a specific language is taken as a TDL type, and a corresponding generated test script is taken as a shell type as an example for explanation.
In the embodiment of the present application, the specific content of the job description information is not limited either, and optionally, the job description information may include, in addition to the execution sequence among the plurality of job steps and the job action associated with each job step, a necessary job parameter and/or a correspondence between the job result and the job action, based on which a target job step associated with the necessary job parameter may be determined according to the job description information. Further, corresponding transmission parameters are generated aiming at operation names corresponding to the target operation steps, and/or target operation results related to the target operation steps are determined according to the operation description information, and corresponding output parameters are generated aiming at the operation names corresponding to the target operation steps, wherein the transmission parameters and/or the output parameters accord with the grammar structure of the special language describing the test case. By the method, the operation steps described in the operation description information, the operation actions related to the operation steps, the operation parameters corresponding to the operation actions and/or the operation results can be automatically converted into the operation names conforming to the grammar structures of the special language describing the test cases, a basis is provided for subsequent automatic generation of operation sentences and test scripts, and the improvement of processing efficiency is facilitated.
In the embodiment of the present application, the specific format corresponding to the grammar structure of the special language is not limited, and optionally, the grammar structure of the special language in the embodiment of the present application specifies: the test script includes 6 parts, namely a step name, an action name, a specified parameter name, a variable name and an annotation. In the above 6 parts of content, the action name is the necessary content, and the other is the optional content, identified by [ ]; each sentence ends with a semicolon, the annotation is placed at the end of the corresponding sentence and does not participate in operation, and is marked with "#"; for the variable, definition is required before use, the variable value is acquired in "$", and the stored variable value indicates a storage object for storing the scalar value in "- >". Based on this, the format corresponding to each statement in the test script can be expressed as: the method includes the steps of [ (step_name > ] and OPTNAME ] >, [ < param >, ] and [ < key_param >, ] - > < var_name > ], and < comments >; wherein the content in < > is an operation name.
For example, in the job description information obtained in the embodiment of the present application, a target job scenario includes two job steps altogether, and it is assumed that step 1 includes two job actions of "set signal" and "wait signal", the "set signal" action corresponds to 6 parameters to be input, and is "main body", "message name", "signal name", "number", "timeout period", and corresponding "parameter list", respectively, where the value of "number" is 1, the value of "timeout period" is 10, the "parameter list" is represented by the coincidence parameter p, including 23, m, and a is composed of 2 and 3, and the "set signal" action also corresponds to one comment information, and the content is "set signal on main body". The "wait signal" action corresponds to 3 output parameters, namely "flexible ray", "type" and a coincidence parameter, the values of the coincidence parameter are a, b, c, and the value of c is 10, and the "wait signal" action also corresponds to a comment information, the content is "this line is comment". Assuming that step 2 includes two job actions of "check service" and "check", the "check service" action is a check action, and it is necessary to check the composite parameter in the form of 1 key-value pair, where "key" is "xxx" and "value" is "23", and after checking, it is necessary to store the corresponding value into variable ret; the "check" action is also a check action, requiring whether the value stored in the variable ret is equal to 1.
Based on this, step1 and Step2 can be respectively converted into corresponding operation names Step1 and Step2 according to the grammar structure corresponding to the special language describing the test case, two job actions of "SET SIGNAL" and "WAIT SIGNAL" are respectively converted into corresponding operation names "set_signal" and "wait_signal", input parameters "body", "message name", "SIGNAL name", "number", "timeout duration" and "parameter list" corresponding to the "SET SIGNAL" actions are respectively converted into corresponding operation names bodycan, messagename, signalname, 1, timeout=10 and p= [23, m, a= [2,3] ], and the content "SET SIGNAL" in body "of the corresponding annotation information is converted into automatically identifiable character string sentence" set_ SIGNAL on bodycan "; correspondingly, the output parameters "flexible ray", "type" and a coincidence parameter corresponding to the "wait signal" action are respectively converted into "Flexray", "1-2-3" and "[ a, b, c=10 ]", and the content "the line is annotation" of the corresponding annotation information is converted into an automatically identifiable character string sentence "this line is a comment". Likewise, two job actions of "CHECK SERVICE" and "CHECK" may be converted into corresponding operation names "check_service" and "CHECK", respectively, CHECK parameters of "CHECK SERVICE" action may be converted into corresponding operation names "" { ' KEY ': ' VAL ', ' XXX ':23} - > ret ", and CHECK parameters of" CHECK "action may be converted into corresponding operation names" = ', $ret, 1".
Further, when obtaining the operation names corresponding to each operation step and the associated operation action thereof, and the operation parameters and/or the operation results corresponding to each operation action, the operation names, the transmission parameters and/or the output parameters corresponding to each operation step and the sentence ending symbol required by the grammar structure may be spliced according to the corresponding relation between the operation action associated with each operation step and the corresponding necessary operation parameters and/or the operation results, so as to obtain the corresponding operation sentence. Further, a target test script corresponding to the target job scenario is generated according to the execution sequence among the plurality of job steps and the operation sentences corresponding to the plurality of job steps. By the method, literal operation description information can be converted into operation sentences and corresponding test scripts which can be recognized by computer equipment based on a grammar structure of a special language, manual check is not needed in the whole conversion process, accuracy can be guaranteed, generation efficiency of the test scripts can be improved, and a foundation is provided for subsequent automatic test.
Based on this, splicing is performed for each sentence in the above example, and a target test script in the following format can be obtained:
Step1:SET_SIGNAL,bodycan,messagename,signalname,1,timeout=10, p=[23, m,a=[2,3]]; # set_signal on bodycan
WAIT_SIGNAL, Flexray, '1-2-3', [a,b,c=10];# this line is a comment
step2: CHECK_SERVICE, "{'KEY': 'VAL', 'XXX':23}" -> ret;
CHECK, '==', $ret, 1;
It should be noted that, the embodiment of the present application is not limited to the specific manner of converting the job description information into the operation sentence conforming to the specific language grammar structure and generating the test script. Optionally, the embodiment of the application may provide an operation interface for generating the test script, and the staff may execute a corresponding setting operation on the operation interface according to the job description information, so as to set an operation name corresponding to each job step and its associated job action in the test script. For example, the worker may set the corresponding execution order for the plurality of job steps and set the associated job action for each job step according to the first setting operation performed by the job description information, based on which, in the case of responding to the first setting operation performed by the worker, the execution order set for the plurality of job steps and the job action set for each job step in association may be acquired, and the operation name corresponding to each job step and its associated job action, respectively, conforming to the syntax structure may be generated according to the syntax structure of the specific language describing the test case. For another example, the staff member may further perform a second setting operation according to the job description information to set a necessary job parameter and/or a job result for each job action, based on which, in the case of responding to the second setting operation performed by the staff member, an operation name corresponding to the necessary job parameter associated with each job action conforming to the syntax structure may be generated as a transfer parameter according to the syntax structure of the specific language describing the test case; and/or generating an operation name corresponding to the operation result associated with each operation action conforming to the grammar structure and taking the operation name as an output parameter.
For example, with the job description information in the above example, the worker may perform a setting operation on the operation interface to set each operation name required to generate the test script. Optionally, various functional controls may be disposed on the operation interface, for example, functional controls for setting operation steps, setting operation actions and corresponding operation parameters and/or operation results thereof for each operation step, and setting operation relationships among parameter types, parameter values, parameters for each operation parameter. Based on the above, the staff can set various operation names corresponding to the above-mentioned job description information through various functional controls provided on the operation page, so as to be used for generating corresponding operation sentences and test scripts. Of course, the specific style of the operation interface is not limited to this, and the above description is merely exemplary, and any operation interface that can realize the setting operation is applicable to the embodiment of the present application.
For example, a worker may perform the following operations:
firstly, setting two operation steps, namely step1 and step2;
next, for step1, two job actions opt1 and opt2 are SET for it, the name of opt1 is SET to "set_signal", and the name of opt2 is SET to "wait_signal";
Further, for opt1, setting corresponding parameter names as bodycan, messagename, signalname, 1, timeout and p, and corresponding annotation content as set_ signal on bodycan; for each parameter, setting the type of bodycan, messagename, signalname as a character string type, setting the types of 1 and timeout as a numerical value type, setting a default value of 10 for timeout, setting the type of p as a character string array type, setting three array elements for p, 23, m and a respectively, setting the type of 23 as a numerical value type, setting the type of m as a character type, setting the type of a as an array type, and setting data elements of two numerical value types for not array a as 2 and 3 respectively; setting corresponding parameter names of opt2 as Flexray, '1-2-3' and [ a, b, c=10 ]; for each parameter, setting the types of Flexray and '1-2-3' as character string types, setting an array type of [ a, b, c=10 ], and setting a data element c in the array type as a numerical value type, wherein the corresponding default value is 10;
accordingly, similar operations are performed for step2, for which corresponding job actions and corresponding job parameters are set to obtain respective operation names corresponding to the job description information.
Based on the above, in the case of responding to the setting operation and acquiring the set operation names, for each job step, an operation sentence corresponding to each job step may be generated according to the operation name corresponding to the job step and a sentence terminator required by a syntax structure of a specific language, and a target test script may be generated according to an execution order among a plurality of job steps and operation sentences corresponding to a plurality of job steps, respectively, in the following format:
Step1:SET_SIGNAL,bodycan,messagename,signalname,1,timeout=10, p=[23, m,a=[2,3]]; # set_signal on bodycan
WAIT_SIGNAL, Flexray, '1-2-3', [a,b,c=10];# this line is a comment
step2: CHECK_SERVICE, "{'KEY': 'VAL', 'XXX':23}" -> ret;
CHECK, '==', $ret, 1;
by the method, under the condition that the automatic generation of each operation statement and test script is ensured, a worker can set each operation step and the associated operation action thereof, and the operation parameters of each operation action and/or the operation names corresponding to the operation results through the visual operation interface, so that the operation mode is more flexible, and the specific actual setting requirements can be met.
It should be noted that after the above execution operation, a test script for testing use can be obtained, further optionally, in order to ensure that the generated test script can be directly executed by a test program, before the test script corresponding to the target operation scene is generated, grammar and semantic analysis can be performed on operation sentences corresponding to a plurality of operation steps respectively according to a grammar structure corresponding to a special language for describing the test case, so as to determine a target sentence with lexical and/or semantic errors; and outputting corresponding prompt information for the testers to modify the target sentence under the condition that the target sentence exists. Further, when the analysis passes, the test script is converted into executable target program code as a target test script corresponding to the target job scenario. For the process of syntactic and semantic parsing of each operation sentence and converting the test script into executable object program code, reference may be made to the following embodiments, which are not described in detail herein.
Based on the foregoing, the embodiment of the present application further provides an automatic testing method, and fig. 2 is a flowchart of the method, as shown in fig. 2, where the method includes:
p1, acquiring target test data and a target test script corresponding to a target operation scene, wherein the target test script is generated based on a grammar structure of a special language describing the test case, and comprises a plurality of operation sentences, and each operation sentence at least comprises operation steps in the target operation scene and operation names corresponding to associated operation actions of the operation steps;
p2, according to the grammar structure, carrying out grammar and semantic analysis on the target test script, and determining target operation sentences with lexical and/or semantic errors;
p3, outputting corresponding prompt information under the condition that the existence of the target operation statement is determined;
p4, executing the target test script under the condition that analysis passes so as to test the target test data;
and P5, determining incorrect logic error data and corresponding error reasons in the target test data in the execution process, and outputting the incorrect logic error data and the corresponding error reasons as test results.
In the embodiment of the application, in order to test the functions under different operation scenes, test data and test scripts corresponding to various operation scenes can be prestored, and a corresponding test operation interface is provided, wherein the operation interface can be provided with an operation control of a service scene selection function and a function control of the test data and the test scripts configured for each operation scene. Based on this, the worker may perform a first selection operation to select a target job scenario and a second selection operation for the target job scenario to select target test data and a target test script corresponding to the target job scenario according to actual test requirements. Further, in the case of responding to the first selection operation performed, the selected target job scenario may be acquired, and in the case of responding to the second selection operation performed for the target job scenario, the selected target test data and the target test script may be acquired. And executing the target test script according to the target test data, and executing the corresponding test task aiming at the target operation scene.
It should be noted that, when the target test script is obtained, in addition to the manner of executing the selection operation on the operation interface in the above embodiment, the target test data may be directly obtained from the preset storage address, where the target test data may be stored after being generated by the above test script generating method, or may be manually edited by the tester according to the syntax structure corresponding to the specific language describing the test case, which is not limited herein.
In the embodiment of the application, the target test script corresponding to the target job scene is obtained and generated based on a grammar structure of a special language describing the test case, wherein the target test script comprises a plurality of operation sentences, and each operation sentence at least comprises operation steps in the target job scene and operation names corresponding to associated job actions respectively. Based on the above, in order to ensure smooth execution of the test task and obtain a correct test result, under the condition that the target test script is obtained, grammar and semantic analysis can be performed on the target test script according to the grammar structure of the special language so as to determine the target sentence with lexical and/or semantic errors, and under the condition that the target sentence is determined to exist, corresponding prompt information is output so as to enable a tester to modify the target sentence. The target test script comprises a plurality of operation steps and operation names corresponding to the operation steps, and further comprises operation names corresponding to the operation parameters of each operation and/or the operation results of the operation to be input and/or the operation results to be output. Based on this, in the case that both the lexical and semantic analysis pass, the target test script may be executed to confirm whether the result of execution of the target test data in the program corresponding to the target job scenario is correct according to the job step indicated in the target test script and the corresponding job action thereof, the job parameter corresponding to the job action, and/or the output job result. In the execution process, the incorrect logic error data and the corresponding error reasons in the target test data are determined and output as test results for a developer to modify the error data.
In the embodiment of the application, the test script generated based on the grammar structure of the special language describing the test case can be directly read and executed by the computer equipment, and the corresponding target test script can be executed for the target operation scene to automatically test each operation function in the target operation scene, thereby being beneficial to improving the test efficiency; in addition, in the process of executing the test script, the test script can be automatically analyzed and checked, and corresponding prompt information is output according to the check result, so that the test script or test data can be conveniently and timely modified by a tester, and the accuracy of further test results can be guaranteed.
It should be noted that, the embodiment of the present application is not limited to the development language type corresponding to the automation program for executing the target test script, and optionally, the embodiment of the present application is illustrated by taking Python type as an example. Based on the above, in the case of starting execution of the test task, the Python program may read the target test script, and parse the target test script in grammar and semantics according to the grammar structure of the specific language in the process of reading the target test script. For the description of the type of the specific language, the format, the content, etc. of the target test script, reference may be made to the above embodiments, and will not be repeated here.
It should be further noted that, for the specific form and content of the prompt information output in the lexical and semantic parsing process, the embodiment of the present application is not limited, and optionally, the corresponding error reason may be output for the target sentence with lexical and/or semantic errors. Further optionally, on the basis of outputting the error cause, a corresponding modification prompt may be further output, for example, outputting a correct lexical and/or grammatical format, so that the tester can modify according to the modification prompt.
In the embodiment of the present application, the specific form of the target test script is not limited, alternatively, the target test script may be an executable program file that can be directly executed by the Python program, and if the Python program parses the target test script, the parsed target test script may be directly executed by adopting the manner in the above embodiment. Further alternatively, the target test script may be a command file that cannot be directly executed by the Python program, for example, a shell file, and then needs to be converted into executable target program code for execution by the Python program. Alternatively, when the target test script is converted into executable target program code, an object structure corresponding to each operation sentence in the target test script in the executable program and a program object corresponding to each operation name in each operation sentence in the object structure may be determined first. Further, according to the object structures and the program objects, converting each operation sentence and each operation name in the target test script into each program object corresponding to each object structure in the executable program, and obtaining executable target program codes. Therefore, according to the specific development language type, the test script can be correspondingly converted into the target program code which can be read and executed by the development language, the test process can be processed as required, and the flexibility is improved.
In the embodiment of the application, the specific type of the corresponding object structure in the executable program is not limited, alternatively, the corresponding object structure in the executable program can be a JSON object, and according to the above operation, after both lexical and semantic analysis pass, the corresponding relationship between the syntax structure of the special language and the JSON data structure can be determined according to the syntax structure of the special language and the format of the JSON data structure. And converting each operation sentence and the operation name in the target test script into a program object in the JSON data structure according to the corresponding relation to obtain a corresponding intermediate code. Further, the intermediate code is read by using the JSON module of the Python, the intermediate code is converted into a character string in a corresponding JSON format, and the converted character string is written into a corresponding JS file to obtain an executable target program code for the Python program to read.
For example, taking the obtained target test script as the test script generated in the above embodiment as an example, the JSON object in the following format can be obtained through the above conversion operation:
[{
'stepname': 'Step1',
'opts': [{
'comment': '# set_signal on bodycan',
'optname': 'SET_SIGNAL',
'paramsdict': {
'p': {
'paramsdict': {
'a': {
'paramsdict': {},
'paramslist': [2, 3]
}
},
'paramslist': [23, 'm']
},
'timeout': 10
},
'paramslist': ['bodycan', 'messagename', 'signalname', 1]
},{
'comment': '# this line is a comment',
'optname': 'WAIT_SIGNAL',
'paramsdict': {
'paramsdict': {
'c': 10
},
'paramslist': ['a', 'b']
},
'paramslist': ['Flexray', '1-2-3']
}],
},{
'stepname': 'step2',
'opts': [{
'optname': 'CHECK_SERVICE',
'paramsdict': {},
'paramslist': ["{'KEY': 'VAL', 'XXX':23}"],
'var': 'ret'
},{
'optname': 'CHECK',
'paramsdict': {},
'paramslist': ['==', {
'customvars': 'ret'
}, 1]
}],
}], {
'ret': None
}
the content included in the data behind the job action is the job parameter corresponding to the job action, where the 'comment' corresponds to comment information, the 'optname' corresponds to action name, and the 'parameter list corresponding to parameter' can be specifically determined in combination with the test script content in the above example.
In the embodiment of the application, based on the grammar structure corresponding to the special language describing the test case, the test script adapted to each job scene can be automatically generated, the test script comprises operation sentences corresponding to each operation step, each operation sentence comprises operation names corresponding to each operation step and the corresponding operation action, and the operation actions requiring to input the operation parameters and/or output the operation results and the operation names corresponding to the operation parameters and/or the operation results. Based on the above, for the target job scenario with the test requirement, the target test data and the target test script corresponding to the target job scenario can be obtained, and by executing the target test script, the execution result of the target test data under the target job scenario can be checked based on the corresponding relation among the indicated job steps, job actions, job parameters and/or job results, so as to confirm whether the execution result is accurate.
Further, under the condition that the logic error is detected, corresponding prompt information is output for a developer to modify the program code. By means of the method, for a developer, the automatic test of parameters of a professional tester can be achieved without the need of simply executing output data, executing programs and the like according to the test script, so that labor cost can be reduced, accuracy of program codes can be improved, overall test period of project codes before the project codes are on line is shortened, and test efficiency is improved.
It should be noted that, the execution subjects of each step of the method provided in the above embodiment may be the same device, or the method may also be executed by different devices. For example, the execution subject of step S1 to step S4 or P1 to step P5 may be the device a; for another example, the execution subject of step S1 or P1 may be device a, and the execution subject of step S2 to step S4 or P2 to step P5 may be device B; etc.
In addition, in some of the flows described in the above embodiments and the drawings, a plurality of operations appearing in a specific order are included, but it should be clearly understood that the operations may be performed out of the order in which they appear herein or performed in parallel, the sequence numbers of the operations, such as S1, P1, etc., are merely used to distinguish between the various operations, and the sequence numbers themselves do not represent any order of execution. In addition, the flows may include more or fewer operations, and the operations may be performed sequentially or in parallel. It should be noted that, the descriptions of "first" and "second" herein are used to distinguish different messages, devices, modules, etc., and do not represent a sequence, and are not limited to the "first" and the "second" being different types.
Based on the above, the embodiment of the application further provides a computer device, which is configured to execute the test script generating method or the automated test method. Fig. 3 is a schematic structural diagram corresponding to a connection relationship between main functional modules of the computer device, and as shown in fig. 3, the computer device includes: a processor 31 and a memory 32 storing a computer program; wherein the processor 31 and the memory 32 may be one or more.
The memory 32 is mainly used for storing computer programs, and the computer programs can be executed by the processor 31, so that the processor 31 controls the computer device to realize corresponding functions and complete corresponding actions or tasks. In addition to storing computer programs, the memory 32 may also be configured to store various other data to support operations on the computer device. Examples of such data include instructions for any application or method operating on a computer device.
The memory 32 may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
In the embodiment of the present application, the implementation form of the processor 31 is not limited, and may be, for example, but not limited to, a CPU, a GPU, an MCU, or the like. The processor 31 may be regarded as a control system of a computer device operable to execute a computer program stored in the memory 32 for controlling the computer device to perform the respective functions, perform the respective actions or tasks. It should be noted that, depending on the implementation form of the computer device and the scene in which the computer device is located, the functions, actions or tasks to be implemented may be different; accordingly, the computer programs stored in the memory 32 may also vary, and execution of the different computer programs by the processor 31 may control the computer device to perform different functions, perform different actions or tasks.
In some alternative embodiments, as shown in FIG. 3, the computer device may further comprise: the display 33, the power supply component 34, the communication component 35, and other components, the display 33 is used for displaying an on-vehicle graphical user interface. The illustration of only a few components in fig. 3 does not mean that the computer device comprises only the components shown in fig. 3, but that the computer device may also comprise other components for different application requirements, for example, in case of a voice interaction requirement, as shown in fig. 3, the computer device may also comprise an audio component 36. The components that the computer device may include may depend on the product form of the computer device, and are not limited herein.
In an embodiment of the present application, when the processor 31 executes the computer program in the memory 32 to implement the test script generating method, it is used to: acquiring job description information corresponding to a target job scene, wherein the job description information at least comprises an execution sequence among a plurality of job steps and job actions associated with each job step; according to the grammar structure of the special language describing the test case, generating at least an operation name conforming to the grammar structure for each operation step, wherein the operation name is used for describing the operation action associated with the corresponding operation step; for each operation step, generating an operation sentence corresponding to the operation step at least according to an operation name corresponding to the operation step and a sentence ending symbol required by a grammar structure; and generating a target test script corresponding to the target job scene according to the execution sequence among the plurality of job steps and the operation sentences corresponding to the plurality of job steps respectively.
In an alternative embodiment, the job description information further includes necessary job parameters and/or correspondence between job results and job actions, and the processor 31 is further configured to: determining a target operation step associated with necessary operation parameters according to the operation description information, and generating transfer parameters conforming to a grammar structure aiming at operation names corresponding to the target operation step; and/or determining a target job result associated with the target job step according to the job description information, and generating an output parameter conforming to the grammar structure aiming at the operation name corresponding to the target job step.
In an alternative embodiment, the processor 31 is configured to, for each job step, when generating an operation sentence corresponding to the job step according to at least an operation name corresponding to the job step and a sentence terminator required by a grammar structure: and splicing the statement ending symbol required by the operation name, the transmission parameter and/or the output parameter and the grammar structure corresponding to each operation step according to the corresponding relation between the operation action associated with each operation step and the corresponding necessary operation parameter and/or operation result, so as to obtain the corresponding operation statement.
In an alternative embodiment, the processor 31 is configured to, when generating at least an operation name conforming to the syntax structure for each job step according to the syntax structure of the specific language describing the test case: acquiring an execution sequence set for a plurality of job steps and job actions set in association with each job step in response to a first setting operation executed according to the job description information; according to the grammar structure of the special language describing the test case, generating operation names corresponding to each operation step and the associated operation action according to the grammar structure.
In an alternative embodiment, processor 31 is further configured to: acquiring necessary job parameters and/or job results set for each job action in response to a second setting operation performed according to the job description information; according to the grammar structure of the special language describing the test case, generating an operation name corresponding to the necessary operation parameters associated with each operation action conforming to the grammar structure and taking the operation name as a transmission parameter; and/or generating an operation name corresponding to the operation result associated with each operation action conforming to the grammar structure and taking the operation name as an output parameter.
In an embodiment of the present application, when the processor 31 executes the computer program in the memory 32 to implement the automated test method, it is used to: acquiring target test data and a target test script corresponding to a target operation scene, wherein the target test script is generated based on a grammar structure of a special language describing a test case, and comprises a plurality of operation sentences, and each operation sentence at least comprises operation steps in the target operation scene and operation names corresponding to associated operation actions of the operation steps; according to the grammar structure, carrying out grammar and semantic analysis on the target test script, and determining target operation sentences with lexical and/or semantic errors; outputting corresponding prompt information under the condition that the existence of the target operation statement is determined; executing the target test script under the condition that the analysis passes so as to test the target test data; and determining incorrect logic error data and corresponding error reasons in the target test data in the execution process, and outputting the incorrect logic error data and the corresponding error reasons as test results.
In an alternative embodiment, the processor 31 is configured to, when acquiring the target test data and the target test script corresponding to the target job scenario: responding to the executed first selection operation, and acquiring a selected target job scene; and responding to a second selection operation executed for the target job scene, and acquiring the selected target test data and target test script.
In an alternative embodiment, the processor 31, when executing the target test script, is configured to: determining an object structure corresponding to each operation statement in the target test script in the executable program, and a program object corresponding to each operation name in each operation statement in the object structure; and converting each operation statement and operation name corresponding to each operation statement in the target test script into each program object corresponding to each object structure in the executable program according to the object structures and the program objects to obtain executable target program codes.
It should be noted that, for specific functions of the processor in the computer device, reference may be made to the above embodiment of the target test script generation method or the automated test method, which are not described herein again.
Accordingly, embodiments of the present application also provide a computer-readable storage medium storing a computer program/instruction that, when executed, is capable of implementing the steps of the method embodiments described above that are executable by a computer device.
The communication assembly of the above embodiments is configured to facilitate wired or wireless communication between the device in which the communication assembly is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as a mobile communication network of WiFi,2G, 3G, 4G/LTE, 5G, etc., or a combination thereof. In one exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component further comprises a Near Field Communication (NFC) module to facilitate short range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
The display in the above-described embodiments includes a screen, which may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may sense not only the boundary of a touch or slide action, but also the duration and pressure associated with the touch or slide operation.
The power supply assembly in the above embodiment provides power for various components of the device in which the power supply assembly is located. The power components may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the devices in which the power components are located.
The audio component in the above-described fig. embodiments may be configured to output and/or input audio signals. For example, the audio component includes a Microphone (MIC) configured to receive external audio signals when the device in which the audio component is located is in an operational mode, such as a call mode, a recording mode, and a speech recognition mode. The received audio signal may be further stored in a memory or transmitted via a communication component. In some embodiments, the audio assembly further comprises a speaker for outputting audio signals.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that 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 presence of other like elements in a process, method, article or apparatus that comprises the element.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and variations of the present application will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. which come within the spirit and principles of the application are to be included in the scope of the claims of the present application.

Claims (10)

1. A test script generation method, comprising:
acquiring job description information corresponding to a target job scene, wherein the job description information at least comprises an execution sequence among a plurality of job steps and job actions associated with each job step;
generating at least an operation name conforming to the grammar structure for each operation step according to the grammar structure of the special language describing the test case, wherein the operation name is used for describing the operation action associated with the corresponding operation step;
for each operation step, generating an operation sentence corresponding to the operation step at least according to an operation name corresponding to the operation step and a sentence ending symbol required by the grammar structure;
and generating a target test script corresponding to the target job scene according to the execution sequence among the plurality of job steps and the operation sentences corresponding to the plurality of job steps respectively.
2. Method according to claim 1, characterized in that the job description information further comprises necessary job parameters and/or correspondence between job results and job actions, the method further comprising:
determining a target operation step associated with the necessary operation parameters according to the operation description information, and generating transfer parameters conforming to the grammar structure aiming at an operation name corresponding to the target operation step;
and/or the number of the groups of groups,
and determining a target job result associated with a target job step according to the job description information, and generating an output parameter conforming to the grammar structure aiming at an operation name corresponding to the target job step.
3. The method of claim 2, wherein for each job step, generating an operation sentence corresponding to the job step based at least on an operation name corresponding to the job step and a sentence ending character required by the grammar structure, comprises:
and splicing the operation name, the transmission parameter and/or the output parameter corresponding to each operation step and the sentence ending symbol required by the grammar structure according to the corresponding relation between the operation action associated with each operation step and the corresponding necessary operation parameter and/or the operation result, so as to obtain the corresponding operation sentence.
4. A method according to claim 3, wherein generating at least for each job step an operation name conforming to a syntax structure of a specific language describing the test case, comprises:
acquiring an execution sequence set for the plurality of job steps and job actions set in association with each job step in response to a first setting operation executed according to the job description information;
and generating operation names corresponding to each operation step and the associated operation action according to the grammar structure of the special language describing the test case.
5. The method as recited in claim 4, further comprising:
responding to a second setting operation executed according to the job description information, and acquiring necessary job parameters and/or job results set for each job action;
according to a grammar structure of a special language describing the test case, generating an operation name corresponding to a necessary operation parameter associated with each operation action conforming to the grammar structure and taking the operation name as a transmission parameter;
and/or the number of the groups of groups,
and generating an operation name corresponding to the operation result associated with each operation action conforming to the grammar structure and taking the operation name as an output parameter.
6. An automated testing method, comprising:
acquiring target test data and a target test script corresponding to a target operation scene, wherein the target test script is generated based on a grammar structure of a special language describing a test case, and comprises a plurality of operation sentences, and each operation sentence at least comprises operation steps in the target operation scene and operation names corresponding to associated operation actions of the operation steps;
according to the grammar structure, carrying out grammar and semantic analysis on the target test script, and determining target operation sentences with lexical and/or semantic errors;
outputting corresponding prompt information under the condition that the existence of the target operation statement is determined;
executing the target test script to test the target test data under the condition that the analysis passes; and
in the execution process, determining incorrect logic error data and corresponding error reasons in the target test data, and outputting the incorrect logic error data and the corresponding error reasons as test results.
7. The method of claim 6, wherein obtaining target test data and target test scripts corresponding to a target job scenario comprises:
Responding to the executed first selection operation, and acquiring a selected target job scene;
and responding to a second selection operation executed for the target job scene, and acquiring the selected target test data and target test script.
8. The method of claim 7, wherein executing the target test script comprises:
determining an object structure corresponding to each operation statement in the target test script in an executable program, and determining a program object corresponding to each operation name in each operation statement in the object structure;
and according to the object structure and the program object, converting each operation sentence and each operation name in the target test script into each program object corresponding to each object structure in the executable program to obtain executable target program codes.
9. A computer device, comprising: a processor and a memory storing a computer program for implementing the method according to any one of claims 1-8 when said computer program is executed by said processor.
10. A computer readable storage medium storing a computer program/instructions which, when executed by a processor, cause the processor to implement the method of any one of claims 1-8.
CN202310997148.6A 2023-08-09 2023-08-09 Test script generation and test method, equipment and storage medium Active CN116701237B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310997148.6A CN116701237B (en) 2023-08-09 2023-08-09 Test script generation and test method, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310997148.6A CN116701237B (en) 2023-08-09 2023-08-09 Test script generation and test method, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN116701237A true CN116701237A (en) 2023-09-05
CN116701237B CN116701237B (en) 2023-12-29

Family

ID=87834328

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310997148.6A Active CN116701237B (en) 2023-08-09 2023-08-09 Test script generation and test method, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116701237B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190166035A1 (en) * 2017-11-27 2019-05-30 Jpmorgan Chase Bank, N.A. Script accelerate
WO2020231529A1 (en) * 2019-05-16 2020-11-19 Microsoft Technology Licensing, Llc Persistent annotation of syntax graphs for code optimization
CN114185596A (en) * 2021-12-16 2022-03-15 深圳依时货拉拉科技有限公司 Analysis method and device for test script structure and storage medium
WO2022227314A1 (en) * 2021-04-25 2022-11-03 深圳壹账通智能科技有限公司 Method and apparatus for dynamic synchronous testing, device, and storage medium
CN115543831A (en) * 2022-10-20 2022-12-30 中科方德软件有限公司 Test script generation method, device, equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190166035A1 (en) * 2017-11-27 2019-05-30 Jpmorgan Chase Bank, N.A. Script accelerate
WO2020231529A1 (en) * 2019-05-16 2020-11-19 Microsoft Technology Licensing, Llc Persistent annotation of syntax graphs for code optimization
WO2022227314A1 (en) * 2021-04-25 2022-11-03 深圳壹账通智能科技有限公司 Method and apparatus for dynamic synchronous testing, device, and storage medium
CN114185596A (en) * 2021-12-16 2022-03-15 深圳依时货拉拉科技有限公司 Analysis method and device for test script structure and storage medium
CN115543831A (en) * 2022-10-20 2022-12-30 中科方德软件有限公司 Test script generation method, device, equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
JUNZAN ZHOU, ET AL: "Automated Model-Based Performance Testing for PaaS Cloud Services", 2014 IEEE 38TH INTERNATIONAL COMPUTER SOFTWARE AND APPLICATIONS CONFERENCE WORKSHOPS *

Also Published As

Publication number Publication date
CN116701237B (en) 2023-12-29

Similar Documents

Publication Publication Date Title
JP7371141B2 (en) Tools and methods for real-time dataflow programming languages
CN107506300B (en) User interface testing method, device, server and storage medium
CN110013672B (en) Method, device, apparatus and computer-readable storage medium for automated testing of machine-run games
CN110825431B (en) Interface document processing method, device, system, storage medium and electronic equipment
CN113900958A (en) Test case script generation method, system, medium and electronic device
CN110716853A (en) Test script recording method, application program testing method and related device
US11288064B1 (en) Robotic process automation for interactive documentation
KR101722856B1 (en) Apparatus for test plc using programming language
CN102479152A (en) Method and device for obtaining tool automatic test results on basis of Android platform
CN108664247B (en) Page template data interaction method and device
CN108491323A (en) A kind of embedded software automatization test system and method based on Lua scripts
CN115904989A (en) Interface testing method, device, equipment and readable storage medium
CN114356434B (en) Page loading method, device, apparatus, storage medium and program product
CN110837467B (en) Software testing method, device and system
CN116701237B (en) Test script generation and test method, equipment and storage medium
CN106297791B (en) Whole-process voice implementation method and system
KR20110019508A (en) A test and history management system for mobile station applications using test libraries and the method thereof
CN111736924B (en) Method, device, equipment and medium for accessing data acquisition instrument based on Lua script
CN114385128A (en) Data processing method, device, apparatus, storage medium and program product
CN112069057A (en) Code testing method, device, apparatus and storage medium
Gunawan Keyword Recorder for Robot Framework
CN113051173B (en) Method, device, computer equipment and storage medium for arranging and executing test flow
CN113703769B (en) CLI command execution method and related device
JP2012212286A (en) Program development tool
CN117348848A (en) Operator development and processing method and device, electronic equipment, system and storage medium

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