[go: up one dir, main page]

CN112597047B - Test method, test device, electronic equipment and computer readable medium - Google Patents

Test method, test device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN112597047B
CN112597047B CN202011603021.4A CN202011603021A CN112597047B CN 112597047 B CN112597047 B CN 112597047B CN 202011603021 A CN202011603021 A CN 202011603021A CN 112597047 B CN112597047 B CN 112597047B
Authority
CN
China
Prior art keywords
target
test
request
service
test case
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011603021.4A
Other languages
Chinese (zh)
Other versions
CN112597047A (en
Inventor
张鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Ruijia Information Technology Co ltd
Original Assignee
Shanghai Ruijia Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Ruijia Information Technology Co ltd filed Critical Shanghai Ruijia Information Technology Co ltd
Priority to CN202011603021.4A priority Critical patent/CN112597047B/en
Publication of CN112597047A publication Critical patent/CN112597047A/en
Application granted granted Critical
Publication of CN112597047B publication Critical patent/CN112597047B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

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

Abstract

Embodiments of the present disclosure disclose a test method, apparatus, electronic device, and computer-readable medium. One embodiment of the method comprises the following steps: responding to the type of the currently executed test case as the test case corresponding to the target service scene, and acquiring the access address of the service corresponding to the test case in the target service scene; respectively obtaining fixed parameters and configurable parameters of the test cases; splicing the access address, the fixed parameters and the configurable parameters to generate a target request; acquiring an expected result corresponding to the target request based on the type, the access address, the fixed parameter and the configurable parameter of the test case; the target request is sent to a server corresponding to the service to obtain a request result corresponding to the target request; and generating test result information according to the matching condition of the request result and the expected result. The embodiment realizes the automatic test of various business scenes.

Description

测试方法、装置、电子设备和计算机可读介质Test method, device, electronic device and computer readable medium

技术领域Technical Field

本公开的实施例涉及计算机技术领域,具体涉及测试方法、装置、电子设备和计算机可读介质。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

在各种业务场景下,需要对不同的周期、输入条件等组成的策略进行测试。一般来说,需要测试人员遍历所有的策略种类,以对不同的组合进行验证。然而,这种测试方式需要测试人员遍历所有的策略种类,工作量巨大,费时费力。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

本公开的内容部分用于以简要的形式介绍构思,这些构思将在后面的具体实施方式部分被详细描述。本公开的内容部分并不旨在标识要求保护的技术方案的关键特征或必要特征,也不旨在用于限制所要求的保护的技术方案的范围。本公开的一些实施例提出了测试方法、装置、电子设备和计算机可读介质,来解决以上背景技术部分提到的技术问题中的一项或多项。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.

第一方面,本公开的一些实施例提供了一种测试方法,该方法包括:响应于当前执行的测试用例的类型是目标业务场景对应的测试用例,获取测试用例在目标业务场景中对应的服务的访问地址;分别获取测试用例的固定参数和可配置参数,其中,固定参数和可配置参数是基于目标业务场景确定的,可配置参数的值为在目标业务场景下变化的待校验的目标变量,固定参数为在目标业务场景下基于待校验的目标变量对应设置的环境变量;将访问地址、固定参数和可配置参数进行拼装以生成目标请求;基于测试用例的类型、访问地址、固定参数和可配置参数,获取目标请求对应的期望结果;将目标请求发送至服务对应的服务端以得到目标请求对应的请求结果;根据请求结果和期望结果的匹配情况,生成测试结果信息。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.

第二方面,本公开的一些实施例提供了一种测试装置,装置包括:地址获取单元,被配置成响应于当前执行的测试用例的类型是目标业务场景对应的测试用例,获取测试用例在目标业务场景中对应的服务的访问地址;参数获取单元,被配置成分别获取测试用例的固定参数和可配置参数,其中,固定参数和可配置参数是基于目标业务场景确定的,可配置参数的值为在目标业务场景下变化的待校验的目标变量,固定参数为在目标业务场景下基于待校验的目标变量对应设置的环境变量;拼装单元,被配置成将访问地址、固定参数和可配置参数进行拼装以生成目标请求;期望结果获取单元,被配置成基于测试用例的类型、访问地址、固定参数和可配置参数,获取目标请求对应的期望结果;发送单元,被配置成将目标请求发送至服务对应的服务端以得到目标请求对应的请求结果;生成单元,被配置成根据请求结果和期望结果的匹配情况,生成测试结果信息。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.

第三方面,本公开的一些实施例提供了一种电子设备,包括:一个或多个处理器;存储装置,其上存储有一个或多个程序,当一个或多个程序被一个或多个处理器执行,使得一个或多个处理器实现上述第一方面任一实现方式所描述的方法。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.

第四方面,本公开的一些实施例提供了一种计算机可读介质,其上存储有计算机程序,其中,程序被处理器执行时实现上述第一方面任一实现方式所描述的方法。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.

本公开的上述各个实施例具有如下有益效果:实现了对于各种业务场景的自动化测试。在此过程中,通过将参数分为固定参数和可配置参数,可以模拟各种不同的业务场景,实现对于变量的针对性测试,不需要在每个业务场景下都进行对应的设置,从而节约了测试成本。举例来说,对于房源类应用,用户在看房或者预约看房后,进行评价,包括对房源的评价和对于人员的评价。针对这些不同的业务场景,均可以通过配置相关的参数实现,不需要单独编写测试用例。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

结合附图并参考以下具体实施方式,本公开各实施例的上述和其他特征、优点及方面将变得更加明显。贯穿附图中,相同或相似的附图标记表示相同或相似的元素。应当理解附图是示意性的,元件和元素不一定按照比例绘制。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.

图1是根据本公开的一些实施例的测试方法的一个应用场景的示意图;FIG1 is a schematic diagram of an application scenario of a testing method according to some embodiments of the present disclosure;

图2是根据本公开的测试方法的一些实施例的流程图;FIG2 is a flow chart of some embodiments of the testing method according to the present disclosure;

图3是根据本公开的测试方法的另一些实施例的流程图;FIG3 is a flow chart of other embodiments of the testing method according to the present disclosure;

图4是根据本公开的测试装置的一些实施例的结构示意图;FIG4 is a schematic diagram of the structure of some embodiments of the testing device according to the present disclosure;

图5是适于用来实现本公开的一些实施例的电子设备的结构示意图。FIG. 5 is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure.

具体实施方式DETAILED DESCRIPTION

下面将参照附图更详细地描述本公开的实施例。虽然附图中显示了本公开的某些实施例,然而应当理解的是,本公开可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例。相反,提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用,并非用于限制本公开的保护范围。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.

另外还需要说明的是,为了便于描述,附图中仅示出了与有关发明相关的部分。在不冲突的情况下,本公开中的实施例及实施例中的特征可以相互组合。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.

需要注意,本公开中提及的“第一”、“第二”等概念仅用于对不同的装置、模块或单元进行区分,并非用于限定这些装置、模块或单元所执行的功能的顺序或者相互依存关系。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.

需要注意,本公开中提及的“一个”、“多个”的修饰是示意性而非限制性的,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。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".

本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。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.

下面将参考附图并结合实施例来详细说明本公开。The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

图1是根据本公开一些实施例的测试方法的一个应用场景的示意图。FIG. 1 is a schematic diagram of an application scenario of a testing method according to some embodiments of the present disclosure.

如图1所示,响应于当前执行的测试用例102的类型是目标业务场景对应的测试用例,计算设备101可以获取测试用例在目标业务场景中对应的服务的访问地址103(URL)。As shown in FIG. 1 , 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.

然后,计算设备101分别获取测试用例的固定参数104和可配置参数105,其中,固定参数和可配置参数是基于目标业务场景确定的,可配置参数的值为在目标业务场景下变化的待校验的目标变量,固定参数为在目标业务场景下基于待校验的目标变量对应设置的环境变量。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.

在此基础上,计算设备101可以将访问地址103、固定参数104和可配置参数105进行拼装以生成目标请求106。然后,基于测试用例的类型、访问地址、固定参数和可配置参数,获取目标请求对应的期望结果107。将目标请求106发送至服务对应的服务端108以得到目标请求对应的请求结果109。根据请求结果109和期望结果107的匹配情况,生成测试结果信息110。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.

可以理解的是,计算设备101可以是硬件,也可以是各种软件。当其为硬件时,可以是具有信息处理能力的各种电子设备,包括但不限于智能手机、平板电脑、电子书阅读器、膝上型便携计算机和台式计算机等等。当其为软件时,可以安装在上述所列举的电子设备中。其可以实现成例如用来提供分布式服务的多个软件或软件模块,也可以实现成单个软件或软件模块。在此不做具体限定。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.

继续参考图2,示出了根据本公开的测试方法的一些实施例的流程200。该测试方法,包括以下步骤:Continuing to refer to FIG. 2 , a process 200 of some embodiments of the testing method according to the present disclosure is shown. The testing method comprises the following steps:

步骤201,响应于当前执行的测试用例的类型是目标业务场景对应的测试用例,获取测试用例在目标业务场景中对应的服务的访问地址。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.

在一些实施例中,测试方法的执行主体可以首先确定当前执行的测试用例的类型是否为目标业务场景对应的测试用例。其中,目标业务场景的确定可以通过指定,也可以通过一定的条件筛选得到。例如,目标业务场景可以是房源评论场景、全真房源校验场景等等。从而可以实现针对目标业务场景针对性的测试。实践中,可以通过测试用例所包含的标识信息来确定测试用例的类型是否为目标业务场景对应的测试用例。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.

在此基础上,响应于当前执行的测试用例的类型是目标业务场景对应的测试用例,可以从数据库中获取测试用户用例在目标业务场景中对应的服务的访问地址。作为示例,在对于全真房源进行测试的业务场景下,需要对房源的价格进行测试(虚假的房源一般与市场价格偏差较大)。此时,可以调用用于测试价格的服务完成价格测试。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.

步骤202,分别获取测试用例的固定参数和可配置参数。Step 202, respectively obtain fixed parameters and configurable parameters of the test case.

在一些实施例中,固定参数和可配置参数是基于目标业务场景确定的,可配置参数的值为在目标业务场景下变化的待校验的目标变量,固定参数为在目标业务场景下基于待校验的目标变量对应设置的环境变量。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.

作为示例,在全真房源进行测试的业务场景下,根据测试内容的不同,固定参数和可配置参数有所不同。举例来说,全真房源测试包括价格测试、描述测试、真实图像测试等等,分别用于测试价格、描述、图像是否真实。此时,对于价格测试,可配置参数为价格,其他参数为固定参数。对于描述测试,可配置参数为描述,其他参数为固定参数。由此,通过配置固定参数和可配置参数,可以针对性的实现对于目标变量的测试,防止由于无法控制单一变量,造成测试不准确。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.

可选的,可配置参数包括以下至少一项:业务类型信息、用户行为数据、终端信息、用户属性信息。实践中,可以根据实际需要,对可配置参数进行相应的配置。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.

步骤203,将访问地址、固定参数和可配置参数进行拼装以生成目标请求。Step 203: Assemble the access address, fixed parameters and configurable parameters to generate a target request.

在一些实施例中,上述执行主体可以将访问地址、固定参数和可配置参数按照一定的协议进行组装,得到目标请求。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.

步骤204,基于测试用例的类型、访问地址、固定参数和可配置参数,获取目标请求对应的期望结果。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.

在一些实施例中,上述执行主体可以基于测试用例的类型、访问地址、固定参数和可配置参数,从数据库中查询对应的期望结果。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.

步骤205,将目标请求发送至服务对应的服务端以得到目标请求对应的请求结果。Step 205: Send the target request to the server corresponding to the service to obtain a request result corresponding to the target request.

步骤206,根据请求结果和期望结果的匹配情况,生成测试结果信息。Step 206: Generate test result information based on the matching of the request result and the expected result.

在一些实施例中,作为示例,若请求结果和期望结果相匹配,可以生成用于表征通过测试的测试结果信息。反之,若请求结果和期望结果不匹配,可以生成表征未通过测试的测试结果信息。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.

在一些实施例中,实现了对于各种业务场景的自动化测试。在此过程中,通过将参数分为固定参数和可配置参数,可以模拟各种不同的业务场景,实现对于变量的针对性测试,不需要在每个业务场景下都进行对应的设置,从而节约了测试成本。举例来说,对于房源类应用,用户在看房或者预约看房后,进行评价,包括对房源的评价和对于人员的评价。针对这些不同的业务场景,均可以通过配置相关的参数实现,不需要单独编写测试用例。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.

进一步参考图3,其示出了测试方法的另一些实施例的流程300。该测试方法的流程300,包括以下步骤:Further reference is made to FIG3 , which shows a process 300 of another embodiment of the test method. The process 300 of the test method comprises the following steps:

步骤301,响应于当前执行的测试用例的类型是目标业务场景对应的测试用例,获取测试用例在目标业务场景中对应的服务的访问地址。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.

步骤302,分别获取测试用例的固定参数和可配置参数,其中,固定参数和可配置参数是基于目标业务场景确定的,可配置参数的值为在目标业务场景下变化的待校验的目标变量,固定参数为在目标业务场景下基于待校验的目标变量对应设置的环境变量。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.

步骤303,将访问地址、固定参数和可配置参数进行拼装以生成目标请求。Step 303: Assemble the access address, fixed parameters and configurable parameters to generate a target request.

步骤304,基于测试用例的类型、访问地址、固定参数和可配置参数,获取目标请求对应的期望结果。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.

在一些实施例中,步骤301-304的具体实现及其所带来的技术效果可以参考图2对应的那些实施例,在此不再赘述。In some embodiments, the specific implementation of steps 301-304 and the technical effects brought about by them can refer to those embodiments corresponding to FIG. 2, and will not be repeated here.

步骤305,获取测试用例对应的测试辅助条件。Step 305: Obtain the test auxiliary conditions corresponding to the test case.

步骤306,对于测试用例的运行环境进行配置,以使得测试用例的运行环境满足测试辅助条件。Step 306: configure the running environment of the test case so that the running environment of the test case satisfies the test auxiliary conditions.

在一些实施例中,通过设置测试辅助条件,可以使得测试尽可能真实模拟应用的真实运行环境。例如,测试辅助条件可以是:测试时间为每天0点到6点。那么,可以例如调整服务器时间以满足测试时间在固定的时间区间。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.

步骤307,获取目标请求对应的目标执行次数。Step 307, obtaining the target execution times corresponding to the target request.

步骤308,响应于确定测试用例的当前已执行次数小于目标执行次数,将目标请求发送至服务对应的服务端以得到目标请求对应的请求结果。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.

实践中,需要对用户多次执行某一操作的场景进行测试,以避免用户多次执行某一操作时可能存在的未知错误,影响应用的正常运行。例如,在用户看房评论的场景下,可以测试用户发布10条以上评论时,应用是否正常运行。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.

在一些实施例中,通过设置目标请求对应的执行次数来模拟这类场景,而不需要开发人员手动服务大量的评论,节约了测试成本。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.

可选的,响应于确定当前已执行次数大于或等于目标执行次数,结束测试以及生成表征当前已执行次数大于或等于目标执行次数的信息。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.

步骤309,根据请求结果和期望结果的匹配情况,生成测试结果信息。Step 309: Generate test result information based on the matching of the request result and the expected result.

从图3中可以看出,与图2对应的一些实施例的描述相比,增加了获取测试辅助条件以及目标执行次数的步骤,从而能够更加真实的模拟应用的运行环境。此外,通过重复执行测试用例,可以对户多次执行某一操作的场景进行测试,节约了测试成本。As can be seen from FIG3, compared with the description of some embodiments corresponding to FIG2, the step of obtaining the test auxiliary conditions and the target execution times is 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.

进一步参考图4,作为对上述各图所示方法的实现,本公开提供了一种测试装置的一些实施例,这些装置实施例与图2所示的那些方法实施例相对应,该装置具体可以应用于各种电子设备中。Further referring to FIG. 4 , as an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a testing device, which correspond to the method embodiments shown in FIG. 2 , and the device can be specifically applied to various electronic devices.

如图4所示,一些实施例的测试装置400包括:地址获取单元401、参数获取单元402、拼装单元403、期望结果获取单元404、发送单元405和生成单元406。其中,地址获取单元401被配置成响应于当前执行的测试用例的类型是目标业务场景对应的测试用例,获取测试用例在目标业务场景中对应的服务的访问地址。参数获取单元402被配置成分别获取测试用例的固定参数和可配置参数,其中,固定参数和可配置参数是基于目标业务场景确定的,可配置参数的值为在目标业务场景下变化的待校验的目标变量,固定参数为在目标业务场景下基于待校验的目标变量对应设置的环境变量。拼装单元403被配置成将访问地址、固定参数和可配置参数进行拼装以生成目标请求。期望结果获取单元404被配置成基于测试用例的类型、访问地址、固定参数和可配置参数,获取目标请求对应的期望结果。发送单元405被配置成将目标请求发送至服务对应的服务端以得到目标请求对应的请求结果。生成单元406被配置成根据请求结果和期望结果的匹配情况,生成测试结果信息。As shown in FIG4 , 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 of the test case, the access address, the fixed parameters and the configurable parameters. 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.

在一些实施例的可选实现方式中,装置400还包括获取目标请求对应的目标执行次数;以及发送单元405进一步被配置成:响应于确定测试用例的当前已执行次数小于目标执行次数,将目标请求发送至服务对应的服务端以得到对应的请求结果。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.

在一些实施例的可选实现方式中,装置400进一步被配置成:获取测试用例对应的测试辅助条件;对于测试用例的运行环境进行配置,以使得测试用例的运行环境满足测试辅助条件。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.

在一些实施例的可选实现方式中,发送单元405进一步被配置成:响应于确定当前已执行次数大于或等于目标执行次数,结束测试以及生成表征当前已执行次数大于或等于目标执行次数的信息。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.

在一些实施例的可选实现方式中,可配置参数包括以下至少一项:业务类型信息、用户行为数据、终端信息、用户属性信息。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.

可以理解的是,该装置400中记载的诸单元与参考图2描述的方法中的各个步骤相对应。由此,上文针对方法描述的操作、特征以及产生的有益效果同样适用于装置400及其中包含的单元,在此不再赘述。It is understandable that the units recorded in the device 400 correspond to the steps in the method described with reference to Figure 2. Therefore, the operations, features and beneficial effects described above for the method are also applicable to the device 400 and the units contained therein, and will not be repeated here.

下面参考图5,其示出了适于用来实现本公开的一些实施例的电子设备(例如图1中的电子设备)500的结构示意图。本公开的一些实施例中的电子设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图5示出的电子设备仅仅是一个示例,不应对本公开的实施例的功能和使用范围带来任何限制。Referring to FIG5 below, a schematic diagram of the structure of an electronic device (e.g., the electronic device in FIG1 ) 500 suitable for implementing some embodiments of the present disclosure is shown. The electronic devices in some embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (e.g., vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. The electronic device shown in FIG5 is only an example and should not impose any limitations on the functions and scope of use of the embodiments of the present disclosure.

如图5所示,电子设备500可以包括处理装置(例如中央处理器、图形处理器等)501,其可以根据存储在只读存储器(ROM)502中的程序或者从存储装置508加载到随机访问存储器(RAM)503中的程序而执行各种适当的动作和处理。在RAM 503中,还存储有电子设备500操作所需的各种程序和数据。处理装置501、ROM 502以及RAM 503通过总线504彼此相连。输入/输出(I/O)接口505也连接至总线504。As shown in FIG5 , 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.

通常,以下装置可以连接至I/O接口505:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置506;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置507;包括例如磁带、硬盘等的存储装置508;以及通信装置509。通信装置509可以允许电子设备500与其他设备进行无线或有线通信以交换数据。虽然图5示出了具有各种装置的电子设备500,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。图5中示出的每个方框可以代表一个装置,也可以根据需要代表多个装置。Typically, the following devices may be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 508 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although FIG. 5 shows an electronic device 500 with various devices, it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or have alternatively. Each box shown in FIG. 5 may represent one device, or may represent multiple devices as needed.

特别地,根据本公开的一些实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的一些实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的一些实施例中,该计算机程序可以通过通信装置509从网络上被下载和安装,或者从存储装置508被安装,或者从ROM 502被安装。在该计算机程序被处理装置501执行时,执行本公开的一些实施例的方法中限定的上述功能。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.

需要说明的是,本公开的一些实施例中记载的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开的一些实施例中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开的一些实施例中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。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.

在一些实施方式中,客户端、服务器可以利用诸如HTTP(HyperText TransferProtocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。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.

上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:响应于当前执行的测试用例的类型是目标业务场景对应的测试用例,获取测试用例在目标业务场景中对应的服务的访问地址;分别获取测试用例的固定参数和可配置参数;将访问地址、固定参数和可配置参数进行拼装以生成目标请求;基于测试用例的类型、访问地址、固定参数和可配置参数,获取目标请求对应的期望结果;将目标请求发送至服务对应的服务端以得到目标请求对应的请求结果;根据请求结果和期望结果的匹配情况,生成测试结果信息。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.

可以以一种或多种程序设计语言或其组合来编写用于执行本公开的一些实施例的操作的计算机程序代码,所述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)——连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。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).

附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。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.

描述于本公开的一些实施例中的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的单元也可以设置在处理器中,例如,可以描述为:一种处理器包括地址获取单元、参数获取单元、拼装单元、期望结果获取单元、发送单元和生成单元。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定,例如,地址获取单元还可以被描述为“获取测试用例在目标业务场景中对应的服务的访问地址的单元”。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".

本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。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.

以上描述仅为本公开的一些较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开的实施例中所涉及的发明范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述发明构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开的实施例中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。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 (10)

1. A method of testing, comprising:
Responding to the type of the currently executed test case as the test case corresponding to the target service scene, and acquiring the access address of the service corresponding to the test case in the target service scene;
Respectively obtaining fixed parameters and configurable parameters of the test cases, wherein the fixed parameters and the configurable parameters are determined based on the target service scene, the fixed parameters and the configurable parameters simulate different service scenes, the different service scenes correspond to one test case, the value of the configurable parameters is a target variable to be verified, which is changed under the target service scene, the fixed parameters are environment variables, which are correspondingly set based on the target variable to be verified, under the target service scene, the test of the target service scene comprises a plurality of tests, each test comprises a fixed parameter and a configurable parameter, the fixed parameters and the configurable parameters are different according to different test contents, and the fixed parameters and the configurable parameters are used for controlling a single variable;
Splicing the access address, the fixed parameter and the configurable parameter according to a protocol to generate a target request;
acquiring an expected result corresponding to the target request based on the type of the test case, the access address, the fixed parameter and the configurable parameter;
the target request is sent to a server corresponding to the service to obtain a request result corresponding to the target request;
and generating test result information according to the matching condition of the request result and the expected result.
2. The method of claim 1, wherein the sending the target request to the service end corresponding to the service to obtain the request result corresponding to the target request includes:
Acquiring target execution times corresponding to the target request; and
The sending the target request to the service end corresponding to the service to obtain a request result corresponding to the target request includes:
and in response to determining that the current executed times of the test cases are smaller than the target executed times, sending the target requests to the service ends corresponding to the services to obtain corresponding request results.
3. The method of claim 1, wherein before the sending the target request to the service end corresponding to the service to obtain the request result corresponding to the target request, the method comprises:
acquiring a test auxiliary condition corresponding to the test case;
and configuring the running environment of the test case so that the running environment of the test case meets the test auxiliary condition.
4. The method of claim 2, wherein the sending the target request to the service end corresponding to the service to obtain the request result corresponding to the target request includes:
In response to determining that the current number of executions is greater than or equal to the target number of executions, ending the test and generating information characterizing that the current number of executions is greater than or equal to the target number of executions.
5. The method of claim 1, wherein the configurable parameters comprise at least one of: service type information, user behavior data, terminal information, user attribute information.
6. A test apparatus comprising:
The address acquisition unit is configured to respond to the test case of which the type is the corresponding test case of the target service scene, and acquire the access address of the service corresponding to the test case in the target service scene;
A parameter obtaining unit configured to obtain a fixed parameter and a configurable parameter of the test case, where the fixed parameter and the configurable parameter are determined based on the target service scenario, the fixed parameter and the configurable parameter simulate different service scenarios, the different service scenarios correspond to one test case, the value of the configurable parameter is a target variable to be verified, which is changed in the target service scenario, the fixed parameter is an environmental variable, which is set correspondingly based on the target variable to be verified, in the target service scenario, the test of the target service scenario includes multiple tests, each test includes a fixed parameter and a configurable parameter, the fixed parameter and the configurable parameter are different according to different test contents, and the fixed parameter and the configurable parameter are used to control a single variable;
a splicing unit configured to splice the access address, the fixed parameter, and the configurable parameter according to a protocol to generate a target request;
the expected result obtaining unit is configured to obtain an expected result corresponding to the target request based on the type of the test case, the access address, the fixed parameter and the configurable parameter;
The sending unit is configured to send the target request to a service end corresponding to the service to obtain a request result corresponding to the target request;
And the generating unit is configured to generate test result information according to the matching condition of the request result and the expected result.
7. The apparatus of claim 6, wherein the apparatus further comprises:
the execution times acquisition unit is configured to acquire target execution times corresponding to the target request; and the transmitting unit is further configured to:
and in response to determining that the current executed times of the test cases are smaller than the target executed times, sending the target requests to the service ends corresponding to the services to obtain corresponding request results.
8. The apparatus of claim 6, wherein the apparatus is further configured to:
acquiring a test auxiliary condition corresponding to the test case;
and configuring the running environment of the test case so that the running environment of the test case meets the test auxiliary condition.
9. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
When executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-5.
10. A computer readable medium having stored thereon a computer program, wherein the program when executed by a processor implements the method of any of claims 1-5.
CN202011603021.4A 2020-12-29 2020-12-29 Test method, test device, electronic equipment and computer readable medium Active CN112597047B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011603021.4A CN112597047B (en) 2020-12-29 2020-12-29 Test method, test device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011603021.4A CN112597047B (en) 2020-12-29 2020-12-29 Test method, test device, electronic equipment and computer readable medium

Publications (2)

Publication Number Publication Date
CN112597047A CN112597047A (en) 2021-04-02
CN112597047B true CN112597047B (en) 2024-10-29

Family

ID=75203953

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011603021.4A Active CN112597047B (en) 2020-12-29 2020-12-29 Test method, test device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN112597047B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113051456B (en) * 2021-05-11 2024-10-29 抖音视界有限公司 Request processing method, apparatus, electronic device and computer readable medium
CN113392361B (en) * 2021-05-24 2024-05-17 北京京东振世信息技术有限公司 Service processing method, device, electronic equipment and computer readable medium
CN113485918B (en) * 2021-06-30 2024-05-07 中国民航信息网络股份有限公司 Test method, test device, electronic equipment and storage medium
CN113656326A (en) * 2021-08-31 2021-11-16 北京沃东天骏信息技术有限公司 Program testing method, program testing device, computer system and storage medium
CN114153729B (en) * 2021-11-30 2024-12-03 北京达佳互联信息技术有限公司 Web page testing method, device, electronic device and storage medium
CN114116432A (en) * 2022-01-29 2022-03-01 中国民航信息网络股份有限公司 Migration verification method, migration verification platform, electronic device and storage medium
CN114428748B (en) * 2022-03-30 2022-06-21 北京数腾软件科技有限公司 Simulation test method and system for real service scene
CN114826439B (en) * 2022-04-25 2024-11-12 展讯半导体(成都)有限公司 User experience testing method, device, system and electronic device for communication module
CN114896143A (en) * 2022-04-26 2022-08-12 上海幻电信息科技有限公司 Rule testing method and device
CN116898402B (en) * 2023-07-21 2024-08-20 北京无疆脑智科技有限公司 Cognitive ability evaluation method and device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104615534A (en) * 2015-01-28 2015-05-13 广州酷狗计算机科技有限公司 Interface test method and device
CN106681921A (en) * 2016-12-27 2017-05-17 腾讯科技(深圳)有限公司 Method and device for achieving data parameterization

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103198009B (en) * 2012-01-04 2016-09-07 中国移动通信集团公司 A kind of universal testing method, system and related device
US10621075B2 (en) * 2014-12-30 2020-04-14 Spirent Communications, Inc. Performance testing of a network segment between test appliances
US20180239690A1 (en) * 2017-02-22 2018-08-23 International Business Machines Corporation Management of Problems in Software Programs
US10540270B1 (en) * 2018-01-25 2020-01-21 Amazon Technologies, Inc. Representation-based automated software testing
CN111538659B (en) * 2020-04-21 2024-03-01 上海携程商务有限公司 Interface testing method, system, electronic equipment and storage medium of business scene
CN111767221A (en) * 2020-06-28 2020-10-13 北京百度网讯科技有限公司 Interface test method, device, equipment and storage medium
CN111752844A (en) * 2020-06-30 2020-10-09 北京来也网络科技有限公司 Interface testing method and device, computing equipment and storage medium
CN111914262A (en) * 2020-08-12 2020-11-10 中国工商银行股份有限公司 Test method, device, system, electronic equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104615534A (en) * 2015-01-28 2015-05-13 广州酷狗计算机科技有限公司 Interface test method and device
CN106681921A (en) * 2016-12-27 2017-05-17 腾讯科技(深圳)有限公司 Method and device for achieving data parameterization

Also Published As

Publication number Publication date
CN112597047A (en) 2021-04-02

Similar Documents

Publication Publication Date Title
CN112597047B (en) Test method, test device, electronic equipment and computer readable medium
CN111679990B (en) Test data generation method and device, readable medium and electronic equipment
CN112684968A (en) Page display method and device, electronic equipment and computer readable medium
CN111309304B (en) Method, device, medium and electronic equipment for generating IDL file
WO2021217340A1 (en) Ai-based automatic design method and apparatus for universal smart home scheme
CN114428925A (en) Page rendering method and device, electronic equipment and computer readable medium
CN111209205B (en) Configuration method, configuration device and electronic equipment
WO2021139379A1 (en) Activity configuration method and apparatus, readable medium and electronic device
CN111752644A (en) Interface simulation method, device, equipment and storage medium
CN112668194B (en) Page-based automatic driving scene library information display method, device and device
CN112954056B (en) Method and device for processing monitoring data, electronic equipment and storage medium
CN111797009B (en) Method and device for detecting code compatibility and electronic equipment
CN112579428B (en) Interface testing method, device, electronic equipment and storage medium
CN113704079A (en) Interface testing method and device based on Protobuf
CN110730109A (en) Method and apparatus for generating information
CN111273970A (en) Calling method, device, system, medium and electronic equipment of intelligent contract
CN112379967B (en) Simulator detection method, device, equipment and medium
CN110489341B (en) Test method and device, storage medium and electronic equipment
CN115842819B (en) Automatic driving system test data download method, device and equipment
CN116701181B (en) Information verification flow display method, device, equipment and computer readable medium
CN111831530A (en) Test method and apparatus
CN111857879B (en) Data processing method, device, electronic equipment and computer readable medium
CN116467178B (en) Database detection method, apparatus, electronic device and computer readable medium
CN112417151B (en) Method for generating classification model, text relationship classification method and device
CN117910850B (en) Index data analysis engine, index data calculation device and calculation method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant