A performance testing method, device, electronic device and storage medium

By converting interface automation test cases into performance test scripts, the high cost problem in the test preparation stage in the existing technology is solved, efficient performance testing is achieved, the testing scope is expanded, and the accurate evaluation of system performance and software quality is ensured.

CN113127364BActive Publication Date: 2024-12-20INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110445587.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-23
Publication Date
2024-12-20
Estimated Expiration
2041-04-23

AI Technical Summary

Technical Problem

The existing performance testing tools have high thresholds and time and labor costs for the preparation of test scripts and data preparation in the test preparation stage, especially in large-scale testing.

Method used

By obtaining interface automation test cases, converting them into performance test scripts, and conducting unattended performance tests, using existing interface automation case assets, reducing testing costs and expanding test scenarios.

Benefits of technology

It greatly reduces the implementation cost of performance testing, expands the protection scope of test scenarios, and ensures accurate evaluation of system performance and software product quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113127364B_ABST
    Figure CN113127364B_ABST
Patent Text Reader

Abstract

The present disclosure provides a performance testing method, which includes: obtaining an interface automation test case, detecting changes in the interface automation test case, running the interface automation test case with changes, obtaining a method for testing a successfully running interface automation test case with changes, converting the method for testing a successfully running interface automation test case with changes into an interface performance test script, obtaining parameters required for running the performance test script, integrating the parameters to obtain a performance test scenario, running the performance test script in the performance test scenario, and completing the performance test. The application of this method can significantly reduce the implementation cost of performance testing and expand the scope of performance testing scenario protection, which is of great significance for accurately evaluating system performance capacity and ensuring software product quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to a performance testing method, device, electronic device and storage medium. Background Art

[0002] The performance test implementation process usually includes five stages: requirements analysis, test preparation, test execution, result analysis and tuning, and test report and summary. The requirements analysis stage includes the analysis of the system under test, business situation collection, performance requirements assessment, etc. The test preparation stage also includes test environment preparation, test scenario design, test script preparation, test data preparation, etc. The main task of the test execution stage is to complete the various scenario tests involved in the test scenario. It is divided into performance testing under manual monitoring and unattended performance testing. The main work of the result analysis and tuning stage is to analyze the operation results and optimize the problems found. The test report is the final result of the performance test, which clarifies whether the performance meets the requirements and whether there are performance risks.

[0003] In the overall performance testing process, the test script preparation and test data preparation in the test preparation phase are the main bottlenecks that restrict the expansion of the performance testing protection scope. Performance testing tools usually support two methods to complete the test script: recording and playback and script writing. Either method has a certain threshold and consumes a lot of time and manpower.

[0004] At present, the performance testing in the industry requires recording or writing test scripts for each test transaction scenario and preparing corresponding data, which is time-consuming and labor-intensive for large-scale testing. At the same time, interface automation testing is relatively popular in the industry, and a large number of interface automation script resources have been accumulated.

[0005] Public Content

[0006] 1. Technical issues to be resolved

[0007] In view of the above-mentioned deficiencies in the prior art, the main purpose of the present disclosure is to provide a performance testing method, device, electronic device and storage medium, in order to at least partially solve at least one of the above-mentioned technical problems.

[0008] (II) Technical solution

[0009] In order to achieve the above object, according to one aspect of the present disclosure, a performance testing method is provided, the method comprising:

[0010] Get interface automation test cases;

[0011] Obtain a test method for testing the above interface automation test case;

[0012] Convert the above test interface automation test case method into a performance test script;

[0013] Run the above performance test script to complete the performance test.

[0014] Preferably, before the above method for obtaining the test interface automated test case, the performance testing method further includes:

[0015] Detect changes in the above interface automation test cases;

[0016] Run automated test cases for interfaces with changes.

[0017] Preferably, the method for obtaining an automated test case for a test interface specifically includes:

[0018] Obtain the interface automation test cases that have been successfully run and have changed;

[0019] A method for obtaining a test case for the interface automation with changes that successfully runs the above test;

[0020] And obtain the running dependency information of the interface automation test case with changes that has been successfully run.

[0021] Preferably, the above-mentioned interface automation test cases with changes in operation specifically include:

[0022] Rewrite the assertion information of the interface automation test cases that have changed;

[0023] The interface automation test case that rewrites the assertion information is run, and if the interface automation test case that rewrites the assertion information fails to run, the interface automation test case that failed to run is marked.

[0024] Preferably, the performance testing method further comprises:

[0025] Get the parameters required to run the above performance test script;

[0026] The above parameters are integrated to obtain the performance test scenario.

[0027] Preferably, the method of converting the test interface automation test case into a performance test script specifically includes:

[0028] Create a Java request class;

[0029] In the above-mentioned JaVa request class, Java code is organized according to the above-mentioned method for testing the above-mentioned interface automation test case with changes that has been successfully run, and the operation dependency information of the above-mentioned interface automation test case with changes that has been successfully run, to obtain a performance test script;

[0030] Generate a first file according to the above performance test script;

[0031] A second file is generated by combining the above performance test script and the above performance test scenario.

[0032] Preferably, running the performance test script to complete the performance test specifically includes:

[0033] The performance test script is run according to the first file and the second file to complete the performance test.

[0034] Preferably, the performance testing method further comprises:

[0035] The running results of the above performance test script are displayed in a preset format.

[0036] Preferably, the above-mentioned detection of changes in the above-mentioned interface automation test cases specifically includes:

[0037] The MD5 value of the interface automation test case is detected, and the change of the interface automation test case is determined according to the change of the MD5 value.

[0038] In another aspect, the present disclosure provides a performance testing device, the device comprising:

[0039] The first acquisition module is used to acquire interface automation test cases;

[0040] The second acquisition module is used to acquire a method for testing the above interface automation test case;

[0041] A conversion module, used to convert the method for testing the above interface automation test case into a performance test script;

[0042] The test module is used to run the above performance test script to complete the performance test.

[0043] Preferably, the performance test device also includes:

[0044] A detection module, used to detect changes in the above interface automation test cases;

[0045] The above detection module is also used to run interface automation test cases with changes.

[0046] Preferably, the performance test device also includes:

[0047] The display module is used to display the running results of the above performance test script in a preset form.

[0048] In another aspect, the present disclosure provides an electronic device, the electronic device comprising:

[0049] A communicator, used to communicate with the server;

[0050] processor;

[0051] A memory stores a computer executable program, which, when executed by the processor, enables the processor to execute the performance testing method.

[0052] On the other hand, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, characterized in that the computer program implements the above-mentioned performance testing method when executed by a processor.

[0053] (III) Beneficial effects

[0054] The performance testing method provided by the present disclosure fully utilizes existing interface automation case assets, converts interface automation cases into performance testing scripts and scenarios, and performs unattended performance testing.

[0055] The application of the performance testing method provided by the present invention can significantly reduce the implementation cost of performance testing and expand the scope of performance testing scenarios, which is of great significance for accurately evaluating system performance capacity and ensuring the quality of software products. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.

[0057] Figure 1 A schematic diagram of a performance testing method provided by an embodiment of the present disclosure is shown;

[0058] Figure 2 A schematic diagram of a flow chart of a method for obtaining an automated test case for a test interface provided by an embodiment of the present disclosure is shown;

[0059] Figure 3 A schematic diagram of a method for converting a method for testing an interface automation test case into an interface performance test script and running the performance test script to complete a performance test provided by an embodiment of the present disclosure is shown;

[0060] Figure 4 A block diagram of a performance testing device provided by an embodiment of the present disclosure is schematically shown;

[0061] Figure 5A schematic diagram showing an application scenario of a performance testing method and a performance testing device provided by an embodiment of the present disclosure;

[0062] Figure 6 A block diagram of an electronic device implementing a performance testing method provided according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0063] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.

[0064] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0065] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.

[0066] In the case of using expressions such as "at least one of A, B, and C, etc.", it should generally be interpreted in accordance with the meaning of the expression generally understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but not be limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.). In the case of using expressions such as "at least one of A, B, or C, etc.", it should generally be interpreted in accordance with the meaning of the expression generally understood by those skilled in the art (for example, "a system having at least one of A, B, or C" should include but not be limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.). Those skilled in the art should also understand that any transitional conjunctions and / or phrases that substantially indicate two or more optional items, whether in the specification, claims, or drawings, should be understood to give the possibility of including one of these items, either of these items, or both of these items. For example, the phrase "A or B" should be understood to include the possibilities of "A" or "B", or "A and B".

[0067] Some block diagrams and / or flow charts are shown in the accompanying drawings. It should be understood that some blocks or combinations thereof in the block diagrams and / or flow charts may be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that these instructions, when executed by the processor, may create a device for implementing the functions / operations described in these block diagrams and / or flow charts.

[0068] Therefore, the technology of the present disclosure can be implemented in the form of hardware and / or software (including firmware, microcode, etc.). In addition, the technology of the present disclosure can take the form of a computer program product on a computer-readable medium storing instructions, which can be used by an instruction execution system or in combination with an instruction execution system. In the context of the present disclosure, a computer-readable medium can be any medium that can contain, store, transmit, propagate, or transmit instructions. For example, a computer-readable medium can include, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, device, or propagation medium. Specific examples of computer-readable media include: magnetic storage devices, such as magnetic tapes or hard disks (HDDs); optical storage devices, such as compact disks (CD-ROMs); memories, such as random access memories (RAMs) or flash memory; and / or wired / wireless communication links.

[0069] Performance testing is to test the performance indicators of the system by simulating various normal, peak and abnormal load conditions through automated testing tools. The performance test in this article refers to the concurrent testing of the system's performance indicators under normal load conditions.

[0070] A performance testing script refers to the test code recorded or written according to the requirements of the performance testing tool and the test data used.

[0071] Performance test scenarios refer to the execution methods of performance test scripts determined according to actual business conditions and test purposes, including the number of virtual users, user loading speed, user loading gradient, request interval requirements, and script running time.

[0072] Figure 1 A schematic diagram of a performance testing method provided by an embodiment of the present disclosure is shown as follows: Figure 1 As shown, the performance testing method includes:

[0073] S101, obtain interface automation test cases;

[0074] S102, obtaining a method for testing the above interface automation test case;

[0075] S103, converting the above method of testing the interface automation test case into a performance test script;

[0076] S104: Run the above performance test script to complete the performance test.

[0077] Figure 2 The following is a schematic diagram showing a flow chart of a method for obtaining an automated test case for a test interface provided by an embodiment of the present disclosure. Figure 2 As shown, the method includes:

[0078] S201, detecting changes in the above interface automation test cases;

[0079] In an embodiment of the present disclosure, by comparing the MD5 values ​​of the interface automation test cases, the change of the interface automation test cases is determined according to the comparison result of the MD5 values.

[0080] S202, rewriting the assertion information of the interface automation test case with changes;

[0081] S203, running the interface automation test case that rewrites the assertion information, if the interface automation test case that rewrites the assertion fails to run, marking the interface automation test case that failed to run;

[0082] In one embodiment of the present disclosure, interface automation test cases that fail to run are marked, so that the marked interface automation test cases can be removed when the interface automation test cases are subsequently parsed to obtain the test method and running dependency information, thereby avoiding converting the test method of the interface automation test case that fails to run into a performance test script, which causes the performance test script to fail to run.

[0083] S204, parsing the interface automation test case that runs successfully after rewriting the assertion information, and obtaining a method for testing the interface automation test case that runs successfully but has changes.

[0084] Assertions are programming terms that represent some Boolean expressions. When writing code, we always make some assumptions, and assertions are used to capture these assumptions in the code. The programmer believes that the expression value is true at a certain point in the program. Assertions can be enabled and disabled at any time, so assertions can be enabled during testing and disabled during deployment. Similarly, after the program is put into operation, the end user can re-enable assertions when encountering problems.

[0085] In one embodiment of the present disclosure, by parsing a successfully executed interface automation test case, the execution method, execution steps, test data, assertion information, and execution dependency information in the interface automation test case code are obtained.

[0086] Figure 3 The following schematically shows a flow chart of a method for converting a test interface automation test case into a performance test script and running the performance test script to complete a performance test, as shown in FIG. Figure 3 As shown, the method includes:

[0087] S301, obtaining parameters required for running the performance test script;

[0088] In one embodiment of the present disclosure, the parameters required for running the performance test script are stored in a global configuration file.

[0089] In this embodiment, the request URL, interface request type, test database configuration, and service interface registration center information of the interface to be tested for performance are also obtained, and the request URL, interface request type, test database configuration, and service interface registration center information of the interface to be tested for performance are also stored in the global configuration file.

[0090] S302, integrating the above parameters to obtain a performance test scenario;

[0091] S303, creating a Java request class, organizing Java code in the Java request class according to the method of the interface automation test case with changes that was successfully tested and the operation dependency information of the interface automation test case with changes that was successfully tested, to obtain a performance test script;

[0092] S304, generating a first file according to the performance test script and the running dependency information of the successfully run interface automation test case with changes;

[0093] S305: Generate a second file by combining the above performance test script and the above performance test scenario.

[0094] In one embodiment of the present disclosure, the method of testing an interface automation test case is converted into a performance test script, and the steps of running the performance test script to complete the performance test are as follows:

[0095] (1) Create a Java request class as a performance test script;

[0096] (2) In the above Java request class, the Java code is organized according to the method of testing the interface automation test case and the running dependency information of the interface automation test case to obtain a performance test script;

[0097] The above Java code includes four methods: ① request to create a method that requires parameters (public Arguments getDefaultParameters); ② request to initialize the method public void setupTest (JavaSamplerContext arg0); ③ request to execute the loop method public SampleResult runTest (JavaSamplerContext arg0); ④ request to end the method public void teardownTest (JavaSamplerContext arg0);

[0098] (3) compile the Java request class obtained in (2), and package the compiled Java request class to generate a first file;

[0099] In this embodiment, the first file is in the form of a .jar package.

[0100] (4) combining the above performance test scenario and the content of the performance test script, generating a second file required for running the performance test script;

[0101] The performance test script is run according to the first file and the second file to complete the performance test.

[0102] In an embodiment of the present disclosure, jmeter executes the performance test script so that the performance test script runs automatically according to the performance test scenario requirements. In this embodiment, the second file is in the form of a .jmx file.

[0103] In one embodiment of the present disclosure, the running result of the above performance test script in the above performance test scenario is displayed. In this embodiment, the running result of the performance test script in the performance test scenario is displayed in the form of a web page.

[0104] Figure 4 A block diagram of a performance testing device provided by an embodiment of the present disclosure is schematically shown. Figure 4 As shown, the device includes: a first acquisition module 401, a second acquisition module 402, a conversion module 403, and a testing module 404.

[0105] The first acquisition module 401 is used to acquire interface automation test cases;

[0106] The second acquisition module 402 is used to acquire a test method for testing the above interface automation test case;

[0107] A conversion module 403, used to convert the method for testing the above interface automation test case into a performance test script;

[0108] The testing module 404 is used to run the above performance testing script to complete the performance testing.

[0109] The first acquisition module 401 is further used to: acquire the parameters required for running the performance test script; and integrate the parameters to obtain a performance test scenario.

[0110] The above performance testing device also includes:

[0111] The detection module 405 includes: an update check module 4051 , an availability check module 4052 and a conversion configuration module 4053 .

[0112] The update check module 4051 is used to detect changes in the above interface automation test cases.

[0113] The availability check module 4052 is used to rewrite the assertion information of the interface automation test case with changes, and run the interface automation test case with the rewritten assertion information.

[0114] The conversion configuration module 4053 is used to record and store the running results of the interface automation test cases that rewrite the assertion information, and mark the interface automation test cases that failed to run.

[0115] The conversion module 403 is also used to obtain the interface automation test case whose running result is successful by the availability check module 4052, as well as the method for testing the interface automation test case whose running result is successful, and the running dependency information of the interface automation test case whose running result is successful.

[0116] The display module 406 is used to display the running result of the above performance test script in a preset form.

[0117] Figure 5The following schematically shows an application scenario diagram of a performance testing method and a performance testing device provided by an embodiment of the present disclosure. Figure 5 As shown, in one embodiment of the present disclosure, the process of performing performance testing by the performance testing device is as follows:

[0118] The first acquisition module 401 is used to obtain interface automation test cases, parameters required for running performance test scripts, request URLs of interfaces to be tested, interface request types, test database configurations, and service-oriented interface registration center information;

[0119] It is also used to store the parameters required for running the performance test script, the request URL of the interface to be tested, the interface request type, the test database configuration, and the service interface registration center information in the global configuration file.

[0120] An update check module 4051 is used to obtain the interface automation test case from the first acquisition module 401;

[0121] It is also used to detect changes in interface automation test cases by comparing their MD5 values.

[0122] Availability check module 4052, used to obtain the interface automation test cases with changes from the update check module 4051;

[0123] It is also used to rewrite the assertion information of interface automation test cases with changes based on the open source TestNG automation running framework;

[0124] It is also used to verify the running results of interface automation test cases that rewrite assertion information, and mark interface automation test cases that fail to run.

[0125] The conversion configuration module 4053 is used to read the running results of all the interface automation test cases with changes from the above-mentioned availability check module 4052, and record and store the running results;

[0126] It is also used to mark failed interface automation test cases so that the marked failed interface automation test cases can be eliminated in the subsequent process of converting the test method into a performance test script.

[0127] The conversion module 403 is used to read the successfully executed interface automation test cases from the detection module 405 .

[0128] The second acquisition module 402 is used to parse the successfully executed interface automation case read by the conversion module 403, and acquire the method for testing the interface automation test case and the operation dependency information of the interface automation test case.

[0129] The conversion module 403 is also used to create a Java request class as a performance test script;

[0130] It is also used to organize the Java code in the above Java request class according to the test method and the running dependency information to obtain the performance test script;

[0131] The above Java code includes four methods: ① request to create a method that requires parameters (public Arguments getDefaultParameters); ② request to initialize the method public void setupTest (JavaSamplerContext arg0); ③ request to execute the loop method public SampleResult runTest (JavaSamplerContext arg0); ④ request to end the method public void teardownTest (JavaSamplerContext arg0);

[0132] It is also used to compile the Java request class obtained above, and package the compiled Java request class to generate a first file;

[0133] In this embodiment, the first file is in the form of a .jar package.

[0134] It is also used to combine the above performance test scenario and the content of the performance test script to generate a second file required for running the performance test script.

[0135] The test module 404 is used to use the exec method of the Runtime class of java to drive jmeter to execute the performance test script according to the first file and the second file, and make the performance test script run automatically according to the requirements of the performance test scenario.

[0136] The display module 406 is used to obtain the running result of the performance test script by the above-mentioned test module 404, and display the running result of the performance test script in the form of a web page.

[0137] According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits, or at least part of the functions of any one of them can be implemented in one module. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be split into multiple modules for implementation. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be at least partially implemented as hardware circuits, such as field programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems on chips, systems on substrates, systems on packages, application specific integrated circuits (ASICs), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, according to the embodiments of the present invention, one or more of the modules, submodules, units, and subunits can be at least partially implemented as computer program modules, and when the computer program modules are run, the corresponding functions can be performed.

[0138] For example, any multiple of the first acquisition module 401, the second acquisition module 402, the conversion module 403, the test module 404, the detection module 405 and the display module 406 can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the first acquisition module 401, the second acquisition module 402, the conversion module 403, the test module 404, the detection module 405 and the display module 406 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or by any one of the three implementation methods of software, hardware and firmware or by a suitable combination of any of them. Alternatively, at least one of the first acquisition module 401, the second acquisition module 402, the conversion module 403, the test module 404, the detection module 405 and the display module 406 can be at least partially implemented as a computer program module, and when the computer program module is executed, the corresponding function can be executed.

[0139] Figure 6 A block diagram of an electronic device suitable for implementing the method described above according to an embodiment of the present disclosure is schematically shown. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0140] like Figure 6 As shown, the electronic device includes:

[0141] A communicator 610, used for communicating with a server;

[0142] Processor 620;

[0143] The memory 630 stores a computer executable program, which includes the performance test method described above.

[0144] According to an embodiment of the present disclosure, the electronic device 600 may further include an input / output (I / O) interface, which is also connected to the bus. The electronic device 600 may also include one or more of the following components connected to the I / O interface: an input part including a keyboard, a mouse, etc.; an output part including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage part including a hard disk, etc.; and a communication part including a network interface card such as a LAN card, a modem, etc. The communication part performs communication processing via a network such as the Internet. The drive is also connected to the I / O interface as needed. Removable media, such as disks, optical disks, magneto-optical disks, semiconductor memories, etc., are installed on the drive as needed so that the computer program read therefrom is installed into the storage part as needed.

[0145] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part, and / or installed from a removable medium. When the computer program is executed by a processor, the above-mentioned functions defined in the system of an embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.

[0146] The processor 620 may include, for example, a general-purpose microprocessor, an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 620 may also include an onboard memory for cache purposes. The processor 620 may be a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0147] The memory 630 may be, for example, any medium capable of containing, storing, conveying, propagating or transmitting instructions. For example, a readable storage medium may include, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared or semiconductor system, device, component or propagation medium. Specific examples of readable storage media include: a magnetic storage device, such as a magnetic tape or a hard disk (HDD); an optical storage device, such as a compact disk (CD-ROM); a memory, such as a random access memory (RAM) or flash memory; and / or a wired / wireless communication link. It stores a computer executable program, which, when executed by the processor, causes the processor to perform the method of performance testing as described above.

[0148] The present disclosure also provides a computer-readable storage medium on which a computer program is stored, and the program includes the method of performance testing as described above. The computer-readable storage medium may be included in the device / equipment described in the above embodiment; or it may exist alone without being assembled into the device / equipment. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.

[0149] According to an embodiment of the present disclosure, a computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, optical cable, radio frequency signal, etc., or any suitable combination of the above.

[0150] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0151] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.

[0152] Although the present disclosure has been shown and described with reference to specific exemplary embodiments of the present disclosure, it should be understood by those skilled in the art that various changes in form and details may be made to the present disclosure without departing from the spirit and scope of the present disclosure as defined by the appended claims and their equivalents. Therefore, the scope of the present disclosure should not be limited to the above-mentioned embodiments, but should be determined not only by the appended claims, but also by the equivalents of the appended claims.

Claims

1. A performance testing method, characterized in that: include: Get interface automation test cases; A method for obtaining automated test cases for testing the interface; Converting the method of testing the interface automation test case into a performance test script; Run the performance test script to complete the performance test; The method for obtaining the automated test case for testing the interface specifically includes: Obtain the interface automation test cases that have been successfully run and have changed; A method for obtaining a method for testing the interface automation test case that has been successfully run and has changed; and obtaining the running dependency information of the successfully run interface automation test case with changes; The performance testing method also includes: Obtaining parameters required for running the performance test script; Integrate the parameters to obtain a performance test scenario; The method of converting the test interface automation test case into a performance test script specifically includes: Create a Java request class; Organizing Java code in the Java request class according to the method of testing the successfully executed interface automation test case with changes and the operation dependency information of the successfully executed interface automation test case with changes to obtain a performance test script; Generate a first file according to the performance test script; A second file is generated by combining the performance test script and the performance test scenario.

2. The performance testing method according to claim 1, characterized in that: Before obtaining the method for testing the interface automation test case, the performance testing method further includes: Detecting changes in the interface automation test cases; Run automated test cases for interfaces with changes.

3. The performance testing method according to claim 2, characterized in that: The interface automation test cases with changes in operation specifically include: Rewrite the assertion information of the interface automation test cases that have changed; The interface automation test case that rewrites the assertion information is run, and if the interface automation test case that rewrites the assertion information fails to run, the failed interface automation test case is marked.

4. The performance testing method according to claim 1, characterized in that: The running of the performance test script to complete the performance test specifically includes: The performance test script is run according to the first file and the second file to complete the performance test.

5. The performance testing method according to claim 4, characterized in that: The performance testing method also includes: The running results of the performance test script are displayed in a preset format.

6. The performance testing method according to claim 2, characterized in that: The detecting changes of the interface automation test cases specifically includes: The MD5 value of the interface automation test case is detected, and the change of the interface automation test case is determined according to the change of the MD5 value.

7. A performance testing device, characterized in that: include: The first acquisition module is used to acquire interface automation test cases; The second acquisition module is used to acquire a method for testing the interface automation test case, including: acquiring a successfully executed interface automation test case with changes; acquiring a method for testing the successfully executed interface automation test case with changes; and acquiring operation dependency information of the successfully executed interface automation test case with changes; A conversion module, used for converting the method of testing the interface automation test case into a performance test script; The first acquisition module is also used to obtain the parameters required for the performance test script to run; integrate the parameters to obtain a performance test scenario; the conversion module converts the method of testing the interface automation test case into a performance test script, including: creating a Java request class; organizing Java code in the Java request class according to the method of testing the interface automation test case with changes that runs successfully and the operation dependency information of the interface automation test case with changes that runs successfully, to obtain a performance test script; generating a first file according to the performance test script; and generating a second file by combining the performance test script and the performance test scenario; The test module is used to run the performance test script to complete the performance test.

8. The performance testing device according to claim 7, characterized in that: The performance testing device also includes: A detection module, used to detect changes in the interface automation test cases; The detection module is also used to run interface automation test cases with changes.

9. The performance testing device according to claim 7, characterized in that: The performance testing device also includes: The display module is used to display the running results of the performance test script in a preset form.

10. An electronic device, characterized in that: The electronic device comprises: A communicator, used to communicate with the server; processor; A memory storing a computer executable program, which, when executed by the processor, enables the processor to execute the performance testing method as described in any one of claims 1 to 6.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the performance testing method as described in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Automated test assertion method and device, storage medium and equipment

    CN108614770A

  • Software automation unit test method based on TestNG

    CN111459821A

  • Interface automatic test method and device, computer equipment and storage medium

    CN112052182A