CN115391228A - Precise test method, device, equipment and medium - Google Patents

Precise test method, device, equipment and medium 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
version
application
function
code
tested
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/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • 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/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • 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

The application provides a precise test method, a device, equipment and a medium. According to the method, a target function call graph is generated through a precise test platform according to codes and stack data applied by a version to be tested; and determining an affected function according to the difference code and the target function call graph, and sending an interface identifier of the affected function to the automation platform. The automation platform can acquire the test case according to the interface identification, and then use the test case to complete the test. According to the scheme, the target function call graph is generated according to the codes and the stack data applied to the version to be tested, and then the test case is determined according to the target function call graph, so that the test case is more perfect, and the test coverage rate is effectively improved.

Description

Precise test method, device, equipment and medium
Technical Field
The present disclosure relates to the field of software testing, and in particular, to a method, an apparatus, a device, and a medium for accurate testing.
Background
With the upgrading of enterprise business complexity and the diversification of services, the module codes depend on more and more situations; meanwhile, rapid iteration of project versions is faced, and rapid test support cannot be achieved; under the background, a reliable test platform is urgently needed to be realized, codes changed by developers in the iteration of the version are obtained, the influence surfaces of the codes are automatically analyzed, and the left shift of the test and the test coverage rate are assisted.
In the prior art, for testing of an application of a new version, a difference code between the new version and an old version is usually obtained, and then a test case for testing is determined according to the difference code. And then executing the test case, and determining whether the application of the new version can be normally used or not according to the comparison of the execution result and the expected result. The test coverage of the difference code may also be determined.
In summary, the existing software testing method determines the test case only through the difference code, which results in that the determined test case is not perfect enough and the test coverage is low.
Disclosure of Invention
The embodiment of the application provides an accurate test method, an accurate test device, accurate test equipment and an accurate test medium, and aims to solve the problems that an existing software test method determines a test case only through a difference code, so that the determined test case is not perfect and the test coverage rate is low.
In a first aspect, an embodiment of the present application provides an accurate testing method, which is applied to an accurate testing platform, and the method includes:
acquiring a code of an application of a version to be tested, a difference code of the application of the version to be tested and an application of a previous version, and stack data of the application of the version to be tested;
generating a target function call graph according to the code of the version application to be tested and the stack data;
determining an affected function according to the difference code and the target function call graph;
and sending the interface identification corresponding to the affected function to an automatic test platform.
In a specific embodiment, the generating a target function call graph according to the code applied by the version to be tested and the stack data includes:
generating an initial function call graph according to the code applied by the version to be tested;
generating an actual function call graph according to the stack data;
and generating the target function call graph according to the initial function call graph and the actual function call graph.
In a specific embodiment, the obtaining a code of an application of a version to be tested, a difference code between the application of the version to be tested and an application of a previous version, and stack data of the application of the version to be tested includes:
receiving an application release success message sent by a server, wherein the application release success message comprises a version identifier of the application of the version to be detected;
acquiring the code of the application of the version to be detected and the difference code of the application of the version to be detected and the application of the previous version from a code warehouse according to the version identification;
establishing socket connection with the server;
and receiving stack data sent by the server through the socket channel.
In one embodiment, the determining an affected function according to the difference code and the objective function call graph includes:
determining a difference function in the difference codes according to the difference codes;
for each difference function, determining the difference function, the function indirectly calling the difference function, and the function directly calling the difference function in the target function call graph as the affected function.
In a second aspect, an embodiment of the present application provides an accurate testing method, which is applied to an automated testing platform, and the method includes:
receiving an interface identifier corresponding to an affected function sent by the accurate test platform;
determining a test case according to the interface identification, the corresponding relation between the interface identification and the test case;
and testing the application of the version to be tested by using the test case to generate a test report.
In a specific embodiment, the method further comprises outputting code of the difference code that is not covered by the test.
In a third aspect, an embodiment of the present application provides a precision test apparatus, including:
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring a code of a version application to be detected, a difference code of the version application to be detected and a previous version application and stack data of the version application to be detected;
a processing module to:
generating a target function call graph according to the code of the version application to be tested and the stack data;
determining an affected function according to the difference code and the target function call graph;
and the communication module is used for sending the interface identifier corresponding to the affected function to an automatic test platform.
In a fourth aspect, an embodiment of the present application provides a precision testing apparatus, including:
the communication module is used for receiving the interface identification corresponding to the affected function sent by the accurate test platform;
a processing module to:
determining a test case according to the interface identification, the corresponding relation between the interface identification and the test case;
and testing the application of the version to be tested by using the test case to generate a test report.
In a fifth aspect, an embodiment of the present application provides an electronic device, including:
a processor, a memory, a communication interface;
the memory is used for storing executable instructions of the processor;
wherein the processor is configured to perform the precision test method of any of the first aspect via execution of the executable instructions.
In a sixth aspect, an embodiment of the present application provides an electronic device, including:
a processor, a memory, a communication interface;
the memory is used for storing executable instructions of the processor;
wherein the processor is configured to perform the method of precision testing of any of the second aspect via execution of the executable instructions.
In a seventh aspect, an embodiment of the present application provides a readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the precision testing method described in any one of the first aspect to the second aspect.
In an eighth aspect, an embodiment of the present application provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the computer program is used to implement the precision testing method of any one of the first aspect to the second aspect.
According to the precision test method, the precision test device, the precision test equipment and the precision test medium, a target function call graph is generated through a precision test platform according to codes and stack data applied to a version to be tested; and determining an affected function according to the difference code and the target function call graph, and sending an interface identifier of the affected function to the automation platform. The automation platform can acquire the test case according to the interface identification, and then use the test case to complete the test. According to the scheme, the target function call graph is generated according to the codes and the stack data applied to the version to be tested, and then the test case is determined according to the target function call graph, so that the test case is more perfect, and the test coverage rate is effectively improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to these drawings without inventive exercise.
Fig. 1 is a schematic flowchart of a first embodiment of an accurate testing method provided in the present application;
fig. 2 is a schematic flowchart of a second embodiment of an accurate testing method provided in the present application;
fig. 3a is a schematic flowchart of a third embodiment of an accurate testing method provided in the present application;
FIG. 3b is an initial function call graph provided by an embodiment of the present application;
FIG. 3c is a diagram of an actual function call provided by an embodiment of the present application;
FIG. 3d is an objective function call graph provided by an embodiment of the present application;
fig. 4 is a schematic flowchart of a fourth embodiment of an accurate testing method provided in the present application;
fig. 5 is a schematic structural diagram of a precision testing apparatus according to a first embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a second precision testing apparatus according to an embodiment of the present disclosure;
fig. 7 is a first schematic structural diagram of an electronic device provided in the present application;
fig. 8 is a schematic structural diagram of an electronic device according to the present application.
Detailed Description
In order to make the objects, 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 with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments that can be made by one skilled in the art based on the embodiments in the present application in light of the present disclosure are within the scope of the present application.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims of the present application and in the above-described drawings (if any) are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
With the rapid development of science and technology, the iterative upgrade speed of an application program is faster and faster, the upgraded functions are more and more, and the application of the upgraded new version needs to be tested in order to ensure the application of the upgraded new version to be normally used.
In the prior art, for testing of a new version of an application, a difference code between the new version and an old version is usually obtained, and a test case for testing is determined according to the difference code. And then executing the test case, and determining whether the application of the new version can be normally used or not according to the comparison between the execution result and the expected result. The test coverage of the difference code may also be determined. The scheme in the prior art only determines the test cases through the difference codes, so that the determined test cases are not perfect and the test coverage rate is low.
Aiming at the problems in the prior art, the inventor finds that a new code is generated dynamically in the execution process of an applied code in the process of researching an accurate test method, so that in order to increase the test coverage rate, not only an initial function call graph is generated through the code applied by a version to be tested, but also an actual function call graph is generated according to stack data generated by running actual data by the version to be tested, and then a target function call graph is generated according to the initial function call graph and the actual function call graph. Therefore, a more accurate affected function can be determined according to the difference code and the target function call graph, the test case determined according to the interface identification corresponding to the affected function is more accurate, the test case is used for testing, and the test coverage rate is higher. Based on the inventive concept, the precise test scheme in the application is designed.
For example, an application scenario of the precision testing method provided by the present application is described below.
In the application scenario, after the staff issues the version application to be tested, the server sends an application issuance success message to the precise test platform, where the application issuance success message includes the version identifier of the version application to be tested.
And after the accurate test platform receives the successful application release message, the application of the version to be tested can be tested. According to the version identification, the code of the application of the version to be detected and the difference code of the application of the version to be detected and the application of the previous version can be obtained from the code warehouse. And then interacting with the server to obtain stack data generated by the actual data of the application running of the version to be tested. And determining the affected function according to the difference code and the target function call graph, and then sending the interface identifier corresponding to the affected function to the automatic test platform.
After receiving the interface identification, the automatic test platform searches the corresponding test case according to the interface identification, 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 in the embodiment of the present application, and the embodiment of the present application does not limit actual forms of various devices included in the scenario, nor limits an interaction manner between the devices, and in a specific application of a scheme, the setting may be performed according to actual requirements.
The technical solution of the present application will be described in detail below with reference to specific examples. 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 described in detail in some embodiments.
Fig. 1 is a schematic flowchart of a first accurate test method provided in the present application, where in the present application, an interface identifier corresponding to an affected function is determined for an accurate test platform according to a code of a version application to be tested, a difference code between the version application to be tested and a previous version application, and stack data of the version application to be tested; and the automatic test platform determines a test case according to the interface identification corresponding to the affected function and explains the test case. The method in this embodiment may be implemented by software, hardware, or a combination of software and hardware. As shown in fig. 1, the precise testing method specifically includes the following steps:
s101: the accurate test platform obtains codes of the application of the version to be tested, difference codes of the application of the version to be tested and the application of the previous version and stack data of the application of the version to be tested.
In this step, after the version application to be tested is successfully released, the version application needs to be tested, and the precise test platform needs to obtain the code of the version application to be tested and the difference code between the version application to be tested and the previous version application from the code warehouse; and interacting with the server to obtain stack data of the application of the version to be tested, which is generated by running actual data of the application of the version to be tested.
S102: and the accurate test platform generates a target function call graph according to the codes and the stack data applied by the version to be tested.
In this step, after the precise test platform obtains the code of the version application to be tested, the difference code between the version application to be tested and the previous version application, and the stack data of the version application to be tested, since the function call relationship exists in the code of the version application to be tested and the function call data is also stored in the stack data, a function call graph can be respectively generated according to the code and the stack data of the version application to be tested, and then the two function call graphs are combined to obtain the target function call graph.
S103: and the accurate test 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 version application to be tested compared with the previous version application, the function for indirectly calling the function, and the function for directly calling the function in the target function call graph may be determined as the influenced function according to the function in the difference code.
S104: and the accurate test platform sends the interface identification corresponding to the affected function to the automatic test platform.
In this step, after the precise test platform determines the affected function, the interface identifier corresponding to the affected function may be found, and in order to subsequently determine the test case, the interface identifier needs to be sent to the automated test platform.
S105: and after receiving the interface identification corresponding to the affected function sent by the accurate test platform, the automatic test platform determines the test case according to the corresponding relation among the interface identification, the interface identification and the test case.
In this step, after the precise test platform sends the interface corresponding to the affected function to the automated test platform, the automated test platform may receive the interface identifier. The corresponding relation between the interface identification and the test case is stored in the automatic test platform, so the automatic test platform can determine the test case according to the corresponding relation between the interface identification, the interface identification and the test case.
S106: and the automatic test platform tests the application of the version to be tested by using the test case to generate a test report.
In this step, after the automated test platform determines the test case, the test case may be used to test the version application to be tested, that is, the test case may be run by using the version application to be tested, the test coverage may be obtained during the test process, and a test report may be generated when the test is finished.
After the automatic test platform generates the test report, the test report can be sent to the tester, so that the tester can check the test report.
It should be noted that, after the automated testing platform completes the test, a fault (BUG) generated in the testing process can be sent to the BUG management platform, so that corresponding staff can modify the version application 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 operation results, and the like. The content of the test report is not limited in the embodiment of the application, and can be determined according to actual conditions.
According to the accurate test method provided by the embodiment, the target function call graph is generated through codes of the version application to be tested and stack data generated by running actual data of the version application to be tested; determining an affected function according to the difference code and the target function call graph; and determining a test case according to the interface identifier corresponding to the affected function, and then testing by using the test case. Compared with the prior art that the test case is determined only by using the difference codes, the test case is determined according to the difference codes, the codes applied to the version to be tested and the stack data generated by the actual data of the application running of the version to be tested, so that the test case is more perfect, and the test coverage rate is effectively improved.
Fig. 2 is a schematic flowchart of a second embodiment of an accurate testing method provided by the present application, where on the basis of the second embodiment, the present application acquires, from a code warehouse, a code of an application of a version to be tested and a difference code between the application of the version to be tested and an application of a previous version for an accurate testing platform; and interacting with the server to obtain the stack data of the application of the version to be tested generated by the actual data of the application of the version to be tested for explanation. As shown in fig. 2, step S101 in the first embodiment can be implemented by the following steps:
s201: and the server sends an application release success message to the accurate test platform.
In this step, after the worker releases the version application to be tested to the server, in order to test the version application to be tested more quickly, the server sends an application release success message to the accurate test platform, where the application release success message includes the version identifier of the version application to be tested.
S202: and after receiving the application release success message sent by the server, the precise test platform acquires 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 precise test platform, the precise test platform receives the application release success message, and the application release success message includes the version identifier of the version application to be tested, so that the code of the version application to be tested and the difference code between the version application to be tested and the previous version application of the version application to be tested can be obtained from the code warehouse according to the version identifier.
S203: the precision test platform establishes socket (socket) connection with the server.
S204: and the server sends the stack data to the accurate test platform through the socket channel.
In the above steps, in order to implement real-time communication between the precision test platform and the server, a socket connection needs to be established between the precision test platform and the server.
Because the version application to be tested has the occurrence of reflection and other conditions in the operation process, a function which does not appear in the code of the version application to be tested can be generated, in order to improve the test coverage rate, the actual data needs to be introduced into the version application to be tested through data drainage, namely the version application to be tested runs the actual data, and stack data can be generated in the operation process. After the socket connection is established between the accurate test platform and the server, the server is triggered to send the stack data to the accurate test platform through the socket channel.
S205: and the accurate test platform receives the stack data sent by the server through the socket channel.
In this step, after the server sends the stack data to the accurate test platform, the accurate test platform can receive the stack data sent by the server through the socket channel.
It should be noted that, the execution sequence of step S202 and steps S203 to S205 may be to execute step S202 first and then execute steps S203 to S205; step S203 to step S205 may be executed first, and then step S202 is executed; step S202 may also be performed simultaneously with step S203 to step S205. In the embodiment of the present application, the execution sequence of step S202 and steps S203 to S205 is not limited, and may be set according to actual situations.
In the accurate test method provided by this embodiment, the accurate test platform obtains the code of the version application to be tested and the difference code between the version application to be tested and the previous version application through the code warehouse. The accurate test platform is in interaction with the server through the socket channel to obtain stack data generated by actual data of application operation of the version to be tested. The communication efficiency between the accurate test platform and the server is effectively improved. In addition, the code, the difference code and the stack data applied by the version to be tested are used for determining the affected function, so that the accuracy of the determined affected function is effectively improved.
Fig. 3a is a schematic flow chart of a third embodiment of the precision testing method provided by the present application, and on the basis of the above embodiments, the present application describes a case where the precision testing platform generates function call graphs according to codes and stack data applied by a version to be tested, and generates a target function call graph according to the two function call graphs. As shown in fig. 3a, step S102 in the first embodiment can be implemented by the following steps:
s301: and generating an initial function call graph according to the code applied by the version to be tested.
In this step, after the precise test platform obtains the code of the version application to be tested, because the code has a function call relationship, a Directed Acyclic Graph (DAG for short) related to function call, that is, an initial function call Graph, can be generated.
For example, fig. 3B is an initial function call graph provided in the embodiment of the present application, and as shown in fig. 3B, a function a calls a function B and a function C; the function B calls a function D; the function C calls the function E; function D also calls function E; function E calls function F and function G.
S302: and generating an actual function call graph according to the stack data.
In this step, after the precise test platform acquires the stack data, because the stack data includes the data of the function call, a DAG related to the function call, that is, an actual function call graph, may be generated.
For example, fig. 3C is an actual function call graph provided in the embodiment of the present application, and as shown in fig. 3C, a function C calls a function E; the function E calls a function G; the function G calls a function H; function H calls function I and function J.
It should be noted that, the execution sequence of step S301 and step S302 may be to execute step S301 first, and then execute step S302; step S302 may be executed first, and then step S301 may be executed; step S301 may also be performed simultaneously with step S302. The execution sequence of step S301 and step S302 is not limited in the embodiment of the present application, and may be set according to actual situations.
S303: and generating an objective function call graph according to the initial function call graph and the actual function call graph.
In this step, after the initial function call graph and the actual function call graph are obtained by the accurate test platform, the initial function call graph and the actual function call graph are combined to obtain the target function call graph.
For example, fig. 3d is a target function call graph provided in the embodiment of the present application, and based on fig. 3b, a call relationship between a function a and a function G can be obtained, and based on fig. 3C, a call relationship between a function C, a function E, and a function G and a function J can be obtained, so according to fig. 3b and fig. 3C, fig. 3d can be obtained. As shown in fig. 3d, fig. 3d is a union of the function reference relations in fig. 3b and fig. 3c, and is that a function G calls a function H on the basis of the function reference relation in fig. 3 d; function H calls function I and function J.
Optionally, when the data size of the actual data is large, and the version application to be tested is run by using the actual data, all functions of the version application to be tested can be realized, the actual function call graph can be determined as the target function call graph.
According to the accurate test method provided by the embodiment, an initial function call graph is generated according to a code applied to a version to be tested; generating an actual function call graph according to the stack data; and combining the initial function call graph and the actual function call graph to obtain a target function call graph. The target function call graph is used for determining the affected function, and the determination accuracy of the affected function is effectively improved.
Fig. 4 is a schematic flowchart of a fourth embodiment of the precision testing method provided by the present application, and on the basis of the foregoing embodiments, the present application describes a case where an affected function is determined according to a difference code and an objective function call graph. As shown in fig. 4, step S103 in the first embodiment can be implemented by the following steps:
s401: from the difference code, a difference function in the difference code is determined.
In this step, after the precise test platform determines the target function call graph and the difference code, in order to determine the affected function, it is necessary to determine a function in the difference code as a difference function according to the difference code.
S402: for each difference function, the function for indirectly calling the difference function and the function for directly calling the difference function in the target function calling graph are determined as affected functions.
In this step, after the precision test platform determines the difference function, the function for indirectly calling the difference function, and the function for directly calling the difference function in the target function call graph are determined as the affected functions.
For example, on the basis of fig. 3D, if the determined difference function is the function D, the affected functions are the function D, the function B, and the function a. If the determined difference function is the function G, the affected functions are the function G, the function D, the function C, the function B and the function A.
According to the accurate test method provided by the embodiment, the affected function is determined through the difference function and the target function call graph, and the accuracy of the determined affected function is effectively improved.
The following describes a case where the automated test platform also outputs a code that is not covered by the test in the difference code after generating the test report.
After the automatic test platform generates the test report, in order to perfect the test case library, the automatic test platform also outputs codes which are not covered by the test in the difference codes, namely sends the codes to a worker compiling the test cases, so that the worker designs the test cases according to the codes which are not covered by the test, the test case library can be perfected, and the test coverage rate can be improved in the subsequent test.
The precise test method provided by the embodiment is used for outputting the codes which are not covered by the test in the difference codes so as to perfect the test case library, and the test coverage rate of the subsequent test can be improved.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Fig. 5 is a schematic structural diagram of a precision testing apparatus according to a first embodiment of the present disclosure. As shown in fig. 5, the precision testing apparatus 50 includes:
an obtaining module 51, configured to obtain a code of an application of a version to be tested, a difference code between the application of the version to be tested and an application of a previous version, and stack data of the application of the version to be tested;
a processing module 52 configured to:
generating a target function call graph according to the code of the version application to be tested and the stack data;
determining an affected function according to the difference code and the target function call graph;
and the communication module 53 is configured to send the interface identifier corresponding to the affected function to the automated testing platform.
Further, the processing module 52 is specifically configured to:
generating an initial function call graph according to the code applied by the version to be tested;
generating an actual function call graph according to the stack data;
and generating the target function call graph according to the initial function call graph and the actual function call graph.
Further, the communication module 53 is further configured to:
receiving an application release success message sent by a server, wherein the application release success message comprises a version identifier of the application of the version to be detected;
further, the obtaining module 51 is specifically configured to:
acquiring the code of the application of the version to be detected and the difference code of the application of the version to be detected and the application of the previous version from a code warehouse according to the version identification;
further, the communication module 53 is further configured to:
establishing socket connection with the server;
and receiving stack data sent by the server through the socket channel.
Further, the processing module 52 is specifically configured to:
determining a difference function in the difference code according to the difference code;
for each difference function, determining the difference function, the function indirectly calling the difference function, and the function directly calling the difference function in the target function call graph as the affected function.
The precision testing apparatus provided in this embodiment is used for executing the technical scheme of the precision testing platform in any one of the foregoing method embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 6 is a schematic structural diagram of a second precision testing apparatus according to an embodiment of the present disclosure; as shown in fig. 6, the precision testing apparatus 60 further includes:
the communication module 61 is configured to receive an interface identifier corresponding to an affected function sent by the precision test platform;
a processing module 62 for:
determining a test case according to the interface identification, the corresponding relation between the interface identification and the test case;
and testing the application of the version to be tested by using the test case to generate a test report.
Further, the communication module 61 is further configured to:
and outputting codes which are not covered by the test in the difference codes.
The precision testing apparatus provided in this embodiment is used for executing the technical scheme of the automated testing platform in any one of the foregoing method embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 7 is a first schematic structural diagram of an electronic device provided in the present application. As shown in fig. 7, the electronic apparatus 70 includes:
a processor 71, a memory 72, and a communication interface 73;
the memory 72 is used for storing executable instructions of the processor 71;
wherein the processor 71 is configured to execute the technical solution of the precision test platform in any of the foregoing method embodiments by executing the executable instructions.
Alternatively, the memory 72 may be separate or integrated with the processor 71.
Optionally, when the memory 72 is a device independent from the processor 71, the electronic device 70 may further include:
the bus 74, the memory 72 and the communication interface 73 are connected with the processor 71 through the bus 74 and communicate with each other, and the communication interface 73 is used for communicating with other devices.
Alternatively, the communication interface 73 may be implemented by a transceiver. The communication interface is used for realizing communication between the database access device and other equipment (such as a client, a read-write library and a read-only library). The memory may comprise Random Access Memory (RAM) and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The bus 74 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The processor may be a general-purpose processor, including a central processing unit CPU, a Network Processor (NP), and the like; but also a digital signal processor DSP, an application specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic device, discrete gate or transistor logic, discrete hardware components.
The electronic device is used for executing the technical scheme of the precision test platform in any one of the method embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 8 is a schematic structural diagram of an electronic device according to the present application. As shown in fig. 8, the electronic apparatus 80 includes:
a processor 81, a memory 82, and a communication interface 83;
the memory 82 is used for storing executable instructions of the processor 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.
Alternatively, the memory 82 may be separate or integrated with the processor 81.
Optionally, when the memory 82 is a device independent from the processor 81, the electronic device 80 may further include:
the bus 84, the memory 82 and the communication interface 83 are connected with the processor 81 through the bus 84 and communicate with each other, and the communication interface 83 is used for communicating with other devices.
Alternatively, the communication interface 83 may be implemented by a transceiver. The communication interface is used for realizing communication between the database access device and other equipment (such as a client, a read-write library and a read-only library). The memory may comprise Random Access Memory (RAM) and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The bus 84 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The processor may be a general-purpose processor, including a central processing unit CPU, a Network Processor (NP), and the like; but also a digital signal processor DSP, an application specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic device, discrete gate or transistor logic, discrete hardware components.
The electronic device is used for executing the technical scheme of the automated testing platform in any one of the method embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
The embodiment of the present application further provides a readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the technical solutions provided by any of the foregoing method embodiments.
The embodiment of the present application further provides a computer program product, which includes a computer program, and the computer program is used for implementing the technical solution provided by any of the foregoing method embodiments when being executed by a processor.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (12)

1. An accurate test method is applied to an accurate test platform, and the method comprises the following steps:
acquiring a code of an application of a version to be tested, a difference code of the application of the version to be tested and an application of a previous version, and stack data of the application of the version to be tested;
generating a target function call graph according to the code of the version application to be tested and the stack data;
determining an affected function according to the difference code and the target function call graph;
and sending the interface identification corresponding to the affected function to an automatic test platform.
2. The method of claim 1, wherein generating an objective function call graph from the code of the version-to-be-tested application and the stack data comprises:
generating an initial function call graph according to the code applied by the version to be tested;
generating an actual function call graph according to the stack data;
and generating the target function call graph according to the initial function call graph and the actual function call graph.
3. The method according to claim 1 or 2, wherein the obtaining of the code of the version application to be tested, the difference code of the version application to be tested and the previous version application, and the stack data of the version application to be tested comprises:
receiving an application release success message sent by a server, wherein the application release success message comprises a version identifier of the application of the version to be detected;
acquiring the code of the application of the version to be detected and the difference code of the application of the version to be detected and the application of the previous version from a code warehouse according to the version identification;
establishing socket connection with the server;
and receiving the stack data sent by the server through the socket channel.
4. The method of claim 3, wherein determining an affected function based on the difference code and the objective function call graph comprises:
determining a difference function in the difference codes according to the difference codes;
for each difference function, determining the difference function, the function indirectly calling the difference function, and the function directly calling the difference function in the target function call graph as the affected function.
5. An accurate test method is applied to an automatic test platform, and the method comprises the following steps:
receiving an interface identifier corresponding to an affected function sent by the accurate test platform;
determining a test case according to the interface identification, the corresponding relation between the interface identification and the test case;
and testing the application of the version to be tested by using the test case to generate a test report.
6. The method of claim 5, further comprising outputting code of the difference code that is not covered by the test.
7. An accurate testing device, comprising:
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring a code of a version application to be detected, a difference code of the version application to be detected and a previous version application and stack data of the version application to be detected;
a processing module to:
generating a target function call graph according to the code of the version application to be tested and the stack data;
determining an affected function according to the difference code and the target function call graph;
and the communication module is used for sending the interface identifier corresponding to the affected function to an automatic test platform.
8. An accurate testing device, comprising:
the communication module is used for receiving the interface identification corresponding to the affected function sent by the accurate test platform;
a processing module to:
determining a test case according to the interface identification, the corresponding relation between the interface identification and the test case;
and testing the application of the version to be tested by using the test case to generate a test report.
9. An electronic device, comprising:
a processor, a memory, a communication interface;
the memory is used for storing executable instructions of the processor;
wherein the processor is configured to perform the precise test method of any one of claims 1 to 4 via execution of the executable instructions.
10. An electronic device, comprising:
a processor, a memory, a communication interface;
the memory is used for storing executable instructions of the processor;
wherein the processor is configured to perform the precision testing method of claim 5 or 6 via execution of the executable instructions.
11. A readable storage medium on which a computer program is stored, which computer program, when being executed by a processor, carries out the precision testing method of any one of claims 1 to 6.
12. A computer program product comprising a computer program which, when executed by a processor, is adapted to carry out the precision testing method of any one of claims 1 to 6.
CN202211145089.1A 2022-09-20 2022-09-20 Precise test method, device, equipment and medium Pending CN115391228A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211145089.1A CN115391228A (en) 2022-09-20 2022-09-20 Precise test method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211145089.1A CN115391228A (en) 2022-09-20 2022-09-20 Precise test method, device, equipment and medium

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 Precise test method, device, equipment and medium

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
CN108459962B (en) Code normalization detection method and device, terminal equipment and storage medium
US20190324772A1 (en) Method and device for processing smart contracts
CN115391228A (en) Precise test method, device, equipment and medium
CN107145437B (en) Java annotation test method and device
CN111144839B (en) Project construction method, continuous integration system and terminal equipment
CN111026601A (en) Monitoring method and device for Java application system, electronic equipment and storage medium
US11422917B2 (en) Deriving software application dependency trees for white-box testing
CN110879781B (en) Program debugging method, device, electronic equipment and computer readable storage medium
CN107621963B (en) Software deployment method, software deployment system and electronic equipment
CN112395202B (en) Interface automation test method and device, computer equipment and storage medium
CN109558313B (en) Method and device for constructing abnormal test scene
CN111124871A (en) Interface test method and device
US20150339219A1 (en) Resilient mock object creation for unit testing
CN111382077B (en) Application program crash reason positioning method and device, electronic equipment and storage medium
CN111240987B (en) Method and device for detecting migration program, electronic equipment and computer readable storage medium
CN116627850B (en) Function debugging method and device, storage medium and electronic equipment
CN111399849B (en) Method and system for determining application program installation package
CN113360365A (en) Flow testing method and flow testing system
CN111367796B (en) Application program debugging method and device
CN114942887A (en) Program safety testing method, device, equipment and medium
CN109165127B (en) Problem interface positioning method and device and electronic equipment
CN112346994A (en) Test information correlation method and device, computer equipment and storage medium
CN112612474A (en) Product transplanting method and device, storage medium and electronic equipment
US8321844B2 (en) Providing registration of a communication
CN110597736A (en) Test data generation method and device

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