Test method, device, electronic device and computer readable medium

By dividing parameters into fixed parameters and configurable parameters, generating target requests and conducting automated testing, the problem of heavy workload in testing business scenarios in the existing technology is solved, and automated testing and cost savings are achieved.

CN112597047BActive Publication Date: 2024-10-29上海瑞家信息技术有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011603021.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-29
Publication Date
2024-10-29
Estimated Expiration
2040-12-29

AI Technical Summary

Technical Problem

The existing technology needs to traverse all policy types when testing various business scenarios, resulting in a huge workload, time-consuming and labor-intensive, and it is difficult to implement targeted testing.

Method used

By dividing parameters into fixed parameters and configurable parameters, determine the access address, fixed parameters and configurable parameters according to the target business scenario, generate target requests, and generate test result information based on the request results and expected results to achieve automated testing.

Benefits of technology

It realizes automated testing of various business scenarios, saves testing costs, can simulate different business scenarios, reduces the need for settings in each scenario, and improves testing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112597047B_ABST
    Figure CN112597047B_ABST
Patent Text Reader

Abstract

The embodiments of the present disclosure disclose a test method, an apparatus, an electronic device, and a computer-readable medium. A specific implementation of the method includes: in response to the type of the currently executed test case being a test case corresponding to the target business scenario, obtaining the access address of the service corresponding to the test case in the target business scenario; respectively obtaining the fixed parameters and configurable parameters of the test case; assembling the access address, fixed parameters, and configurable parameters to generate a target request; based on the type, access address, fixed parameters, and configurable parameters of the test case, obtaining the expected result corresponding to the target request; sending the target request to the service corresponding to the service to obtain the request result corresponding to the target request; generating test result information based on the matching of the request result and the expected result. This implementation realizes automated testing for various business scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to the field of computer technology, and in particular to a testing method, an apparatus, an electronic device, and a computer-readable medium. Background Art

[0002] In various business scenarios, it is necessary to test strategies composed of different cycles, input conditions, etc. Generally speaking, testers are required to traverse all strategy types to verify different combinations. However, this testing method requires testers to traverse all strategy types, which is a huge workload and time-consuming. Summary of the invention

[0003] The content of this disclosure is used to introduce concepts in a brief form, and these concepts will be described in detail in the specific implementation section below. The content of this disclosure is not intended to identify the key features or essential features of the technical solution for which protection is sought, nor is it intended to limit the scope of the technical solution for which protection is sought. Some embodiments of the present disclosure propose testing methods, devices, electronic devices, and computer-readable media to solve one or more of the technical problems mentioned in the above background technology section.

[0004] In a first aspect, some embodiments of the present disclosure provide a testing method, which includes: in response to the type of a currently executed test case being a test case corresponding to a target business scenario, obtaining an access address of a service corresponding to the test case in the target business scenario; respectively obtaining fixed parameters and configurable parameters of the test case, wherein the fixed parameters and the configurable parameters are determined based on the target business scenario, the values ​​of the configurable parameters are target variables to be verified that change under the target business scenario, and the fixed parameters are environment variables set corresponding to the target variables to be verified under the target business scenario; assembling the access address, fixed parameters and configurable parameters to generate a target request; based on the type of the test case, the access address, the fixed parameters and the configurable parameters, obtaining the expected result corresponding to the target request; sending the target request to the server corresponding to the service to obtain the request result corresponding to the target request; and generating test result information based on the matching of the request result and the expected result.

[0005] In a second aspect, some embodiments of the present disclosure provide a testing device, comprising: an address acquisition unit, configured to obtain an access address of a service corresponding to the test case in the target business scenario in response to the type of the test case currently being executed being a test case corresponding to a target business scenario; a parameter acquisition unit, configured to respectively obtain fixed parameters and configurable parameters of the test case, wherein the fixed parameters and the configurable parameters are determined based on the target business scenario, the values ​​of the configurable parameters are target variables to be verified that change under the target business scenario, and the fixed parameters are environment variables set corresponding to the target variables to be verified under the target business scenario; an assembling unit, configured to assemble the access address, fixed parameters and configurable parameters to generate a target request; an expected result acquisition unit, configured to obtain an expected result corresponding to the target request based on the type of the test case, the access address, fixed parameters and configurable parameters; a sending unit, configured to send the target request to the server corresponding to the service to obtain a request result corresponding to the target request; and a generating unit, configured to generate test result information according to the matching of the request result and the expected result.

[0006] In a third aspect, some embodiments of the present disclosure provide an electronic device comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation manner of the above-mentioned first aspect.

[0007] In a fourth aspect, some embodiments of the present disclosure provide a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method described in any implementation manner of the above-mentioned first aspect is implemented.

[0008] The above-mentioned embodiments of the present disclosure have the following beneficial effects: Automated testing for various business scenarios is achieved. In this process, by dividing the parameters into fixed parameters and configurable parameters, various business scenarios can be simulated to achieve targeted testing of variables, without the need to perform corresponding settings in each business scenario, thereby saving testing costs. For example, for housing applications, users make evaluations after viewing a house or making an appointment to view a house, including evaluations of the house and the personnel. For these different business scenarios, they can all be achieved by configuring relevant parameters, without the need to write separate test cases. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that components and elements are not necessarily drawn to scale.

[0010] Figure 1 is a schematic diagram of an application scenario of the testing method according to some embodiments of the present disclosure;

[0011] Figure 2 is a flow chart of some embodiments of the testing method according to the present disclosure;

[0012] Figure 3 is a flow chart of other embodiments of the testing method according to the present disclosure;

[0013] Figure 4 is a schematic diagram of the structure of some embodiments of the testing device according to the present disclosure;

[0014] Figure 5 It is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure. DETAILED DESCRIPTION

[0015] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0016] It should also be noted that, for ease of description, only the parts related to the invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present disclosure can be combined with each other.

[0017] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0018] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0019] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0020] The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0021] Figure 1 It is a schematic diagram of an application scenario of the testing method according to some embodiments of the present disclosure.

[0022] like Figure 1 As shown, in response to the type of the currently executed test case 102 being a test case corresponding to the target business scenario, the computing device 101 may obtain an access address 103 (URL) of a service corresponding to the test case in the target business scenario.

[0023] Then, the computing device 101 obtains the fixed parameters 104 and configurable parameters 105 of the test case respectively, wherein the fixed parameters and the configurable parameters are determined based on the target business scenario, the value of the configurable parameter is the target variable to be verified that changes under the target business scenario, and the fixed parameter is the environment variable set corresponding to the target variable to be verified under the target business scenario.

[0024] On this basis, the computing device 101 can assemble the access address 103, the fixed parameter 104 and the configurable parameter 105 to generate the target request 106. Then, based on the type of the test case, the access address, the fixed parameter and the configurable parameter, the expected result 107 corresponding to the target request is obtained. The target request 106 is sent to the service end 108 corresponding to the service to obtain the request result 109 corresponding to the target request. According to the matching of the request result 109 and the expected result 107, the test result information 110 is generated.

[0025] It is understandable that the computing device 101 can be hardware or various software. When it is hardware, it can be various electronic devices with information processing capabilities, including but not limited to smart phones, tablet computers, e-book readers, laptop portable computers and desktop computers, etc. When it is software, it can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules for providing distributed services, for example, or it can be implemented as a single software or software module. No specific limitation is made here.

[0026] Continue to refer Figure 2 , shows a process 200 according to some embodiments of the test method of the present disclosure. The test method comprises the following steps:

[0027] Step 201 , in response to the type of the currently executed test case being a test case corresponding to a target business scenario, obtaining an access address of a service corresponding to the test case in the target business scenario.

[0028] In some embodiments, the execution subject of the test method may first determine whether the type of the test case currently being executed is a test case corresponding to the target business scenario. The determination of the target business scenario may be obtained by specifying or by screening certain conditions. For example, the target business scenario may be a housing review scenario, a real housing verification scenario, and so on. Thus, targeted testing of the target business scenario may be achieved. In practice, the identification information contained in the test case may be used to determine whether the type of the test case is a test case corresponding to the target business scenario.

[0029] On this basis, in response to the type of the currently executed test case being a test case corresponding to the target business scenario, the access address of the service corresponding to the test user case in the target business scenario can be obtained from the database. As an example, in the business scenario of testing a fully authentic house, it is necessary to test the price of the house (the fake house generally deviates greatly from the market price). At this time, the service for testing the price can be called to complete the price test.

[0030] Step 202, respectively obtain fixed parameters and configurable parameters of the test case.

[0031] In some embodiments, fixed parameters and configurable parameters are determined based on the target business scenario. The value of the configurable parameter is the target variable to be verified that changes in the target business scenario, and the fixed parameter is the environment variable set corresponding to the target variable to be verified in the target business scenario.

[0032] As an example, in a business scenario where real house sources are tested, fixed parameters and configurable parameters are different depending on the test content. For example, real house source tests include price tests, description tests, real image tests, etc., which are used to test whether the price, description, and image are real. At this time, for the price test, the configurable parameter is the price, and the other parameters are fixed parameters. For the description test, the configurable parameter is the description, and the other parameters are fixed parameters. Therefore, by configuring fixed parameters and configurable parameters, the test of the target variable can be implemented in a targeted manner to prevent inaccurate testing due to the inability to control a single variable.

[0033] Optionally, the configurable parameters include at least one of the following: service type information, user behavior data, terminal information, and user attribute information. In practice, the configurable parameters can be configured accordingly according to actual needs.

[0034] Step 203: Assemble the access address, fixed parameters and configurable parameters to generate a target request.

[0035] In some embodiments, the execution entity may assemble the access address, fixed parameters, and configurable parameters according to a certain protocol to obtain a target request.

[0036] Step 204, based on the type, access address, fixed parameters and configurable parameters of the test case, obtain the expected result corresponding to the target request.

[0037] In some embodiments, the execution entity may query the database for the corresponding expected result based on the type, access address, fixed parameters, and configurable parameters of the test case.

[0038] Step 205: Send the target request to the server corresponding to the service to obtain a request result corresponding to the target request.

[0039] Step 206: Generate test result information based on the matching of the request result and the expected result.

[0040] In some embodiments, as an example, if the request result matches the expected result, test result information indicating that the test has passed may be generated. Conversely, if the request result does not match the expected result, test result information indicating that the test has not passed may be generated.

[0041] In some embodiments, automated testing for various business scenarios is implemented. In this process, by dividing the parameters into fixed parameters and configurable parameters, various business scenarios can be simulated to achieve targeted testing of variables, without the need to perform corresponding settings in each business scenario, thereby saving testing costs. For example, for housing applications, users make evaluations after viewing a house or making an appointment to view a house, including evaluations of the house and the personnel. For these different business scenarios, they can all be implemented by configuring relevant parameters, without the need to write separate test cases.

[0042] Further references Figure 3 , which shows a process 300 of another embodiment of the test method. The process 300 of the test method includes the following steps:

[0043] Step 301 , in response to the type of the currently executed test case being a test case corresponding to a target business scenario, obtaining an access address of a service corresponding to the test case in the target business scenario.

[0044] Step 302, respectively obtain the fixed parameters and configurable parameters of the test case, wherein the fixed parameters and the configurable parameters are determined based on the target business scenario, the value of the configurable parameter is the target variable to be verified that changes under the target business scenario, and the fixed parameter is the environment variable set corresponding to the target variable to be verified under the target business scenario.

[0045] Step 303: Assemble the access address, fixed parameters and configurable parameters to generate a target request.

[0046] Step 304, based on the type, access address, fixed parameters and configurable parameters of the test case, obtain the expected result corresponding to the target request.

[0047] In some embodiments, the specific implementation of steps 301-304 and the technical effects thereof can be referred to in Figure 2 The corresponding embodiments will not be described in detail here.

[0048] Step 305: Obtain the test auxiliary conditions corresponding to the test case.

[0049] Step 306: configure the running environment of the test case so that the running environment of the test case satisfies the test auxiliary conditions.

[0050] In some embodiments, by setting the test auxiliary conditions, the test can simulate the real operating environment of the application as realistically as possible. For example, the test auxiliary conditions can be: the test time is from 0:00 to 6:00 every day. Then, for example, the server time can be adjusted to meet the test time in a fixed time interval.

[0051] Step 307, obtaining the target execution times corresponding to the target request.

[0052] Step 308, in response to determining that the current number of executions of the test case is less than the target number of executions, sending the target request to the service end corresponding to the service to obtain a request result corresponding to the target request.

[0053] In practice, it is necessary to test scenarios where users perform an operation multiple times to avoid unknown errors that may occur when users perform an operation multiple times, which may affect the normal operation of the application. For example, in the scenario where users review houses, you can test whether the application runs normally when users post more than 10 reviews.

[0054] In some embodiments, such scenarios are simulated by setting the number of executions corresponding to the target request, without the need for developers to manually serve a large number of comments, thus saving testing costs.

[0055] Optionally, in response to determining that the current number of executions is greater than or equal to the target number of executions, the test is terminated and information indicating that the current number of executions is greater than or equal to the target number of executions is generated.

[0056] Step 309: Generate test result information based on the matching of the request result and the expected result.

[0057] from Figure 3 It can be seen that Figure 2Compared with the description of some corresponding embodiments, the steps of obtaining the test auxiliary conditions and the target execution times are added, so that the operating environment of the application can be simulated more realistically. In addition, by repeatedly executing the test case, the scenario where the user performs a certain operation multiple times can be tested, saving the test cost.

[0058] Further references Figure 4 As an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a testing device, which are similar to Figure 2 Corresponding to the method embodiments shown, the device can be specifically applied to various electronic devices.

[0059] like Figure 4 As shown, the test device 400 of some embodiments includes: an address acquisition unit 401, a parameter acquisition unit 402, an assembly unit 403, an expected result acquisition unit 404, a sending unit 405 and a generating unit 406. The address acquisition unit 401 is configured to obtain the access address of the service corresponding to the test case in the target business scenario in response to the type of the currently executed test case being the test case corresponding to the target business scenario. The parameter acquisition unit 402 is configured to respectively obtain the fixed parameters and configurable parameters of the test case, wherein the fixed parameters and the configurable parameters are determined based on the target business scenario, the values ​​of the configurable parameters are target variables to be verified that change under the target business scenario, and the fixed parameters are environment variables set corresponding to the target variables to be verified under the target business scenario. The assembly unit 403 is configured to assemble the access address, fixed parameters and configurable parameters to generate a target request. The expected result acquisition unit 404 is configured to obtain the expected result corresponding to the target request based on the type, access address, fixed parameters and configurable parameters of the test case. The sending unit 405 is configured to send the target request to the service end corresponding to the service to obtain the request result corresponding to the target request. The generating unit 406 is configured to generate the test result information according to the matching situation between the request result and the expected result.

[0060] In an optional implementation of some embodiments, the device 400 also includes obtaining a target execution number corresponding to the target request; and the sending unit 405 is further configured to: in response to determining that the current execution number of the test case is less than the target execution number, send the target request to the server corresponding to the service to obtain the corresponding request result.

[0061] In an optional implementation of some embodiments, the apparatus 400 is further configured to: obtain a test auxiliary condition corresponding to the test case; and configure the running environment of the test case so that the running environment of the test case satisfies the test auxiliary condition.

[0062] In an optional implementation of some embodiments, the sending unit 405 is further configured to: in response to determining that the current number of executions is greater than or equal to the target number of executions, end the test and generate information indicating that the current number of executions is greater than or equal to the target number of executions.

[0063] In optional implementations of some embodiments, the configurable parameters include at least one of the following: service type information, user behavior data, terminal information, and user attribute information.

[0064] It is understood that the units described in the device 400 are similar to those described in the reference Figure 2 Therefore, the operations, features and beneficial effects described above for the method are also applicable to the device 400 and the units included therein, and will not be described in detail here.

[0065] Reference below Figure 5 , which shows an electronic device (eg, Figure 1 The electronic devices in some embodiments of the present disclosure may include but are not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 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.

[0066] like Figure 5 As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0067] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5 The electronic device 500 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 5 Each block shown in the figure may represent one device, or may represent multiple devices as required.

[0068] In particular, according to some embodiments of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, some embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from the network through the communication device 509, or installed from the storage device 508, or installed from the ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of some embodiments of the present disclosure are executed.

[0069] It should be noted that the computer-readable medium recorded in some embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The 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 some embodiments of the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In some embodiments of the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The 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 suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0070] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0071] The computer-readable medium may be included in the electronic device; or it may exist independently without being assembled into the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: in response to the type of the currently executed test case being the test case corresponding to the target business scenario, obtain the access address of the service corresponding to the test case in the target business scenario; obtain the fixed parameters and configurable parameters of the test case respectively; assemble the access address, fixed parameters and configurable parameters to generate a target request; based on the type, access address, fixed parameters and configurable parameters of the test case, obtain the expected result corresponding to the target request; send the target request to the service end corresponding to the service to obtain the request result corresponding to the target request; generate test result information according to the matching of the request result and the expected result.

[0072] Computer program code for performing the operations of some embodiments of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on a user's computer, partially on a user's computer, as a separate software package, partially on a user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0073] 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 square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the 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 implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square 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 square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0074] The units described in some embodiments of the present disclosure may be implemented by software or by hardware. The described units may also be provided in a processor, for example, may be described as: a processor including an address acquisition unit, a parameter acquisition unit, an assembly unit, an expected result acquisition unit, a sending unit, and a generation unit. The names of these units do not, in certain cases, constitute limitations on the units themselves, for example, the address acquisition unit may also be described as a "unit for acquiring the access address of the service corresponding to the test case in the target business scenario".

[0075] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0076] The above descriptions are only some preferred embodiments of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, the above-mentioned features are replaced with the technical features with similar functions disclosed in the embodiments of the present disclosure (but not limited to) and the technical solutions formed.

Claims

1. A testing method comprising: In response to the type of the currently executed test case being a test case corresponding to a target business scenario, obtaining an access address of a service corresponding to the test case in the target business scenario; Respectively obtain fixed parameters and configurable parameters of the test case, wherein the fixed parameters and configurable parameters are determined based on the target business scenario, the fixed parameters and configurable parameters simulate different business scenarios, the different business scenarios correspond to a test case, the value of the configurable parameter is a target variable to be verified that changes under the target business scenario, the fixed parameter is an environment variable set corresponding to the target variable to be verified under the target business scenario, the test of the target business scenario includes multiple tests, each test includes fixed parameters and configurable parameters, the fixed parameters and configurable parameters are different according to different test contents, and the fixed parameters and the configurable parameters are used to control a single variable; Assembling the access address, the fixed parameters and the configurable parameters according to the protocol to generate a target request; Based on the type of the test case, the access address, the fixed parameters and the configurable parameters, obtaining an expected result corresponding to the target request; Sending the target request to the server corresponding to the service to obtain a request result corresponding to the target request; Generate test result information based on the matching status of the request result and the expected result.

2. The method according to claim 1, wherein: The sending the target request to the server corresponding to the service to obtain a request result corresponding to the target request includes: Obtaining a target execution count corresponding to the target request; and The sending the target request to the server corresponding to the service to obtain a request result corresponding to the target request includes: In response to determining that the current number of executions of the test case is less than the target number of executions, the target request is sent to a service end corresponding to the service to obtain a corresponding request result.

3. The method according to claim 1, wherein: Before sending the target request to the service end corresponding to the service to obtain the request result corresponding to the target request, the method includes: Obtaining the test auxiliary conditions corresponding to the test case; The running environment of the test case is configured so that the running environment of the test case satisfies the test auxiliary condition.

4. The method according to claim 2, wherein: The sending the target request to the server corresponding to the service to obtain a request result corresponding to the target request includes: In response to determining that the current number of completed executions is greater than or equal to the target number of completed executions, the test is terminated and information indicating that the current number of completed executions is greater than or equal to the target number of completed executions is generated.

5. The method according to claim 1, wherein: The configurable parameters include at least one of the following: service type information, user behavior data, terminal information, and user attribute information.

6. A testing device comprising: An address acquisition unit is configured to, in response to the type of the currently executed test case being a test case corresponding to the target business scenario, acquire an access address of a service corresponding to the test case in the target business scenario; A parameter acquisition unit is configured to respectively acquire fixed parameters and configurable parameters of the test case, wherein the fixed parameters and configurable parameters are determined based on the target business scenario, the fixed parameters and configurable parameters simulate different business scenarios, the different business scenarios correspond to a test case, the value of the configurable parameter is a target variable to be verified that changes under the target business scenario, the fixed parameter is an environment variable set corresponding to the target variable to be verified under the target business scenario, the test of the target business scenario includes multiple tests, each test includes fixed parameters and configurable parameters, the fixed parameters and configurable parameters are different according to different test contents, and the fixed parameters and the configurable parameters are used to control a single variable; an assembling unit, configured to assemble the access address, the fixed parameters and the configurable parameters according to a protocol to generate a target request; an expected result acquisition unit, configured to acquire an expected result corresponding to the target request based on the type of the test case, the access address, the fixed parameters and the configurable parameters; A sending unit, configured to send the target request to a server corresponding to the service to obtain a request result corresponding to the target request; The generating unit is configured to generate test result information according to the matching condition between the request result and the expected result.

7. The device according to claim 6, wherein: The device also includes: The execution number acquisition unit is configured to acquire the target execution number corresponding to the target request; and the sending unit is further configured to: In response to determining that the current number of executions of the test case is less than the target number of executions, the target request is sent to a service end corresponding to the service to obtain a corresponding request result.

8. The device according to claim 6, wherein: The device is further configured to: Obtaining the test auxiliary conditions corresponding to the test case; The running environment of the test case is configured so that the running environment of the test case satisfies the test auxiliary condition.

9. An electronic device, comprising: one or more processors; a storage device having one or more programs stored thereon, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.

10. A computer readable medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Interface test method and device

    CN104615534A

  • Method and device for achieving data parameterization

    CN106681921A