CN115391228A - Accurate testing methods, devices, equipment and media - Google Patents

Accurate testing methods, devices, equipment and media Download PDF

Info

Publication number
CN115391228A
CN115391228A CN202211145089.1A CN202211145089A CN115391228A CN 115391228 A CN115391228 A CN 115391228A CN 202211145089 A CN202211145089 A CN 202211145089A CN 115391228 A CN115391228 A CN 115391228A
Authority
CN
China
Prior art keywords
application
version
test
code
function
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211145089.1A
Other languages
Chinese (zh)
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.)
Zhejiang Geely Holding Group Co Ltd
Zhejiang Zeekr Intelligent Technology Co Ltd
Original Assignee
Zhejiang Geely Holding Group Co Ltd
Zhejiang Zeekr Intelligent 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 Zhejiang Geely Holding Group Co Ltd, Zhejiang Zeekr Intelligent Technology Co Ltd filed Critical Zhejiang Geely Holding Group Co Ltd
Priority to CN202211145089.1A priority Critical patent/CN115391228A/en
Publication of CN115391228A publication Critical patent/CN115391228A/en
Pending legal-status Critical Current

Links

Images

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

本申请提供一种精准测试方法、装置、设备及介质。在该方法中,通过精准测试平台根据待测版本应用的代码和堆栈数据,生成目标函数调用图;进而根据差异代码和目标函数调用图确定出受影响函数,再将受影响函数的接口标识发送至自动化平台。自动化平台根据接口标识可获取到测试用例,进而使用测试用例完成测试。本方案根据待测版本应用的代码和堆栈数据,生成目标函数调用图,进而根据目标函数调用图确定出测试用例,使得测试用例更加完善,有效提高了测试覆盖率。

Figure 202211145089

The application provides a precise testing method, device, equipment and medium. In this method, the target function call graph is generated based on the code and stack data of the version to be tested through the precise test platform; then the affected function is determined according to the difference code and the target function call graph, and then the interface identifier of the affected function is sent to to the automation platform. The automation platform can obtain the test cases according to the interface identification, and then use the test cases to complete the test. This solution generates the target function call graph based on the code and stack data of the application to be tested, and then determines the test case according to the target function call graph, which makes the test case more perfect and effectively improves the test coverage.

Figure 202211145089

Description

精准测试方法、装置、设备及介质Accurate testing methods, devices, equipment and media

技术领域technical field

本申请涉及软件测试领域,尤其涉及一种精准测试方法、装置、设备及介质。The present application relates to the field of software testing, in particular to a precise testing method, device, equipment and medium.

背景技术Background technique

随着企业业务复杂度升级、服务多元化,模块代码依赖众多的情况越来越多;同时,面临项目版本的快速迭代,无法达到快速测试支撑;在此背景下,急需实现一种可靠的测试平台,获取到开发人员在本次版本迭代中所变更的代码,自动化分析这些代码的影响面,助力于测试左移及提高测试覆盖率。With the escalation of enterprise business complexity and diversification of services, more and more module codes rely on many cases; at the same time, in the face of rapid iteration of project versions, rapid test support cannot be achieved; in this context, it is urgent to implement a reliable test The platform obtains the code changed by developers in this version iteration, automatically analyzes the impact of these codes, and helps to shift the test to the left and improve the test coverage.

现有技术中,对于新版本的应用的测试,通常会获取到新版本与旧版本的差异代码,再根据差异代码确定用来测试的测试用例。进而执行测试用例,根据执行结果与预期结果的对比,确定新版本的应用能否正常使用。进而还可确定出差异代码的测试覆盖率。In the prior art, for testing a new version of an application, the difference code between the new version and the old version is usually obtained, and then a test case for testing is determined according to the difference code. Then execute the test case, and determine whether the new version of the application can be used normally according to the comparison between the execution result and the expected result. Furthermore, the test coverage rate of the differential code can also be determined.

综上所述,现有的软件测试方法仅通过差异代码来确定测试用例,导致确定的测试用例不够完善,测试覆盖率较低。To sum up, the existing software testing methods only determine test cases through difference codes, resulting in incomplete test cases and low test coverage.

发明内容Contents of the invention

本申请实施例提供一种精准测试方法、装置、设备及介质,用于解决现有的软件测试方法仅通过差异代码来确定测试用例,导致确定的测试用例不够完善,测试覆盖率较低的问题。The embodiment of the present application provides a precise testing method, device, equipment and medium, which are used to solve the problem that the existing software testing method only determines the test cases through difference codes, resulting in insufficient test cases and low test coverage. .

第一方面,本申请实施例提供一种精准测试方法,应用于精准测试平台,所述方法包括:In the first aspect, the embodiment of the present application provides a precision testing method, which is applied to a precision testing platform, and the method includes:

获取待测版本应用的代码、所述待测版本应用与前一版本应用的差异代码、所述待测版本应用的堆栈数据;Obtain the code of the application version under test, the difference code between the application version under test and the previous version application, and the stack data of the application version under test;

根据所述待测版本应用的代码和所述堆栈数据,生成目标函数调用图;Generate a target function call graph according to the code of the application to be tested and the stack data;

根据所述差异代码和所述目标函数调用图,确定受影响函数;Determine the affected function according to the difference code and the target function call graph;

将所述受影响函数对应的接口标识发送至自动化测试平台。Send the interface identifier corresponding to the affected function to the automated testing platform.

在一种具体实施方式中,所述根据所述待测版本应用的代码和所述堆栈数据,生成目标函数调用图,包括:In a specific implementation manner, the generation of the target function call graph according to the code of the application under test and the stack data includes:

根据所述待测版本应用的代码,生成初始函数调用图;Generate an initial function call graph according to the code of the application of the version to be tested;

根据所述堆栈数据,生成实际函数调用图;Generating an actual function call graph according to the stack data;

根据所述初始函数调用图和所述实际函数调用图,生成所述目标函数调用图。Generate the target function call graph according to the initial function call graph and the actual function call graph.

在一种具体实施方式中,所述获取待测版本应用的代码、所述待测版本应用与前一版本应用的差异代码、所述待测版本应用的堆栈数据,包括:In a specific implementation manner, the acquiring the code of the application of the version to be tested, the difference code between the application of the version to be tested and the application of the previous version, and the stack data of the application of the version to be tested include:

接收服务器发送的应用发布成功消息,所述应用发布成功消息包括所述待测版本应用的版本标识;receiving an application release success message sent by the server, where the application release success message includes a version identifier of the application of the version to be tested;

根据所述版本标识,从代码仓库中获取所述待测版本应用的代码、所述待测版本应用与前一版本应用的差异代码;Obtain the code of the application of the version under test and the difference code between the application of the version under test and the application of the previous version from the code warehouse according to the version identification;

与所述服务器建立套接字socket连接;Establish a socket socket connection with the server;

通过所述socket通道,接收所述服务器发送的堆栈数据。Receive the stack data sent by the server through the socket channel.

在一种具体实施方式中,所述根据所述差异代码和所述目标函数调用图,确定受影响函数,包括:In a specific implementation manner, the determining the affected function according to the difference code and the target function call graph includes:

根据所述差异代码,确定所述差异代码中的差异函数;determining a difference function in the difference code according to the difference code;

对于每个差异函数,将所述目标函数调用图中,所述差异函数、间接调用所述差异函数的函数、直接调用所述差异函数的函数确定为所述受影响函数。For each difference function, in the target function call graph, the difference function, a function that indirectly calls the difference function, and a function that directly calls the difference function is determined as the affected function.

第二方面,本申请实施例提供一种精准测试方法,应用于自动化测试平台,所述方法包括:In the second aspect, the embodiment of the present application provides a precise testing method, which is applied to an automated testing platform, and the method includes:

接收精准测试平台发送的受影响函数对应的接口标识;Receive the interface identifier corresponding to the affected function sent by the precise test platform;

根据所述接口标识、接口标识与测试用例的对应关系,确定测试用例;Determine the test case according to the interface identifier, the corresponding relationship between the interface identifier and the test case;

使用所述测试用例对待测版本应用进行测试,生成测试报告。Use the test case to test the version application to be tested, and generate a test report.

在一种具体实施方式中,所述方法还包括输出差异代码中测试未覆盖的代码。In a specific implementation manner, the method further includes outputting codes not covered by tests in the difference codes.

第三方面,本申请实施例提供一种精准测试装置,包括:In the third aspect, the embodiment of the present application provides a precision testing device, including:

获取模块,用于获取待测版本应用的代码、所述待测版本应用与前一版本应用的差异代码、所述待测版本应用的堆栈数据;An acquisition module, configured to acquire the code of the application of the version to be tested, the difference code between the application of the version to be tested and the application of the previous version, and the stack data of the application of the version to be tested;

处理模块,用于:Processing modules for:

根据所述待测版本应用的代码和所述堆栈数据,生成目标函数调用图;Generate a target function call graph according to the code of the application to be tested and the stack data;

根据所述差异代码和所述目标函数调用图,确定受影响函数;Determine the affected function according to the difference code and the target function call graph;

通信模块,用于将所述受影响函数对应的接口标识发送至自动化测试平台。A communication module, configured to send the interface identifier corresponding to the affected function to the automated test platform.

第四方面,本申请实施例提供一种精准测试装置,包括:In the fourth aspect, the embodiment of the present application provides a precision testing device, including:

通信模块,用于接收精准测试平台发送的受影响函数对应的接口标识;The communication module is used to receive the interface identifier corresponding to the affected function sent by the precise test platform;

处理模块,用于:Processing modules for:

根据所述接口标识、接口标识与测试用例的对应关系,确定测试用例;Determine the test case according to the interface identifier, the corresponding relationship between the interface identifier and the test case;

使用所述测试用例对待测版本应用进行测试,生成测试报告。Use the test case to test the version application to be tested, and generate a test report.

第五方面,本申请实施例提供一种电子设备,包括:In a fifth aspect, the embodiment of the present application provides an electronic device, including:

处理器,存储器,通信接口;Processor, memory, communication interface;

所述存储器用于存储所述处理器的可执行指令;The memory is used to store executable instructions of the processor;

其中,所述处理器配置为经由执行所述可执行指令来执行第一方面任一项所述的精准测试方法。Wherein, the processor is configured to execute the precise testing method described in any one of the first aspect by executing the executable instructions.

第六方面,本申请实施例提供一种电子设备,包括:In a sixth aspect, the embodiment of the present application provides an electronic device, including:

处理器,存储器,通信接口;Processor, memory, communication interface;

所述存储器用于存储所述处理器的可执行指令;The memory is used to store executable instructions of the processor;

其中,所述处理器配置为经由执行所述可执行指令来执行权利要求第二方面任一项所述的精准测试方法。Wherein, the processor is configured to execute the precision testing method described in any one of the second aspect of the claim by executing the executable instructions.

第七方面,本申请实施例提供一种可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现第一方面至第二方面任一项所述的精准测试方法。In a seventh aspect, the embodiments of the present application provide a readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the precise testing method described in any one of the first aspect to the second aspect is implemented.

第八方面,本申请实施例提供一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时用于实现第一方面至第二方面任一项所述的精准测试方法。In an eighth aspect, an embodiment of the present application provides a computer program product, including a computer program, which is used to implement the precise testing method described in any one of the first aspect to the second aspect when the computer program is executed by a processor.

本申请实施例提供的精准测试方法、装置、设备及介质,通过精准测试平台根据待测版本应用的代码和堆栈数据,生成目标函数调用图;进而根据差异代码和目标函数调用图确定出受影响函数,再将受影响函数的接口标识发送至自动化平台。自动化平台根据接口标识可获取到测试用例,进而使用测试用例完成测试。本方案根据待测版本应用的代码和堆栈数据,生成目标函数调用图,进而根据目标函数调用图确定出测试用例,使得测试用例更加完善,有效提高了测试覆盖率。The precise testing method, device, equipment, and medium provided by the embodiments of the present application use the precise testing platform to generate the target function call graph according to the code and stack data of the version to be tested; and then determine the affected function, and then send the interface identifier of the affected function to the automation platform. The automation platform can obtain the test cases according to the interface identification, and then use the test cases to complete the test. This solution generates the target function call graph based on the code and stack data of the application to be tested, and then determines the test case according to the target function call graph, which makes the test case more perfect and effectively improves the test coverage.

附图说明Description of drawings

为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description These are some embodiments of the present application. Those skilled in the art can also obtain other drawings based on these drawings without any creative effort.

图1为本申请提供的精准测试方法实施例一的流程示意图;Fig. 1 is a schematic flow chart of the first embodiment of the precise testing method provided by the present application;

图2为本申请提供的精准测试方法实施例二的流程示意图;Figure 2 is a schematic flow diagram of the second embodiment of the precise testing method provided by the present application;

图3a为本申请提供的精准测试方法实施例三的流程示意图;Figure 3a is a schematic flow diagram of Embodiment 3 of the precise testing method provided by the present application;

图3b为本申请实施例提供的初始函数调用图;Figure 3b is the initial function call diagram provided by the embodiment of the present application;

图3c为本申请实施例提供的实际函数调用图;Figure 3c is the actual function call diagram provided by the embodiment of the present application;

图3d为本申请实施例提供的目标函数调用图;Figure 3d is a target function call diagram provided by the embodiment of the present application;

图4为本申请提供的精准测试方法实施例四的流程示意图;Figure 4 is a schematic flow diagram of Embodiment 4 of the precise testing method provided by the present application;

图5为本申请提供的精准测试装置实施例一的结构示意图;Figure 5 is a schematic structural view of Embodiment 1 of the precision testing device provided by the present application;

图6为本申请提供的精准测试装置实施例二的结构示意图;Fig. 6 is a schematic structural diagram of Embodiment 2 of the precision testing device provided by the present application;

图7为本申请提供的一种电子设备的结构示意图一;FIG. 7 is a first structural schematic diagram of an electronic device provided by the present application;

图8为本申请提供的一种电子设备的结构示意图二。FIG. 8 is a second structural schematic diagram of an electronic device provided by the present application.

具体实施方式Detailed ways

为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在根据本实施例的启示下作出的所有其他实施例,都属于本申请保护的范围。In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments It is a part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments made by persons of ordinary skill in the art under the inspiration of this embodiment fall within the protection scope of this application.

本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second", "third", "fourth", etc. (if any) in the description and claims of this application and the above drawings are used to distinguish similar objects and not necessarily Describe a particular order or sequence. It is to be understood that the data so used are interchangeable under appropriate circumstances such that the embodiments of the application described herein can be practiced in sequences other than those illustrated or described herein. Furthermore, the terms "comprising" and "having", as well as any variations thereof, are intended to cover a non-exclusive inclusion, for example, a process, method, system, product or device comprising a sequence of steps or elements is not necessarily limited to the expressly listed instead, may include other steps or elements not explicitly listed or inherent to the process, method, product or apparatus.

随着科技的迅速发展,应用程序的迭代升级速度越来越快,升级后的功能也越来越多,为了确保升级后的新版本的应用能够正常使用,需要对其进行测试。With the rapid development of science and technology, the iterative upgrade speed of the application program is getting faster and faster, and the upgraded functions are also increasing. In order to ensure that the updated version of the application can be used normally, it needs to be tested.

现有技术中,对于新版本的应用的测试,通常会获取到新版本与旧版本的差异代码,再根据差异代码确定用来测试的测试用例。进而执行测试用例,根据执行结果与预期结果的对比,确定新版本的应用能否正常使用。进而还可确定出差异代码的测试覆盖率。现有技术的方案仅通过差异代码来确定测试用例,导致确定的测试用例不够完善,测试覆盖率较低的问题。In the prior art, for testing a new version of an application, the difference code between the new version and the old version is usually obtained, and then a test case for testing is determined according to the difference code. Then execute the test case, and determine whether the new version of the application can be used normally according to the comparison between the execution result and the expected result. Furthermore, the test coverage rate of the differential code can also be determined. The solutions in the prior art determine the test cases only through difference codes, which leads to the problem that the determined test cases are not perfect and the test coverage rate is low.

针对现有技术中存在的问题,发明人在对精准测试方法进行研究的过程中发现,应用的代码在执行过程中,通常会动态产生新的代码,所以为了增加测试覆盖率,不仅通过待测版本应用的代码生成初始函数调用图,还根据待测版本应用在运行实际数据所产生的堆栈数据,来生成实际函数调用图,进而根据初始函数调用图和实际函数调用图生成目标函数调用图。所以在根据差异代码和目标函数调用图,可确定出更加精准的受影响函数,根据受影响函数对应的接口标识确定出的测试用例也更加精准,使用该测试用例进行测试,测试覆盖率也更高。基于上述发明构思,设计了本申请中的精准测试方案。Aiming at the problems existing in the existing technology, the inventor found in the process of researching the accurate testing method that the application code usually generates new code dynamically during the execution process, so in order to increase the test coverage, not only through the test The code of the version application generates the initial function call graph, and also generates the actual function call graph based on the stack data generated by the running actual data of the version application to be tested, and then generates the target function call graph based on the initial function call graph and the actual function call graph. Therefore, according to the difference code and the target function call graph, more accurate affected functions can be determined, and the test cases determined according to the interface identifiers corresponding to the affected functions are also more accurate. Using this test case for testing, the test coverage rate is also higher. high. Based on the above inventive concepts, the precise testing scheme in this application is designed.

示例性的,下面对本申请提供的精准测试方法的应用场景进行说明。Exemplarily, the following describes the application scenarios of the precise testing method provided by this application.

在该应用场景中,工作人员将待测版本应用进行发布后,服务器会向精准测试平台发送应用发布成功消息,该应用发布成功消息包括待测版本应用的版本标识。In this application scenario, after the staff releases the application of the version to be tested, the server will send an application release success message to the precise test platform, and the application release success message includes the version identification of the application of the version to be tested.

精准测试平台接收到应用发布成功消息后,就可对待测版本应用进行测试。根据版本标识,可从代码仓库中获取到待测版本应用的代码、待测版本应用与前一版本应用的差异代码。进而再与服务器进行交互,获取到待测版本应用运行实际数据所产生的堆栈数据。从而根据待测版本应用的代码和堆栈数据,生成目标函数调用图,根据差异代码和目标函数调用图,确定受影响函数,再将受影响函数对应的接口标识发送至自动化测试平台。After the precise test platform receives the message that the application is released successfully, it can test the application of the version to be tested. According to the version identification, the code of the application of the version to be tested and the difference code of the application of the version to be tested and the application of the previous version can be obtained from the code warehouse. And then interact with the server to obtain the stack data generated by the actual running data of the application of the version to be tested. In this way, the target function call graph is generated according to the code and stack data of the version to be tested, the affected function is determined according to the difference code and the target function call graph, and the interface identifier corresponding to the affected function is sent to the automated test platform.

自动化测试平台接收到接口标识后,根据该接口标识,查找到对应的测试用例,进而使用该测试用例对待测版本应用进行测试,得到测试报告,完成测试。After receiving the interface identifier, the automated test platform finds the corresponding test case according to the interface identifier, and then uses the test case to test the application of the version to be tested, obtains a test report, and completes the test.

需要说明的是,上述场景仅是本申请实施例提供的一种应用场景的示意,本申请实施例不对该场景中包括的各种设备的实际形态进行限定,也不对设备之间的交互方式进行限定,在方案的具体应用中,可以根据实际需求设定。It should be noted that the above scenario is only an illustration of an application scenario provided by the embodiment of the application, and the embodiment of the application does not limit the actual form of various devices included in the scenario, nor does it define the interaction mode between devices. Limitation, in the specific application of the scheme, can be set according to actual needs.

下面,通过具体实施例对本申请的技术方案进行详细说明。需要说明的是,下面这几个具体的实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例中不再赘述。Below, the technical solution of the present application will be described in detail through specific embodiments. It should be noted that the following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.

图1为本申请提供的精准测试方法实施例一的流程示意图,本申请实施例对精准测试平台根据待测版本应用的代码、待测版本应用与前一版本应用的差异代码、待测版本应用的堆栈数据,确定出受影响函数对应的接口标识;自动化测试平台根据受影响函数对应的接口标识确定出测试用例并进行测试的情况进行说明。本实施例中的方法可以通过软件、硬件或者软硬件结合的方式来实现。如图1所示,该精准测试方法具体包括以下步骤:Figure 1 is a schematic flow diagram of Embodiment 1 of the precise testing method provided by the present application. In this embodiment of the present application, the precise testing platform is applied according to the code of the version to be tested, the difference code between the application of the version to be tested and the application of the previous version, and the application of the version to be tested. The stack data of the affected function is determined to determine the interface identifier corresponding to the affected function; the automated test platform determines the test case and performs the test according to the interface identifier corresponding to the affected function. The method in this embodiment may be implemented by software, hardware, or a combination of software and hardware. As shown in Figure 1, the precise testing method specifically includes the following steps:

S101:精准测试平台获取待测版本应用的代码、待测版本应用与前一版本应用的差异代码、待测版本应用的堆栈数据。S101: The precise testing platform obtains the code of the application of the version to be tested, the code difference between the application of the version to be tested and the application of the previous version, and the stack data of the application of the version to be tested.

在本步骤中,待测版本应用在发布成功后,就需要对其进行测试,精准测试平台也就需要从代码仓库中获取待测版本应用的代码、待测版本应用与前一版本应用的差异代码;再与服务器进行交互,获取待测版本应用运行实际数据所产生的待测版本应用的堆栈数据。In this step, after the version of the application to be tested is successfully released, it needs to be tested, and the accurate test platform also needs to obtain the code of the application of the version to be tested and the difference between the application of the version to be tested and the previous version of the application from the code warehouse Code; and then interact with the server to obtain the stack data of the application under test generated by running the actual data of the application under test.

S102:精准测试平台根据待测版本应用的代码和堆栈数据,生成目标函数调用图。S102: The precise test platform generates a target function call graph according to the code and stack data of the application to be tested.

在本步骤中,精准测试平台获取到待测版本应用的代码、待测版本应用与前一版本应用的差异代码、待测版本应用的堆栈数据后,由于待测版本应用的代码中有函数调用的关系存在、堆栈数据中也存储了函数调用的数据,所以可根据待测版本应用的代码和堆栈数据分别生成一个函数调用图,再将两个函数调用图结合可得到目标函数调用图。In this step, after the Accurate Test Platform obtains the code of the application under test, the difference code between the application under test and the previous version, and the stack data of the application under test, since there are function calls in the code of the application under test The relationship exists, and the function call data is also stored in the stack data, so a function call graph can be generated respectively according to the application code and stack data of the version to be tested, and then the target function call graph can be obtained by combining the two function call graphs.

S103:精准测试平台根据差异代码和目标函数调用图,确定受影响函数。S103: The precise testing platform determines the affected function according to the difference code and the target function call graph.

在本步骤中,精准测试平台生成目标函数调用图后,为了更加精准的得到待测试版本应用相较于前一版本应用的影响范围,可根据差异代码中的函数,将目标函数调用图中,该函数、间接调用该函数的函数、直接调用该函数的函数确定为受影响函数。In this step, after the accurate test platform generates the target function call graph, in order to more accurately obtain the influence range of the application to be tested compared with the previous version, the target function call graph can be drawn according to the functions in the difference code, The function, the function that indirectly calls this function, and the function that directly calls this function are determined as the affected functions.

S104:精准测试平台将受影响函数对应的接口标识发送至自动化测试平台。S104: The accurate test platform sends the interface identifier corresponding to the affected function to the automated test platform.

在本步骤中,精准测试平台确定出受影响函数后,可查找到受影响函数对应的接口标识,为了后续确定出测试用例,需要将接口标识发送至自动化测试平台。In this step, after the precise test platform determines the affected function, it can find the interface identifier corresponding to the affected function. In order to determine the test case later, the interface identifier needs to be sent to the automated test platform.

S105:自动化测试平台接收精准测试平台发送的受影响函数对应的接口标识后,根据接口标识、接口标识与测试用例的对应关系,确定测试用例。S105: After the automated test platform receives the interface identifier corresponding to the affected function sent by the precision test platform, it determines the test case according to the interface identifier and the corresponding relationship between the interface identifier and the test case.

在本步骤中,精准测试平台将受影响函数对应的接口发送至自动化测试平台后,自动化测试平台可接收到该接口标识。由于自动化测试平台中存储有接口标识与测试用例的对应关系,所以自动化测试平台可根据接口标识、接口标识与测试用例的对应关系,确定出测试用例。In this step, after the precise testing platform sends the interface corresponding to the affected function to the automated testing platform, the automated testing platform can receive the interface identifier. Since the automated test platform stores the corresponding relationship between the interface identifier and the test case, the automated test platform can determine the test case according to the interface identifier and the corresponding relationship between the interface identifier and the test case.

S106:自动化测试平台使用测试用例对待测版本应用进行测试,生成测试报告。S106: The automated testing platform uses the test case to test the application of the version to be tested, and generates a test report.

在本步骤中,自动化测试平台确定出测试用例后,就可使用测试用例对待测版本应用进行测试,也就是使用被测版本应用运行测试用例,测试过程中可得到测试覆盖率,测试结束时生成测试报告。In this step, after the automated test platform determines the test case, it can use the test case to test the version application under test, that is, use the test version application to run the test case, the test coverage can be obtained during the test, and the test is generated at the end of the test. testing report.

自动化测试平台生成测试报告后,可将测试报告发送至测试人员,以便测试人员查看测试报告。After the test report is generated by the automated test platform, the test report can be sent to the tester so that the tester can view the test report.

需要说明的是,自动化测试平台完成测试后,还可将测试过程中产生的故障(BUG)发送至BUG管理平台,以便相应的工作人员能够根据BUG对待测版本应用进行修改。It should be noted that, after the automated test platform completes the test, it can also send the fault (BUG) generated during the test to the BUG management platform, so that the corresponding staff can modify the application of the version to be tested according to the BUG.

需要说明的是,测试报告中的内容可以包括测试覆盖率、测试用例、测试用例运行结果等。本申请实施例不对测试报告的内容进行限定,可根据实际情况进行确定。It should be noted that the content in the test report may include test coverage, test cases, test case running results, and the like. The embodiment of the present application does not limit the content of the test report, which can be determined according to the actual situation.

本实施例提供的精准测试方法,通过待测版本应用的代码和待测版本应用运行实际数据产生的堆栈数据,生成目标函数调用图;根据差异代码和目标函数调用图,确定受影响函数;再根据受影响函数对应的接口标识确定测试用例后,使用该测试用例进行测试。相较于现有技术仅使用差异代码来确定测试用例,本方案根据差异代码,以及待测版本应用的代码和待测版本应用运行实际数据产生的堆栈数据,确定测试用例,使得测试用例更加完善,有效提高了测试覆盖率。The precise testing method provided in this embodiment generates the target function call graph through the code of the application to be tested and the stack data generated by the actual data of the application to be tested; determines the affected function according to the difference code and the target function call graph; and then After determining the test case according to the interface identifier corresponding to the affected function, use the test case for testing. Compared with the existing technology that only uses difference codes to determine test cases, this solution determines test cases based on difference codes, the code of the application to be tested and the stack data generated by the actual data of the application to be tested, making the test cases more complete , effectively improving the test coverage.

图2为本申请提供的精准测试方法实施例二的流程示意图,在上述实施例的基础上,本申请实施例对精准测试平台从代码仓库中获取待测版本应用的代码、待测版本应用与前一版本应用的差异代码;与服务器进行交互,获取待测版本应用运行实际数据所产生的待测版本应用的堆栈数据的情况进行说明。如图2所示,实施例一中的步骤S101可通过以下步骤实现:Figure 2 is a schematic flow diagram of Embodiment 2 of the precise testing method provided by the present application. On the basis of the above-mentioned embodiments, the embodiment of the present application obtains the code of the application of the version to be tested from the code warehouse, the application of the version to be tested and The difference code of the previous version of the application; the interaction with the server to obtain the stack data of the test version of the application generated by the actual data of the test version of the application will be explained. As shown in Figure 2, step S101 in the first embodiment can be realized through the following steps:

S201:服务器向精准测试平台发送应用发布成功消息。S201: The server sends an application publishing success message to the precise testing platform.

在本步骤中,工作人员将待测版本应用发布到服务器上后,为了更快速的对待测版本应用进行测试,服务器会向精准测试平台发送应用发布成功消息,应用发布成功消息包括待测版本应用的版本标识。In this step, after the staff publishes the application of the version to be tested to the server, in order to test the application of the version to be tested more quickly, the server will send an application release success message to the precise test platform. The application release success message includes the application of the version to be tested The version ID of .

S202:精准测试平台接收服务器发送的应用发布成功消息后,根据版本标识,从代码仓库中获取待测版本应用的代码、待测版本应用与前一版本应用的差异代码。S202: After receiving the application release success message sent by the server, the accurate test platform obtains the code of the application of the version to be tested and the difference code of the application of the version to be tested and the application of the previous version from the code warehouse according to the version identification.

在本步骤中,服务器向精准测试平台发送应用发布成功消息后,精准测试平台就接收到该应用发布成功消息,由于应用发布成功消息中包括待测版本应用的版本标识,所以可根据该版本标识,从代码仓库中获取待测版本应用的代码、待测版本应用与待测版本应用的前一版本应用的差异代码。In this step, after the server sends the application release success message to the precision test platform, the precision test platform receives the application release success message. Since the application release success message includes the version identification of the version to be tested, it can be based on the version identification , acquire the code of the application of the version under test, and the difference code of the application of the version under test and the previous version of the application of the version under test from the code warehouse.

S203:精准测试平台与服务器建立套接字(socket)连接。S203: The precision test platform establishes a socket (socket) connection with the server.

S204:服务器通过socket通道,将堆栈数据发送至精准测试平台。S204: The server sends the stack data to the precision test platform through the socket channel.

在上述步骤中,为了能够实现精准测试平台与服务器之间的实时通信,需要精准测试平台与服务器建立socket连接。In the above steps, in order to realize the real-time communication between the precision test platform and the server, it is necessary to establish a socket connection between the precision test platform and the server.

由于待测版本应用在运行过程中会有反射等情况的发生,会产生待测版本应用的代码中未出现的函数,所以为了更加提高测试覆盖率,需要通过数据引流,将实际数据引入待测版本应用,也就是待测版本应用运行实际数据,在运行过程中,会产生堆栈数据。精准测试平台与服务器建立socket连接后,触发服务器将堆栈数据通过socket通道,发送至精准测试平台。Since the application under test will have reflections and other situations during the running process, functions that do not appear in the code of the application under test will be generated. Therefore, in order to further improve the test coverage, it is necessary to introduce actual data into the under test through data drainage. The version application, that is, the actual running data of the version application to be tested, will generate stack data during the running process. After the precise test platform establishes a socket connection with the server, the server is triggered to send the stack data to the precise test platform through the socket channel.

S205:精准测试平台通过socket通道,接收服务器发送的堆栈数据。S205: The precise test platform receives the stack data sent by the server through the socket channel.

在本步骤中,服务器将堆栈数据发送至精准测试平台后,精准测试平台可通过socket通道,接收服务器发送的堆栈数据。In this step, after the server sends the stack data to the precision test platform, the precision test platform can receive the stack data sent by the server through the socket channel.

需要说明的是,步骤S202与步骤S203至步骤S205的执行顺序可以是先执行步骤S202,再执行步骤S203至步骤S205;还可以是先执行步骤S203至步骤S205,再执行步骤S202;还可以是步骤S202与步骤S203至步骤S205同时执行。本申请实施例不对步骤S202与步骤S203至步骤S205的执行顺序进行限定,可根据实际情况进行设置。It should be noted that the execution order of step S202 and step S203 to step S205 may be to execute step S202 first, and then execute step S203 to step S205; it may also be to execute step S203 to step S205 first, and then execute step S202; it may also be Step S202 is executed simultaneously with steps S203 to S205. The embodiment of the present application does not limit the execution sequence of step S202 and step S203 to step S205, which can be set according to actual conditions.

本实施例提供的精准测试方法,精准测试平台通过代码仓库获取待测版本应用的代码、待测版本应用与前一版本应用的差异代码。精准测试平台通过socket通道与服务器交互获取待测版本应用运行实际数据产生的堆栈数据。有效提高了精准测试平台与服务器之间的通信效率。另外,使用待测版本应用的代码、差异代码、堆栈数据确定出受影响函数,有效提高了确定的受影响函数的精准度。In the precise testing method provided in this embodiment, the precise testing platform obtains the code of the application of the version to be tested and the difference code between the application of the version to be tested and the application of the previous version through the code warehouse. The precision test platform interacts with the server through the socket channel to obtain the stack data generated by the actual running data of the application version to be tested. Effectively improve the communication efficiency between the precise test platform and the server. In addition, the affected function is determined using the code, difference code, and stack data of the application to be tested, which effectively improves the accuracy of determining the affected function.

图3a为本申请提供的精准测试方法实施例三的流程示意图,在上述实施例的基础上,本申请实施例对精准测试平台根据待测版本应用的代码和堆栈数据分别生成函数调用图,在根据这两个函数调用图生成目标函数调用图的情况进行说明。如图3a所示,上述实施例一中的步骤S102可通过以下步骤实现:Figure 3a is a schematic flow diagram of the third embodiment of the precision testing method provided by the present application. On the basis of the above-mentioned embodiments, the embodiment of the present application generates a function call graph for the precision testing platform according to the code and stack data of the version to be tested, and in the The description will be given based on the generation of the target function call graph from these two function call graphs. As shown in Figure 3a, step S102 in the first embodiment above can be implemented through the following steps:

S301:根据待测版本应用的代码,生成初始函数调用图。S301: Generate an initial function call graph according to the application code of the version to be tested.

在本步骤中,精准测试平台获取到待测版本应用的代码后,由于代码中存在函数调用关系,所以可生成关于函数调用的有向无环图(Directed Acyclic Graph,简称:DAG),也就是初始函数调用图。In this step, after the Accurate Test Platform obtains the application code of the version to be tested, because there is a function call relationship in the code, it can generate a Directed Acyclic Graph (DAG for short) about the function call, that is, Initial function call graph.

示例性的,图3b为本申请实施例提供的初始函数调用图,如图3b所示,函数A调用函数B和函数C;函数B调用函数D;函数C调用函数E;函数D也调用函数E;函数E调用函数F和函数G。Exemplarily, Fig. 3b is the initial function call diagram provided by the embodiment of the present application. As shown in Fig. 3b, function A calls function B and function C; function B calls function D; function C calls function E; function D also calls function E; function E calls function F and function G.

S302:根据堆栈数据,生成实际函数调用图。S302: Generate an actual function call graph according to the stack data.

在本步骤中,精准测试平台获取到堆栈数据后,由于堆栈数据中包括函数调用的数据,所以可生成关于函数调用的DAG,也就是实际函数调用图。In this step, after the precision test platform obtains the stack data, since the stack data includes the data of the function call, it can generate a DAG about the function call, that is, the actual function call graph.

示例性的,图3c为本申请实施例提供的实际函数调用图,如图3c所示,函数C调用函数E;函数E调用函数G;函数G调用函数H;函数H调用函数I和函数J。Exemplarily, Fig. 3c is the actual function call diagram provided by the embodiment of the present application, as shown in Fig. 3c, function C calls function E; function E calls function G; function G calls function H; function H calls function I and function J .

需要说明的是,步骤S301与步骤S302的执行顺序可以是先执行步骤S301,再执行步骤S302;还可以是先执行步骤S302,再执行步骤S301;还可以是步骤S301与步骤S302同时执行。本申请实施例不对步骤S301与步骤S302的执行顺序进行限定,可根据实际情况进行设置。It should be noted that the execution order of step S301 and step S302 may be that step S301 is executed first, and then step S302 is executed; The embodiment of the present application does not limit the execution sequence of step S301 and step S302, which may be set according to actual conditions.

S303:根据初始函数调用图和实际函数调用图,生成目标函数调用图。S303: Generate a target function call graph according to the initial function call graph and the actual function call graph.

在本步骤中,精准测试平台得到初始函数调用图和实际函数调用图后,将初始函数调用图和实际函数调用图结合,可得到目标函数调用图。In this step, after the precision test platform obtains the initial function call graph and the actual function call graph, the target function call graph can be obtained by combining the initial function call graph with the actual function call graph.

示例性的,图3d为本申请实施例提供的目标函数调用图,在图3b的基础上,可到得函数A至函数G之间的调用关系,在图3c的基础上,可得到函数C、函数E、函数G至函数J之间的调用关系,所以根据图3b和图3c,可得到图3d。如图3d所示,图3d是在图3b和图3c中函数引用关系的并集,是在图3d中的函数引调用关系基础上,函数G调用函数H;函数H调用函数I和函数J。Exemplarily, Fig. 3d is the target function call diagram provided by the embodiment of the present application. On the basis of Fig. 3b, the calling relationship between function A to function G can be obtained, and on the basis of Fig. 3c, function C can be obtained , function E, function G to function J, so according to Fig. 3b and Fig. 3c, Fig. 3d can be obtained. As shown in Figure 3d, Figure 3d is the union of the function reference relationship in Figure 3b and Figure 3c, based on the function reference relationship in Figure 3d, function G calls function H; function H calls function I and function J .

可选的,在实际数据的数据量较大,使用这些实际数据运行待测版本应用,可实现待测版本应用的所有功能的情况下,可将实际函数调用图确定为目标函数调用图。Optionally, when the amount of actual data is relatively large, and all functions of the application version under test can be realized by running the application version under test using these actual data, the actual function call graph may be determined as the target function call graph.

本实施例提供的精准测试方法,根据待测版本应用的代码,生成初始函数调用图;再根据堆栈数据,生成实际函数调用图;进而将初始函数调用图和实际函数调用图结合得到目标函数调用图。使用该目标函数调用图确定受影响函数,有效提高了受影响函数的确定精准度。The precise testing method provided by this embodiment generates an initial function call graph according to the code of the version to be tested; then generates an actual function call graph according to the stack data; and then combines the initial function call graph and the actual function call graph to obtain the target function call picture. The affected function is determined by using the target function call graph, which effectively improves the determination accuracy of the affected function.

图4为本申请提供的精准测试方法实施例四的流程示意图,在上述实施例的基础上,本申请实施例对根据差异代码和目标函数调用图,确定受影响函数的情况进行说明。如图4所示,上述实施例一中的步骤S103可通过以下步骤实现:Fig. 4 is a schematic flowchart of Embodiment 4 of the precise testing method provided by the present application. On the basis of the above-mentioned embodiments, the embodiment of the present application explains the situation of determining the affected function according to the difference code and the target function call graph. As shown in Figure 4, step S103 in the first embodiment above can be implemented through the following steps:

S401:根据差异代码,确定差异代码中的差异函数。S401: Determine a difference function in the difference code according to the difference code.

在本步骤中,精准测试平台确定出目标函数调用图和差异代码后,为了确定出受影响函数,需要先根据差异代码,将差异代码中的函数确定为差异函数。In this step, after the precision test platform determines the target function call graph and the difference code, in order to determine the affected function, it needs to first determine the function in the difference code as the difference function according to the difference code.

S402:对于每个差异函数,将目标函数调用图中,差异函数、间接调用差异函数的函数、直接调用差异函数的函数确定为受影响函数。S402: For each difference function, determine the difference function, the function that indirectly calls the difference function, and the function that directly calls the difference function in the target function call graph as affected functions.

在本步骤中,精准测试平台确定出差异函数后,将目标函数调用图中,差异函数、间接调用差异函数的函数、直接调用差异函数的函数确定为受影响函数。In this step, after the precision test platform determines the difference function, it determines the difference function, the function that indirectly calls the difference function, and the function that directly calls the difference function in the target function call graph as the affected functions.

示例性的,在图3d的基础上,若确定出的差异函数为函数D,则受影响函数为函数D、函数B和函数A。若确定出的差异函数为函数G,则受影响的函数为函数G、函数D,函数D、函数C、函数B和函数A。Exemplarily, on the basis of FIG. 3d, if the determined difference function is function D, then the affected functions are function D, function B and function A. If the determined difference function is function G, the affected functions are function G, function D, function D, function C, function B and function A.

本实施例提供的精准测试方法,通过差异函数和目标函数调用图,确定受影响函数,有效提高了确定的受影响函数的精准度。The precise testing method provided in this embodiment determines the affected function through the difference function and the call graph of the target function, which effectively improves the accuracy of the determined affected function.

下面对自动化测试平台生成测试报告后,还输出差异代码中测试未覆盖的代码的情况进行说明。The following describes the case where the automated test platform also outputs the code not covered by the test in the difference code after the test report is generated.

自动化测试平台生成测试报告后,为了完善测试用例库,自动化测试平台还会将差异代码中测试未覆盖的代码输出,也就是发送至编写测试用例的工作人员,以便工作人员根据此测试未覆盖的代码设计测试用例,这样就可完善测试用例库,也可在后续测试时提高测试覆盖率。After the test report is generated by the automated test platform, in order to improve the test case library, the automated test platform will also output the code that is not covered by the test in the difference code, that is, send it to the staff who write the test case, so that the staff can test the uncovered code based on this test. Code design test cases, so that the test case library can be improved, and the test coverage can also be improved in subsequent tests.

本实施例提供的精准测试方法,通过将差异代码中测试未覆盖的代码输出,以便完善测试用例库,可提高后续进行测试的测试覆盖率。The precise testing method provided in this embodiment can improve the test coverage rate of subsequent tests by outputting the codes not covered by the test in the difference codes so as to improve the test case library.

下述为本申请装置实施例,可以用于执行本申请方法实施例。对于本申请装置实施例中未披露的细节,请参照本申请方法实施例。The following are device embodiments of the present application, which can be used to implement the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.

图5为本申请提供的精准测试装置实施例一的结构示意图。如图5所示,该精准测试装置50包括:FIG. 5 is a schematic structural diagram of Embodiment 1 of the precision testing device provided by the present application. As shown in Figure 5, the precision testing device 50 includes:

获取模块51,用于获取待测版本应用的代码、所述待测版本应用与前一版本应用的差异代码、所述待测版本应用的堆栈数据;An acquisition module 51, configured to acquire the code of the application of the version to be tested, the difference code between the application of the version to be tested and the application of the previous version, and the stack data of the application of the version to be tested;

处理模块52,用于:Processing module 52, for:

根据所述待测版本应用的代码和所述堆栈数据,生成目标函数调用图;Generate a target function call graph according to the code of the application to be tested and the stack data;

根据所述差异代码和所述目标函数调用图,确定受影响函数;Determine the affected function according to the difference code and the target function call graph;

通信模块53,用于将所述受影响函数对应的接口标识发送至自动化测试平台。The communication module 53 is configured to send the interface identifier corresponding to the affected function to the automated test platform.

进一步地,所述处理模块52,具体用于:Further, the processing module 52 is specifically used for:

根据所述待测版本应用的代码,生成初始函数调用图;Generate an initial function call graph according to the code of the application of the version to be tested;

根据所述堆栈数据,生成实际函数调用图;Generating an actual function call graph according to the stack data;

根据所述初始函数调用图和所述实际函数调用图,生成所述目标函数调用图。Generate the target function call graph according to the initial function call graph and the actual function call graph.

进一步地,所述通信模块53,还用于:Further, the communication module 53 is also used for:

接收服务器发送的应用发布成功消息,所述应用发布成功消息包括所述待测版本应用的版本标识;receiving an application release success message sent by the server, where the application release success message includes a version identifier of the application of the version to be tested;

进一步地,所述获取模块51,具体用于:Further, the acquiring module 51 is specifically used for:

根据所述版本标识,从代码仓库中获取所述待测版本应用的代码、所述待测版本应用与前一版本应用的差异代码;Obtain the code of the application of the version under test and the difference code between the application of the version under test and the application of the previous version from the code warehouse according to the version identification;

进一步地,所述通信模块53,还用于:Further, the communication module 53 is also used for:

与所述服务器建立套接字socket连接;Establish a socket socket connection with the server;

通过所述socket通道,接收所述服务器发送的堆栈数据。Receive the stack data sent by the server through the socket channel.

进一步地,所述处理模块52,具体还用于:Further, the processing module 52 is also specifically used for:

根据所述差异代码,确定所述差异代码中的差异函数;determining a difference function in the difference code according to the difference code;

对于每个差异函数,将所述目标函数调用图中,所述差异函数、间接调用所述差异函数的函数、直接调用所述差异函数的函数确定为所述受影响函数。For each difference function, in the target function call graph, the difference function, a function that indirectly calls the difference function, and a function that directly calls the difference function is determined as the affected function.

本实施例提供的精准测试装置,用于执行前述任一方法实施例中精准测试平台的技术方案,其实现原理和技术效果类似,在此不再赘述。The precision testing device provided in this embodiment is used to execute the technical solution of the precision testing platform in any of the foregoing method embodiments, and its implementation principle and technical effect are similar, and will not be repeated here.

图6为本申请提供的精准测试装置实施例二的结构示意图;如图6所示,该精准测试装置60还包括:Fig. 6 is a schematic structural diagram of the second embodiment of the precision testing device provided by the present application; as shown in Fig. 6, the precision testing device 60 also includes:

通信模块61,用于接收精准测试平台发送的受影响函数对应的接口标识;The communication module 61 is configured to receive the interface identifier corresponding to the affected function sent by the precise test platform;

处理模块62,用于:processing module 62 for:

根据所述接口标识、接口标识与测试用例的对应关系,确定测试用例;Determine the test case according to the interface identifier, the corresponding relationship between the interface identifier and the test case;

使用所述测试用例对待测版本应用进行测试,生成测试报告。Use the test case to test the version application to be tested, and generate a test report.

进一步地,所述通信模块61,还用于:Further, the communication module 61 is also used for:

输出差异代码中测试未覆盖的代码。Output the code not covered by tests in the diff code.

本实施例提供的精准测试装置,用于执行前述任一方法实施例中自动化测试平台的技术方案,其实现原理和技术效果类似,在此不再赘述。The precise testing device provided in this embodiment is used to implement the technical solution of the automated testing platform in any of the foregoing method embodiments, and its implementation principle and technical effect are similar, and will not be repeated here.

图7为本申请提供的一种电子设备的结构示意图一。如图7所示,该电子设备70包括:FIG. 7 is a first structural schematic diagram of an electronic device provided in the present application. As shown in Figure 7, the electronic device 70 includes:

处理器71,存储器72,以及通信接口73;Processor 71, memory 72, and communication interface 73;

所述存储器72用于存储所述处理器71的可执行指令;The memory 72 is used to store executable instructions of the processor 71;

其中,所述处理器71配置为经由执行所述可执行指令来执行前述任一方法实施例中精准测试平台的技术方案。Wherein, the processor 71 is configured to execute the technical solution of the precise test platform in any of the foregoing method embodiments by executing the executable instructions.

可选的,存储器72既可以是独立的,也可以跟处理器71集成在一起。Optionally, the memory 72 can be independent or integrated with the processor 71 .

可选的,当所述存储器72是独立于处理器71之外的器件时,所述电子设备70还可以包括:Optionally, when the memory 72 is a device independent of the processor 71, the electronic device 70 may further include:

总线74,存储器72和通信接口73通过总线74与处理器71连接并完成相互间的通信,通信接口73用于和其他设备进行通信。The bus 74, the memory 72 and the communication interface 73 are connected to the processor 71 through the bus 74 to complete mutual communication, and the communication interface 73 is used for communicating with other devices.

可选的,通信接口73具体可以通过收发器实现。通信接口用于实现数据库访问装置与其他设备(例如客户端、读写库和只读库)之间的通信。存储器可能包含随机存取存储器(random access memory,RAM),也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。Optionally, the communication interface 73 may specifically be implemented by a transceiver. The communication interface is used to realize the communication between the database access device and other devices (such as client, read-write library and read-only library). The memory may include a random access memory (random access memory, RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

总线74可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。总线可以分为地址总线、数据总线、控制总线等。为便于表示,图中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The bus 74 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus or the like. The bus can be divided into address bus, data bus, control bus and so on. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

上述的处理器可以是通用处理器,包括中央处理器CPU、网络处理器(networkprocessor,NP)等;还可以是数字信号处理器DSP、专用集成电路ASIC、现场可编程门阵列FPGA或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。Above-mentioned processor can be general-purpose processor, comprises central processing unit CPU, network processor (networkprocessor, NP) etc.; It can also be digital signal processor DSP, application-specific integrated circuit ASIC, field programmable gate array FPGA or other programmable Logic devices, discrete gate or transistor logic devices, discrete hardware components.

该电子设备用于执行前述任一方法实施例中精准测试平台的技术方案,其实现原理和技术效果类似,在此不再赘述。The electronic device is used to implement the technical solution of the precision test platform in any of the foregoing method embodiments, and its implementation principle and technical effect are similar, and will not be repeated here.

图8为本申请提供的一种电子设备的结构示意图二。如图8所示,该电子设备80包括:FIG. 8 is a second structural schematic diagram of an electronic device provided by the present application. As shown in Figure 8, the electronic device 80 includes:

处理器81,存储器82,以及通信接口83;Processor 81, memory 82, and communication interface 83;

所述存储器82用于存储所述处理器81的可执行指令;The memory 82 is used to store executable instructions of the processor 81;

其中,所述处理器81配置为经由执行所述可执行指令来执行前述任一方法实施例中自动化测试平台的技术方案。Wherein, the processor 81 is configured to execute the technical solution of the automated testing platform in any of the foregoing method embodiments by executing the executable instructions.

可选的,存储器82既可以是独立的,也可以跟处理器81集成在一起。Optionally, the memory 82 can be independent or integrated with the processor 81 .

可选的,当所述存储器82是独立于处理器81之外的器件时,所述电子设备80还可以包括:Optionally, when the memory 82 is a device independent of the processor 81, the electronic device 80 may further include:

总线84,存储器82和通信接口83通过总线84与处理器81连接并完成相互间的通信,通信接口83用于和其他设备进行通信。The bus 84, the memory 82 and the communication interface 83 are connected to the processor 81 through the bus 84 to complete mutual communication, and the communication interface 83 is used for communicating with other devices.

可选的,通信接口83具体可以通过收发器实现。通信接口用于实现数据库访问装置与其他设备(例如客户端、读写库和只读库)之间的通信。存储器可能包含随机存取存储器(random access memory,RAM),也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。Optionally, the communication interface 83 may specifically be implemented by a transceiver. The communication interface is used to realize the communication between the database access device and other devices (such as client, read-write library and read-only library). The memory may include a random access memory (random access memory, RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

总线84可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。总线可以分为地址总线、数据总线、控制总线等。为便于表示,图中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The bus 84 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus or the like. The bus can be divided into address bus, data bus, control bus and so on. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

上述的处理器可以是通用处理器,包括中央处理器CPU、网络处理器(networkprocessor,NP)等;还可以是数字信号处理器DSP、专用集成电路ASIC、现场可编程门阵列FPGA或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。Above-mentioned processor can be general-purpose processor, comprises central processing unit CPU, network processor (networkprocessor, NP) etc.; It can also be digital signal processor DSP, application-specific integrated circuit ASIC, field programmable gate array FPGA or other programmable Logic devices, discrete gate or transistor logic devices, discrete hardware components.

该电子设备用于执行前述任一方法实施例中自动化测试平台的技术方案,其实现原理和技术效果类似,在此不再赘述。The electronic device is used to implement the technical solution of the automated test platform in any of the foregoing method embodiments, and its implementation principle and technical effect are similar, and will not be repeated here.

本申请实施例还提供一种可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现前述任一方法实施例提供的技术方案。The embodiment of the present application also provides a readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the technical solution provided by any one of the foregoing method embodiments is implemented.

本申请实施例还提供一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时用于实现前述任一方法实施例提供的技术方案。An embodiment of the present application further provides a computer program product, including a computer program, and when the computer program is executed by a processor, it is used to implement the technical solution provided by any one of the foregoing method embodiments.

本领域普通技术人员可以理解:实现上述各方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成。前述的程序可以存储于一计算机可读取存储介质中。该程序在执行时,执行包括上述各方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the steps for implementing the above method embodiments can be completed by program instructions and related hardware. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiments; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other various media that can store program codes.

最后应说明的是:以上各实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述各实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或对其中部分或全部技术特征进行等同替换;而这些修改或替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit it; although the application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: It is still possible to modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the technical solutions of the various embodiments of the present application. scope.

Claims (12)

1.一种精准测试方法,其特征在于,应用于精准测试平台,所述方法包括:1. an accurate testing method, is characterized in that, is applied to accurate testing platform, and described method comprises: 获取待测版本应用的代码、所述待测版本应用与前一版本应用的差异代码、所述待测版本应用的堆栈数据;Obtain the code of the application version under test, the difference code between the application version under test and the previous version application, and the stack data of the application version under test; 根据所述待测版本应用的代码和所述堆栈数据,生成目标函数调用图;Generate a target function call graph according to the code of the application to be tested and the stack data; 根据所述差异代码和所述目标函数调用图,确定受影响函数;Determine the affected function according to the difference code and the target function call graph; 将所述受影响函数对应的接口标识发送至自动化测试平台。Send the interface identifier corresponding to the affected function to the automated testing platform. 2.根据权利要求1所述的方法,其特征在于,所述根据所述待测版本应用的代码和所述堆栈数据,生成目标函数调用图,包括:2. The method according to claim 1, wherein said generating a target function call graph according to the code of said version-to-be-tested application and said stack data comprises: 根据所述待测版本应用的代码,生成初始函数调用图;Generate an initial function call graph according to the code of the application of the version to be tested; 根据所述堆栈数据,生成实际函数调用图;Generating an actual function call graph according to the stack data; 根据所述初始函数调用图和所述实际函数调用图,生成所述目标函数调用图。Generate the target function call graph according to the initial function call graph and the actual function call graph. 3.根据权利要求1或2所述的方法,其特征在于,所述获取待测版本应用的代码、所述待测版本应用与前一版本应用的差异代码、所述待测版本应用的堆栈数据,包括:3. The method according to claim 1 or 2, wherein said obtaining the code of the application of the version to be tested, the difference code between the application of the version to be tested and the previous version of the application, and the stack of the application of the version to be tested data, including: 接收服务器发送的应用发布成功消息,所述应用发布成功消息包括所述待测版本应用的版本标识;receiving an application release success message sent by the server, where the application release success message includes a version identifier of the application of the version to be tested; 根据所述版本标识,从代码仓库中获取所述待测版本应用的代码、所述待测版本应用与前一版本应用的差异代码;Obtain the code of the application of the version under test and the difference code between the application of the version under test and the application of the previous version from the code warehouse according to the version identification; 与所述服务器建立套接字socket连接;Establish a socket socket connection with the server; 通过所述socket通道,接收所述服务器发送的堆栈数据。Receive the stack data sent by the server through the socket channel. 4.根据权利要求3所述的方法,其特征在于,所述根据所述差异代码和所述目标函数调用图,确定受影响函数,包括:4. The method according to claim 3, wherein the determining the affected function according to the difference code and the target function call graph comprises: 根据所述差异代码,确定所述差异代码中的差异函数;determining a difference function in the difference code according to the difference code; 对于每个差异函数,将所述目标函数调用图中,所述差异函数、间接调用所述差异函数的函数、直接调用所述差异函数的函数确定为所述受影响函数。For each difference function, in the target function call graph, the difference function, a function that indirectly calls the difference function, and a function that directly calls the difference function is determined as the affected function. 5.一种精准测试方法,其特征在于,应用于自动化测试平台,所述方法包括:5. A precise testing method is characterized in that being applied to an automated testing platform, the method comprises: 接收精准测试平台发送的受影响函数对应的接口标识;Receive the interface identifier corresponding to the affected function sent by the precise test platform; 根据所述接口标识、接口标识与测试用例的对应关系,确定测试用例;Determine the test case according to the interface identifier, the corresponding relationship between the interface identifier and the test case; 使用所述测试用例对待测版本应用进行测试,生成测试报告。Use the test case to test the version application to be tested, and generate a test report. 6.根据权利要求5所述的方法,其特征在于,所述方法还包括输出差异代码中测试未覆盖的代码。6. The method according to claim 5, further comprising outputting codes not covered by tests in the difference codes. 7.一种精准测试装置,其特征在于,包括:7. A precise testing device, characterized in that it comprises: 获取模块,用于获取待测版本应用的代码、所述待测版本应用与前一版本应用的差异代码、所述待测版本应用的堆栈数据;An acquisition module, configured to acquire the code of the application of the version to be tested, the difference code between the application of the version to be tested and the application of the previous version, and the stack data of the application of the version to be tested; 处理模块,用于:Processing modules for: 根据所述待测版本应用的代码和所述堆栈数据,生成目标函数调用图;Generate a target function call graph according to the code of the application to be tested and the stack data; 根据所述差异代码和所述目标函数调用图,确定受影响函数;Determine the affected function according to the difference code and the target function call graph; 通信模块,用于将所述受影响函数对应的接口标识发送至自动化测试平台。A communication module, configured to send the interface identifier corresponding to the affected function to the automated test platform. 8.一种精准测试装置,其特征在于,包括:8. A precision testing device, characterized in that it comprises: 通信模块,用于接收精准测试平台发送的受影响函数对应的接口标识;The communication module is used to receive the interface identifier corresponding to the affected function sent by the precise test platform; 处理模块,用于:Processing modules for: 根据所述接口标识、接口标识与测试用例的对应关系,确定测试用例;Determine the test case according to the interface identifier, the corresponding relationship between the interface identifier and the test case; 使用所述测试用例对待测版本应用进行测试,生成测试报告。Use the test case to test the version application to be tested, and generate a test report. 9.一种电子设备,其特征在于,包括:9. An electronic device, characterized in that it comprises: 处理器,存储器,通信接口;Processor, memory, communication interface; 所述存储器用于存储所述处理器的可执行指令;The memory is used to store executable instructions of the processor; 其中,所述处理器配置为经由执行所述可执行指令来执行权利要求1至4任一项所述的精准测试方法。Wherein, the processor is configured to execute the precise testing method according to any one of claims 1 to 4 by executing the executable instructions. 10.一种电子设备,其特征在于,包括:10. An electronic device, characterized in that it comprises: 处理器,存储器,通信接口;Processor, memory, communication interface; 所述存储器用于存储所述处理器的可执行指令;The memory is used to store executable instructions of the processor; 其中,所述处理器配置为经由执行所述可执行指令来执行权利要求5或6所述的精准测试方法。Wherein, the processor is configured to execute the precise testing method according to claim 5 or 6 by executing the executable instructions. 11.一种可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至6任一项所述的精准测试方法。11. A readable storage medium, on which a computer program is stored, characterized in that, when the computer program is executed by a processor, the precise testing method according to any one of claims 1 to 6 is realized. 12.一种计算机程序产品,其特征在于,包括计算机程序,所述计算机程序被处理器执行时用于实现权利要求1至6任一项所述的精准测试方法。12. A computer program product, characterized by comprising a computer program, which is used to implement the precision testing method according to any one of claims 1 to 6 when the computer program is executed by a processor.
CN202211145089.1A 2022-09-20 2022-09-20 Accurate testing methods, devices, equipment and media Pending CN115391228A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211145089.1A CN115391228A (en) 2022-09-20 2022-09-20 Accurate testing methods, devices, equipment and media

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211145089.1A CN115391228A (en) 2022-09-20 2022-09-20 Accurate testing methods, devices, equipment and media

Publications (1)

Publication Number Publication Date
CN115391228A true CN115391228A (en) 2022-11-25

Family

ID=84126692

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211145089.1A Pending CN115391228A (en) 2022-09-20 2022-09-20 Accurate testing methods, devices, equipment and media

Country Status (1)

Country Link
CN (1) CN115391228A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115905031A (en) * 2023-03-14 2023-04-04 云筑信息科技(成都)有限公司 Test case recommendation method based on accurate quality assurance system
CN117331849A (en) * 2023-12-01 2024-01-02 杭银消费金融股份有限公司 Testing method and system based on accurate analysis of codes

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115905031A (en) * 2023-03-14 2023-04-04 云筑信息科技(成都)有限公司 Test case recommendation method based on accurate quality assurance system
CN115905031B (en) * 2023-03-14 2023-06-23 云筑信息科技(成都)有限公司 Test case recommendation method based on accurate quality assurance system
CN117331849A (en) * 2023-12-01 2024-01-02 杭银消费金融股份有限公司 Testing method and system based on accurate analysis of codes
CN117331849B (en) * 2023-12-01 2024-02-27 杭银消费金融股份有限公司 Testing method and system based on accurate analysis of codes

Similar Documents

Publication Publication Date Title
CN104360920B (en) A kind of automatic interface testing method and device
CN108459962B (en) Code normalization detection method and device, terminal equipment and storage medium
AU2018310287A1 (en) Smart contract processing method and apparatus
WO2020062673A1 (en) Smart contract test method, storage medium, test terminal and test device
CN115391228A (en) Accurate testing methods, devices, equipment and media
CN110908908B (en) Method and device for testing micro-service Dubbo interface
CN112035344A (en) Multi-scenario test method, device, equipment and computer readable storage medium
CN109815141B (en) A test method and device
CN110955409B (en) Method and device for creating resources on cloud platform
CN111538651B (en) Interface testing method, device, server and storage medium
CN114610598A (en) Test method, test device, electronic equipment and computer readable storage medium
CN111240987B (en) Method and device for detecting migration program, electronic equipment and computer readable storage medium
CN114579194B (en) Exception handling method and system based on Spring remote call
US20160077900A1 (en) Checking undoability of an api-controlled computing system
CN111597020B (en) Application programming interface API debugging method and debugging terminal
CN114416545A (en) Method, apparatus and electronic device for determining test code coverage
CN114356774A (en) Target service test method, device, equipment and storage medium
CN113986744B (en) Method and device for testing sub-library sub-table assembly and storage medium
CN113760707B (en) Interface testing method, device, equipment and computer-readable storage medium
CN115640220A (en) Test method, device, electronic device and computer-readable storage medium
CN110275710B (en) Method and system for checking consistency of Java local interface, storage medium and terminal
CN114942887A (en) Program safety testing method, device, equipment and medium
CN114546877A (en) A software testing process management, testing method, device and electronic equipment
CN114281697A (en) Method and device for generating test data
CN108089989B (en) Path detection method, electronic device and readable storage medium

Legal Events

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