CN117112408A - Method, device and medium for generating automatic test case script - Google Patents
Method, device and medium for generating automatic test case script Download PDFInfo
- Publication number
- CN117112408A CN117112408A CN202310983525.0A CN202310983525A CN117112408A CN 117112408 A CN117112408 A CN 117112408A CN 202310983525 A CN202310983525 A CN 202310983525A CN 117112408 A CN117112408 A CN 117112408A
- Authority
- CN
- China
- Prior art keywords
- test case
- test
- text
- script
- automatic test
- 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
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 229
- 238000013515 script Methods 0.000 title claims abstract description 65
- 238000000034 method Methods 0.000 title claims abstract description 47
- 230000004044 response Effects 0.000 claims description 13
- 238000004891 communication Methods 0.000 claims description 10
- 238000013461 design Methods 0.000 claims description 9
- 230000008569 process Effects 0.000 claims description 7
- 238000004590 computer program Methods 0.000 claims description 6
- 238000004422 calculation algorithm Methods 0.000 claims description 4
- 239000003999 initiator Substances 0.000 claims description 3
- 238000005457 optimization Methods 0.000 claims description 3
- 238000004364 calculation method Methods 0.000 claims description 2
- 230000002708 enhancing effect Effects 0.000 claims description 2
- 230000011218 segmentation Effects 0.000 claims description 2
- 238000006243 chemical reaction Methods 0.000 description 30
- 230000006870 function Effects 0.000 description 12
- 230000009471 action Effects 0.000 description 3
- 239000003086 colorant Substances 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 238000012550 audit Methods 0.000 description 2
- 238000011990 functional testing Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000010998 test method Methods 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 230000008676 import Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 239000008833 migu Substances 0.000 description 1
- 230000006855 networking Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/12—Use of codes for handling textual entities
- G06F40/151—Transformation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/166—Editing, e.g. inserting or deleting
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Quality & Reliability (AREA)
- Computer Hardware Design (AREA)
- Debugging And Monitoring (AREA)
Abstract
The application relates to a method, a device and a medium for generating an automatic test case script; the method comprises the following steps: generating an automatic test script by using the text test case; converting the product requirement into a text test case; generating an automatic test script by interface requirements; the text case is converted into an automatic test case, and is suitable for converting the manual case of the service type into the automatic test case; the product requirement is converted into a text test case, a visio flow chart of a service can be used as input, a corresponding test case can be automatically generated, the generated test case comprises various branches, and 100% coverage is achieved for all branch cases; for the automatic test cases of the interface test, the automatic test cases with multiple branches are generated according to the data types, the data value ranges and the like, so that the stability of the interface is enhanced.
Description
Technical Field
The application belongs to the technical field of automatic test, and relates to a method, a device and a medium for generating an automatic test case script.
Background
At present, the main work of testers is to improve the efficiency and quality of test in the aspects of document test cases according to requirements and later multi-round test execution, and the problems are solved in the two aspects. The solution is basically to replace manual work by automation.
The current automatic test cases are manually written by testers or obtained in a recording mode, and the reference basis is based on the manual functional test cases in any mode. The automatic test case in the mode needs professional testers to write and maintain the automatic test script, so that a plurality of project groups are greatly hindered when breakthrough of automatic test zero is realized.
At present, manual functional test cases are converted into automatic test cases through programs, the cases are mainly subjected to interface tests, have great requirements on writing formats of the test cases and input semantics, are not applicable, are universal and are not extensible, and meanwhile, the biggest obstacle is insufficient accuracy, and the automatic test cases after modification and optimization are needed to be carried out by inputting manpower.
Disclosure of Invention
The application solves the problems that:
1. current state of the art vehicle systems: the manual test cases are particularly many (tens of thousands), the software needs are changed more, the released version is particularly frequent, and the quality requirement on the system is particularly high.
In-vehicle system can put into a lot of manpower to test and verify, if the conventional mode is used for writing automatic test case scripts for tens of thousands of test case scripts, the cost of writing scripts and the cost of maintaining scripts are also very high, and a manual mode for all people may not be suitable yet.
According to the application, the automatic test case script can be quickly generated according to the manual test case, the efficiency is low in the early stage, but the more intelligent the model is, the higher the efficiency is along with the gradual increase of samples for manual examination.
2. At present, when a tester performs test manual case design, the personal capability of the tester is relied on, and the test case cannot cover all demand branches due to the fact that the individual capability is not strong and the test design is missing, and particularly a special abnormal scene is formed. This can result in occasional anomalies when used by the end user.
Aiming at a vehicle-mounted system, a vehicle networking system, an interface design document, a test design method, a boundary value and an orthogonal experiment method, and the characteristics of vehicle machine and vehicle network service data are combined to automatically generate an automatic test case, so that the coverage comprehensiveness of the test case is ensured.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, 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.
In order to solve the technical problems, the application is realized by adopting the following technical scheme:
a method for generating an automated test case script, comprising:
generating an automatic test script by using the text test case;
converting the product requirement into a text test case;
the interface requirements generate an automated test script.
Further, the text test case generates an automatic test script; the method specifically comprises the following steps:
firstly, uploading text test case files including two formats of excel and word by a tester;
secondly, analyzing the file, and converting the content in excel into a text test case in a memory after analysis;
thirdly, respectively obtaining a test step and an expected result for each text test case;
converting the test step and the expected result to generate an automatic test case script;
and finally, converting all the text test cases in all the text test case files into automatic test case scripts, displaying the automatic test case scripts to a foreground interface, manually editing by a tester, and storing changed contents into background data as historical data for analysis.
Further, the product requirement is converted into a text test case, which specifically includes:
firstly, uploading a document VISIO format of product requirements by a tester;
secondly, analyzing a document for uploading the product requirement by using a COM component; the analysis process is as follows:
firstly, node information of a flow chart is obtained, if the node type is a judgment type, a logic expression in the node is analyzed, a logic relation in the expression is divided into a non-divided state and a non-divided state, each specific sub-condition respectively generates a text test case, the name of the text test case must contain a condition, and a tester knows a corresponding service through the name of the test case; if the converted text test case has no actual business meaning, the tester deletes the generated test case;
if the node type is a 'flow type', converting into a corresponding testing step according to the position in the flow, and directly reading text content of the node and converting into the content of the testing step.
And finally, traversing the whole document, generating all text test cases, and correcting the text test cases by a tester.
Further, converting the test steps and the expected results of the text test case by using an intelligent algorithm to generate an automatic test case script;
firstly, obtaining a test step and an expected result of a text test case;
secondly, extracting keywords from the test step and the expected result respectively by using the Jieba segmentation;
thirdly, matching and similarity calculation are carried out by using the extracted keywords to a keyword component configuration table, and scoring is carried out;
finally, the semantic meaning with the highest score is selected as the converted semantic meaning.
Further, the keyword component configuration table is self-optimized, as the number of people used increases, the data converted before are analyzed, including re-extracting keywords and dynamically adjusting the weights of related keywords, the optimized keyword component configuration table is re-operated, the data converted before are re-operated, and the weights are re-adjusted according to the operation result. Optimizing to the conversion success rate of more than 90 percent.
Further, the interface requirements generate an automated test script; the method specifically comprises the following steps:
firstly, uploading interface specification documents and word formats by testers, and analyzing by using COM components;
secondly, analyzing a protocol of a communication layer, wherein the currently supported protocol comprises HTTP, HTTPS, FTP, TCP, UDP;
analyzing the formats of the initiator message and the local message, wherein the currently supported formats comprise an XML format, a JSON format, a 16-system format and a file format;
finally, editing and enhancing the generated automatic test script by the testers.
Further, the request message and the response message are analyzed, and the request message and the response message are generated according to the corresponding types;
generating test data according to the information such as the type, the length and the like of the field;
the data types currently providing common service fields include:
the mobile phone number type can provide 11 mobile phone numbers (mobile number segment, connected number segment, etc.);
the identity card provides 18 bits of data conforming to the format;
and for the data of the character string type, generating a corresponding character string according to the boundary value design method.
Further, all field information of the request message is analyzed, possible values of the fields are obtained according to the field type attribute, and all conditions of the service are arranged and combined. The orthogonal test method is used, so that the maximum test coverage rate is ensured by using the minimum test data set, and the robustness and stability of the interface are ensured.
An apparatus, comprising: one or more processors;
a memory for storing one or more programs;
and when the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the method for generating the automated test case script.
A computer-readable storage medium having stored thereon a computer program, characterized by: the program, when executed by the processor, implements the method for generating an automated test case script.
Compared with the prior art, the application has the beneficial effects that:
1. the text case is converted into an automatic test case, and the automatic test case is applicable to the manual case conversion of the business type.
2. The software requirements defined by the product are converted into text test cases, a visio flow chart of the service can be used as input, corresponding test cases can be automatically generated, the generated cases contain various branches, and 100% coverage is achieved for all branch cases.
3. For the automatic test cases of the interface test, the automatic test cases with multiple branches are generated according to the data types, the data value ranges and the like, so that the stability of the interface is enhanced.
Drawings
The application is further described below with reference to the accompanying drawings:
FIG. 1 is a diagram showing the conversion of product requirements into text test cases;
FIG. 2 is a flow chart of an automated test script for text test case generation;
FIG. 3 is a detailed flow chart of the test step transition in the text test case generation automation test script;
FIG. 4 is a flow chart of an automated test script for interface demand generation;
FIG. 5 is a detailed flowchart of the steps for parsing an initiator message format in an interface requirements generation automation test script;
FIG. 6 is a flow chart of a method for generating an automated test case script in accordance with the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application become more apparent, the technical solutions in the embodiments of the present application will be described in more detail below with reference to the accompanying drawings in the embodiments of the present application. In the drawings, the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The described embodiments are some, but not all, embodiments of the application. The embodiments described below by referring to the drawings are illustrative and intended to explain the present application and should not be construed as limiting 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. Embodiments of the present application will be described in detail below with reference to the accompanying drawings.
In the description of the present application, it should be understood that the terms "center," "longitudinal," "lateral," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, merely to facilitate describing the present application and simplify the description, and do not indicate or imply that the devices or elements being referred to must have a specific orientation, be configured and operated in a specific orientation, and therefore should not be construed as limiting the scope of the present application.
The application is described in detail below with reference to the attached drawing figures:
the demand documents of the current products include two types of demands, business function type and interface type.
If the test case is of a service function requirement type, the function in the application can be used for converting the service function requirement of the product into test cases of texts, and the generated test cases of the texts need to be modified and added with other text test cases on the basis of generating the text test cases due to the characteristics of the service, and finally the text test cases are converted into test case scripts of functional automation by using the application.
If the interface type requirement is the interface type requirement, the interface requirement is automatically converted into an interface automation test script through the application.
Referring to fig. 6, the method for generating an automated test case script according to the present application includes:
generating an automatic test script by using the text test case;
converting the product requirement into a text test case;
the interface requirements generate an automated test script.
1. Referring to fig. 1, text generates an automated test script:
the application provides a template file, wherein the template file contains operations of a user as far as possible, so that a tester can design the case through a downloading template and the template, and the recognition accuracy of the case is improved. And after the automatic test script language conversion is carried out, the credibility of the conversion result of each step is marked by using colors on an interface, and the more green the credibility is, the more red the credibility is, the less the credibility is. And correcting the automatic test script and maintaining the test data by the tester according to the color label of the conversion result.
For the steps with smaller credibility, the steps are uniformly input into intelligent conversion manual audit data, and the steps are associated with components by manpower; for the generated automation case step, the platform records the adjustment content of the tester for the generated automation test case step.
The background use case intelligent algorithm regularly analyzes according to the result of manual auditing and the adjustment content of the automatically generated use case recorded by the platform record testers, extracts keywords, adds the keywords into a keyword component configuration table, regenerates a model, converts a previous imported file by using a newly-created use case intelligent conversion model to generate a new automatic test case, compares the newly-generated use case with the manually-modified use case, calculates the accuracy of the model, and continues to optimize and adjust if the accuracy does not reach the standard. In this way, the situation can be matched with the corresponding assembly later, and the probability of error is reduced.
The method supports the importing of Chinese test cases, can analyze the contents of the Chinese test cases, intelligently generates basic automatic test cases, realizes the automatic conversion between the natural language test cases and the automatic cases, and finally completes the writing of the automatic test cases in cooperation with manual verification. Case content import: the function of the text content importing platform of the Chinese test case is supported, and the case content accords with the format specification filled in according to the steps. The case contents at least comprise step serial numbers and step case content analysis: and (3) rapidly analyzing each step description statement according to the content of the test step, and searching out the corresponding key content of the test operation.
Case content analysis: each step description statement can be rapidly analyzed according to the content of the test step, and the corresponding key content of the test operation is searched, for example: "modify IS_COMPRESS field of database FILE_TYPE_CONF with sql statement:
the update_type_confsetis_expression= 'true' wherefile_type= '3' and file_type_name= 'substract/boss' form_type_name= 'substract/migu'; the file core is restarted. The testing step of the method can search out two key testing operations, namely, modifying a database by using sql sentences and restarting a file core.
Generating a basic automation case: related test function components corresponding to each operation can be found according to the searched test operation key content, and the components are referenced according to the test operation sequence, so that an automatic test case conforming to the scene is generated. For example, the searched key test operation "modify database using sql statement" can automatically reference the component of "update Oracle database data" and "restart file core" can automatically reference the functional component of "restart service process".
The tester uploads the test file in the specified format (supporting word format and excel format), and the COM component is used to parse the text file.
The intelligent conversion module analyzes the file and splits the file into a plurality of test cases.
The testing steps and the expected results in the file are converted into an automatic testing script language, and the differences of styles and the like of the documents written by the blind persons are large, so that after the automatic testing script language conversion is carried out, the credibility of the conversion results of each step is marked by colors on an interface, and the larger the credibility of green description is, the smaller the credibility of red is.
And matching the extracted keywords with data in the keyword component configuration table, if the matching is not completed, calculating the text similarity, returning to a component with the closest similarity (the set threshold is 80), after obtaining the component, carrying out reflection processing on the realization class of the component in the built configuration library, generating an automatic test script according to input, and if any matched component is not present, directly returning to the blank, and manually writing the script by a tester.
And the steps which cannot be matched are uniformly input into intelligent conversion manual audit data, the steps are associated with components by manual work, a background module analyzes the steps according to manual feedback results, keywords are extracted and added into a keyword component configuration table, and the corresponding components can be matched later under the condition.
And correcting the automatic test script and maintaining the test data by the tester according to the color label of the conversion result.
After correcting the automatic test cases, the testers submit the automatic test cases to the automatic test platform to run the cases.
2. Referring to fig. 2 and 3, the product requirements are converted into test cases:
the intelligent conversion module of the test case can convert a tester into the test case according to the VISIO file, and the tester can carry out corresponding editing (including modification and deletion) according to the actual service.
The input VISIO flow chart may select an overlay mode, including: sentence coverage, judgment coverage, condition coverage, judgment condition coverage, condition combination coverage and path coverage, and automatically generating test cases. Generating test cases includes test case key fields for expected inputs, expected outputs, and the like.
And uploading the service flow chart by the tester, analyzing the text file by using the COM component in the VISIO format.
The intelligent conversion module analyzes the file to obtain the node.
The intelligent conversion module analyzes according to the type of the node:
if the node type is the judgment type, analyzing a logic expression in the node, and splitting or not splitting a logic relation in the expression, wherein each specific sub-condition respectively generates a test case, and the names of the test cases must contain conditions, so that the tester can know the corresponding service through the test case names. If the converted test case has no actual business meaning, the tester can delete the generated test case.
If the node type is a 'flow type', converting into a corresponding testing step (directly reading text content of the node and converting into content of the testing step) according to the position in the flow, and submitting the testing case to a platform after correcting the functional testing case by a tester.
3. Referring to fig. 4 and 5, the interface requirements generate an automated test script;
the intelligent conversion module of the test case can convert the interface document, the preset message header, the message content and the message format into an automatic interface test case.
The interface file is input, the message header, the message content and the message format are defined, and the test case and the test message can be automatically generated. Generating test cases includes test case key fields for expected inputs, expected outputs, and the like.
And uploading an interface specification document, word format and analyzing the text file by using the COM component by a tester.
The intelligent conversion module analyzes the word document, and matches and analyzes the initiating interface and the corresponding response interface.
And analyzing the request message and the response message, and respectively calling related components to package the request message and the response message according to the message format and the communication format. The message components currently provided include: XML component, JSON component, 16 system components and file component, communication assembly includes: HTTP client component, HTTP server component, TCP client component, TCP server component, UDP client component, UDP server component, and FTP component. If other types of message and communication components are encountered in the interface, the system supports a plug-in mode, and other developers can use the components by uploading jar files for realizing the specific interface.
Analyzing the request message and the response message, and generating the request message and the response message according to the corresponding types;
and generating test data according to the information such as the type, the length and the like of the field. The intelligent conversion module provides data of common service fields.
For example:
the mobile phone number type can provide 11 mobile phone numbers (mobile number segment, connected number segment, etc.);
the identity card provides 18 bits of data conforming to the format;
the province provides a province name or a province code according to the length.
The vehicle VIN code information can generate vehicle type information and automatically generate VIN codes;
and for the data of the character string type, generating a corresponding character string according to the boundary value design method.
The intelligent conversion module generates an automatic test case, and the automatic test case is displayed on an interface, so that a tester can conduct fine adjustment. Meanwhile, the intelligent conversion module provides an auxiliary data generation function, provides a plurality of sets of data for one automation interface according to information such as field types and the like, and completes testing of a plurality of business processes.
The interface is composed of message information and communication protocol, the intelligent conversion module provides information components and communication components, the information components provided at present include: XML component, JSON component, 16 system components and file component, communication assembly includes: HTTP client component, HTTP server component, TCP client component, TCP server component, UDP client component, UDP server component, and FTP component. If other types of message and communication components are encountered in the interface, the system supports a plug-in mode, and other developers can use the components by uploading jar files for realizing the specific interface.
The intelligent conversion module reads the requester message.
If the message is in the XML format, the XML component is called, the file is parsed, the message is generated, and the expected result of the XML is to check whether the response format meets the requirements of the protocol specification by using the XSD.
If the message is in the JSON format, the JSON component is called, the file is analyzed, the message is generated, and meanwhile, the expected result of JSON is that whether the response format meets the requirements of the protocol specification is checked by using the JSON schema.
If the message is in 16-system format, calling 16-system component, analyzing file, generating message, at the same time, the expected result of 16-system is to analyze response according to the specification, if every field of response can be analyzed, it is considered successful, otherwise it is failed.
And generating test data according to the information such as the type, the length and the like of the field. The intelligent conversion module provides data of common service fields, for example, the mobile phone number type can provide 11-bit mobile phone numbers (mobile number section and other carrier number sections), the identity card provides 18-bit data conforming to the format, and the province provides a province name or a province code according to the length.
The device comprises the following steps:
1. the tester uploads test files (supporting word and excel formats) in the specified format.
2. The intelligent conversion module analyzes the file and splits each use case in the file.
3. Analyzing the test procedure and the expected result.
4. The testing steps and the expected results in the file are converted into the automatic testing script language, and the differences of styles and the like of writing the file by different personnel are large, so that after the automatic testing script language conversion is carried out, the credibility of the conversion result of each step is marked by using colors on an interface, and the larger the credibility of green description is, the smaller the credibility of red is.
5. And correcting the automatic test script and maintaining the test data by the tester according to the color label of the conversion result.
6. And after correcting the automatic test cases, the testers submit the automatic test cases to the automatic test platform to run the automatic test cases.
In the application, the automatic test script of the interface type is generated, and the special meanings of the field type and the field category are combined, so that the full-coverage automatic test script of the interface can be generated, and a powerful support can be provided for the stability and the robustness of the system.
According to the application, the text is manually used for converting into the automatic test script, the problem of conversion of the device can be corrected in a manual auditing mode, the background can record contents before and after manual auditing, and the contents can be periodically synchronized to the model to serve as sample data for model self-optimization.
According to the application, the manual function test cases can be generated rapidly by the requirement document of the product, and after adjustment, the automatic test case script is generated, so that the left shift of the test of the DevOps is well supported.
In the application, the communication protocol for Internet of vehicles and Internet of things application comprises TCP, UDP, HTTPS, HTTPS, MQTT and CAN support.
Based on the method for generating the script of the automatic test case, the application provides another device. Devices include, but are not limited to: one or more processors and memory.
The memory is used as a computer readable storage medium for storing software programs, computer executable programs and modules, such as program instructions corresponding to the methods in the embodiments of the present application. The processor executes various functional applications and data processing by running software programs, instructions and modules stored in the memory, namely, the method for generating the automated test case script is realized.
The memory may mainly include a memory program area and a memory data area, wherein the memory program area may store an operating system, at least one application program required for a function; the storage data area may store data created according to the use of the terminal, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device.
The present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method of generating an automated test case script, referring to fig. 6, the method comprising the steps of:
step one, generating an automatic test script by using a text test case;
step two, converting the product requirement into a test case;
step three, generating an automatic test script by interface requirements;
the computer-readable storage medium provided by the present application, whose computer-executable instructions are not limited to the method operations described above, may also perform the related operations in the method provided by any of the embodiments of the present application.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in accordance with embodiments of the present application are produced in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable devices. The computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital subscriber line, DSL), or wireless (e.g., infrared, wireless, microwave, etc.). Computer readable storage media can be any available media that can be accessed by a computer or data storage devices, such as servers, data centers, etc., that contain an integration of one or more of the available media. The usable medium may be a magnetic medium (e.g., a floppy Disk, a hard Disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a Solid State Disk, SSD), etc.
In the above embodiment, the included units and modules are only divided according to the functional logic, but not limited to the above division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the present application.
The foregoing is merely illustrative of specific embodiments of the present application, and the scope of the application is not limited thereto, but any modifications, equivalents, improvements and alternatives falling within the spirit and principles of the present application will be apparent to those skilled in the art within the scope of the present application. And all that is not described in detail in this specification is well known to those skilled in the art.
Claims (10)
1. A method for generating an automated test case script, comprising:
generating an automatic test script by using the text test case;
converting the product requirement into a text test case;
the interface requirements generate an automated test script.
2. A method according to claim 1, characterized in that:
the text test case generates an automatic test script; the method specifically comprises the following steps:
firstly, uploading text test case files including two formats of excel and word by a tester;
secondly, analyzing the file, and converting the content in excel into a text test case in a memory after analysis;
thirdly, respectively obtaining a test step and an expected result for each text test case;
converting the test step and the expected result to generate an automatic test case script;
and finally, converting all the text test cases in all the text test case files into automatic test case scripts, displaying the automatic test case scripts to a foreground interface, manually editing by a tester, and storing changed contents into background data as historical data for analysis.
3. A method according to claim 1, characterized in that:
the product requirement is converted into a text test case, which specifically comprises the following steps:
firstly, uploading a document VISIO format of product requirements by a tester;
secondly, analyzing a document for uploading the product requirement by using a COM component; the analysis process is as follows:
firstly, node information of a flow chart is obtained, if the node type is a judgment type, a logic expression in the node is analyzed, a logic relation in the expression is divided into a non-divided state and a non-divided state, each specific sub-condition respectively generates a text test case, the name of the text test case must contain a condition, and a tester knows a corresponding service through the name of the test case; if the converted text test case has no actual business meaning, the tester deletes the generated test case;
if the node type is a 'flow type', converting into a corresponding testing step according to the position in the flow, and directly reading text content of the node and converting into the content of the testing step.
And finally, traversing the whole document, generating all text test cases, and correcting the text test cases by a tester.
4. A method according to claim 3, characterized in that:
converting the test steps and the expected results of the text test cases by using an intelligent algorithm to generate an automatic test case script;
firstly, obtaining a test step and an expected result of a text test case;
secondly, extracting keywords from the test step and the expected result respectively by using the Jieba segmentation;
thirdly, matching and similarity calculation are carried out by using the extracted keywords to a keyword component configuration table, and scoring is carried out;
finally, the semantic meaning with the highest score is selected as the converted semantic meaning.
5. A method according to claim 4, characterized in that:
the keyword component configuration table is self-optimized, and as the number of people used increases, the data which are converted in advance and are wrong are analyzed, wherein the analysis comprises the steps of extracting keywords again and dynamically adjusting the weights of related keywords, the keyword component configuration table after optimization, the data converted in advance are rerun, and the weights are readjusted according to the operation result.
6. A method according to claim 1, characterized in that:
the interface requirement generates an automatic test script; the method specifically comprises the following steps:
firstly, uploading interface specification documents and word formats by testers, and analyzing by using COM components;
secondly, analyzing a protocol of a communication layer, wherein the currently supported protocol comprises HTTP, HTTPS, FTP, TCP, UDP;
analyzing the formats of the initiator message and the local message, wherein the currently supported formats comprise an XML format, a JSON format, a 16-system format and a file format;
finally, editing and enhancing the generated automatic test script by the testers.
7. A method according to claim 6, characterized in that:
analyzing the request message and the response message, and generating the request message and the response message according to the corresponding types;
generating test data according to the information such as the type, the length and the like of the field;
the data types currently providing common service fields include:
the mobile phone number type can provide 11 mobile phone numbers;
the identity card provides 18 bits of data conforming to the format;
and for the data of the character string type, generating a corresponding character string according to the boundary value design method.
8. A method according to claim 6, characterized in that:
analyzing all field information of the request message, obtaining possible values of the fields according to the field type attribute, and arranging and combining all conditions of the service.
9. An apparatus, characterized in that: comprising the following steps: one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-8.
10. A computer-readable storage medium having stored thereon a computer program, characterized by: the program, when executed by a processor, implements the method of any of claims 1-8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310983525.0A CN117112408A (en) | 2023-08-07 | 2023-08-07 | Method, device and medium for generating automatic test case script |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310983525.0A CN117112408A (en) | 2023-08-07 | 2023-08-07 | Method, device and medium for generating automatic test case script |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117112408A true CN117112408A (en) | 2023-11-24 |
Family
ID=88793895
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310983525.0A Pending CN117112408A (en) | 2023-08-07 | 2023-08-07 | Method, device and medium for generating automatic test case script |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117112408A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117573567A (en) * | 2024-01-17 | 2024-02-20 | 易方信息科技股份有限公司 | Method and related device for automatically generating UI (user interface) automation test cases |
CN117971705A (en) * | 2024-03-28 | 2024-05-03 | 成都九洲电子信息***股份有限公司 | Intelligent interface automatic test system and method based on customized flow insight |
-
2023
- 2023-08-07 CN CN202310983525.0A patent/CN117112408A/en active Pending
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117573567A (en) * | 2024-01-17 | 2024-02-20 | 易方信息科技股份有限公司 | Method and related device for automatically generating UI (user interface) automation test cases |
CN117573567B (en) * | 2024-01-17 | 2024-05-17 | 易方信息科技股份有限公司 | Method and related device for automatically generating UI (user interface) automation test cases |
CN117971705A (en) * | 2024-03-28 | 2024-05-03 | 成都九洲电子信息***股份有限公司 | Intelligent interface automatic test system and method based on customized flow insight |
CN117971705B (en) * | 2024-03-28 | 2024-06-25 | 成都九洲电子信息***股份有限公司 | Intelligent interface automatic test system and method based on customized flow insight |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111522816B (en) | Data processing method, device, terminal and medium based on database engine | |
US11321421B2 (en) | Method, apparatus and device for generating entity relationship data, and storage medium | |
CN117112408A (en) | Method, device and medium for generating automatic test case script | |
US9753977B2 (en) | Method and system for managing database | |
US20150026556A1 (en) | Systems and Methods for Extracting Table Information from Documents | |
US11281864B2 (en) | Dependency graph based natural language processing | |
EP3671526B1 (en) | Dependency graph based natural language processing | |
CN113220782A (en) | Method, device, equipment and medium for generating multivariate test data source | |
CN111414735A (en) | Text data generation method and device | |
US9984107B2 (en) | Database joins using uncertain criteria | |
CN108694172B (en) | Information output method and device | |
CN112948419A (en) | Query statement processing method and device | |
CN117667841A (en) | Enterprise data management platform and method | |
US10229105B1 (en) | Mobile log data parsing | |
US10824587B2 (en) | Integrated universal file converter | |
CN116578700A (en) | Log classification method, log classification device, equipment and medium | |
CN115146070A (en) | Key value generation method, knowledge graph generation method, device, equipment and medium | |
CN115687717A (en) | Method, device and equipment for acquiring hook expression and computer readable storage medium | |
CN115292347A (en) | Active SQL algorithm performance checking device and method based on rules | |
CN114519071A (en) | Generation method, matching method, system, device and medium of rule matching model | |
CN107220249A (en) | Full-text search based on classification | |
CN115599976B (en) | User grouping method, device, electronic equipment and storage medium | |
CN116681042B (en) | Content summary generation method, system and medium based on keyword extraction | |
EP3944127A1 (en) | Dependency graph based natural language processing | |
CN112799638B (en) | Non-invasive rapid development method, platform, terminal 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 |