Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Test file generation method and system, server and storage medium

A technology for testing files and files, which is applied in the computer field, can solve problems such as boring work, difficult maintenance of use cases, incomplete testing functions, etc., and achieve the effect of reducing development costs and saving script writing time

Pending Publication Date: 2020-04-28
深圳市朱墨科技有限公司
View PDF6 Cites 4 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Since manually written scripts cannot form a certain test case reuse
[0003] When performing performance testing by manually writing scripts, it is necessary to rewrite new locust files based on relevant data such as interface information, interface parameters, and performance request ratios each time, which cannot better meet the needs of the testing team for agile performance testing, but The following problems will appear during the testing process. For example, the number of interfaces is huge, and writing automated test cases for interfaces will consume a lot of human resources, and the writing of similar interface use cases is basically copy-pasted and then adaptively modified. The work is relatively boring. In addition, when the interface When the document writing is relatively simple and the code logic description is incomplete, the manual communication cost of writing automated test cases will be very high. Finally, due to the deviation of the script style and test focus written by different testers, it will cause difficulty in use case maintenance and incomplete test functions. At the same time, it takes a lot of time to manually generate the corresponding locust executable file because of the complexity and diversity of performance test scenarios, the construction of test parameters, and the reading structure.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Test file generation method and system, server and storage medium
  • Test file generation method and system, server and storage medium
  • Test file generation method and system, server and storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0052] figure 1A flow chart of a method for generating a test file provided by Embodiment 1 of the present invention. This embodiment takes locust developed based on the Python language as an example. The technical solutions of this embodiment and the following embodiments can also be applied to other test files that can be tested. The programming language of the use case and the corresponding open source performance testing tools.

[0053] Specifically include the following steps:

[0054] S101. Read the interface information from the database;

[0055] The interface information in this step is parameter information for generating the simulation request. Exemplarily, the interface information includes but not limited to csv parameters, interface dependency identifiers and / or assertion functions, etc., which may be one or more of them. The interface information is read from a database of the test platform, and the database includes different interface information based on di...

Embodiment 2

[0077] Such as figure 2 As shown, this embodiment provides a method for generating a test file, and refines the steps of the file test method in the above embodiment, specifically as follows:

[0078] S201. Read interface information from a database.

[0079] S202. Convert the interface information into a dictionary object.

[0080] Since python cannot directly serialize objects, for ordinary python objects, it is necessary to return the instance attributes of the instance objects of the class in the form of a dictionary, which is simply used to store instance variables. This step is added in this embodiment, and the non-serialized dictionary object can be parsed to return the interface dictionary object.

[0081] Dictionary object Dictionary object is a variable container model, and can store any type of object. Each key-value (key=>value) pair of the dictionary is separated by a colon, and each pair is separated by a comma. The entire dictionary is included in curly brac...

Embodiment 3

[0113] Such as image 3 As shown, this embodiment provides a test file generation system 3 that can execute the test file generation method provided by the above embodiments of the present invention, and has corresponding functional modules and beneficial effects for executing the method.

[0114] Specifically include:

[0115] The data acquisition module 301 is configured to read interface information from a database.

[0116] The first generating module 302 is configured to generate a first template based on the csv parameters.

[0117] The second generation module 303 is configured to generate a second template based on the interface dependency identifier.

[0118] The third generation module 304 is configured to generate a third template based on the assertion verification.

[0119] The splicing module 305 is configured to splice the first template, the second template and / or the third template to generate a test script file.

[0120] Such as Figure 4 As shown, in an...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a test file generation method that comprises the steps of reading interface information from a database; generating a first template based on the csv parameter; generating a second template based on the interface dependence identifier; generating a third template based on the assertion verification; and splicing the first template, the second template and / or the third template to generate a test script file. According to the method and the system of the invention, the template is set, and the locust file execution script is automatically generated according to the interface information and the template, so that the interface information, the interface parameters, the performance weight and the interface test task can be conveniently multiplexed, the locust script file is automatically generated, and a performance scene test in a certain range is carried out. The working efficiency of interface data testing, performance scene designing and script editing is effectively improved, and the effects of reducing development cost and saving script maintenance time are achieved.

Description

technical field [0001] The embodiment of the present invention relates to the field of computer technology, in particular to a method, system, server and storage medium for generating a test file. Background technique [0002] Usually, when people use the Locust open source performance testing tool for related performance testing, it is necessary for the tester to manually write the locust script file according to the test scenario, related interfaces, and parameterization. Since manually written scripts cannot form a certain test case reuse. [0003] When performing performance testing by manually writing scripts, a new locust file needs to be rewritten every time based on relevant data such as interface information, interface parameters, and performance request proportions, which cannot better meet the needs of the testing team for agile performance testing, but The following problems will appear during the testing process. For example, the number of interfaces is huge, a...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F11/36
CPCG06F11/3684
Inventor 候金汐
Owner 深圳市朱墨科技有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products