Regression interface query methods, devices, equipment and storage media

By displaying the application's runtime call information and call stack, the regression interface can be identified, solving the problems of low efficiency and insufficient accuracy in regression testing in large and complex systems, and achieving efficient and accurate regression interface query.

CN116383283BActive Publication Date: 2026-03-10CHINA UNITED NETWORK COMM GRP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-19
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

In regression testing of large and complex systems, determining the regression interface consumes a lot of time and manpower, and suffers from low efficiency and insufficient accuracy.

Method used

A regression interface query method is provided, which displays the call information of the application runtime, including the call information of the interface and method package path, responds to user operations to display the regression interface of the target method, and uses call stack information and traversal algorithm to determine the regression interface.

Benefits of technology

This improved the efficiency and accuracy of regression interface queries, reduced manpower costs, and ensured the accuracy and efficiency of regression testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116383283B_ABST
    Figure CN116383283B_ABST
Patent Text Reader

Abstract

This disclosure provides a regression interface query method, apparatus, device, and storage medium, relating to the field of computer technology. It improves the accuracy and efficiency of regression interface determination, thereby enhancing the efficiency and accuracy of regression testing. The method monitors the application to obtain its runtime call information and displays this information on a first display interface. Based on the interface package path corresponding to the application and the number of uncalled methods in the method package path within this call information, along with the user's first operation, a second display interface is displayed. This ensures that the call information of all methods corresponding to the application has been obtained, thus guaranteeing the accuracy of obtaining the regression interface based on the call information. Based on this call information, all methods that have called previously invoked methods can be obtained. Therefore, the regression interface corresponding to the target method input by the user can be quickly queried, thereby improving the efficiency of regression interface query.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computer, and particularly relates to a regression interface query method and device, equipment and a storage medium. BACKGROUND

[0002] In the software development process, a product or a requirement needs to be tested before being officially put into operation, so as to find possible defects before being released. When testing a product or a requirement, the new function of the product or the requirement and the associated old function need to be tested, such as function test, performance test, compatibility test, etc. Among them, the test on the associated old function is to ensure that the old function will not be affected by the new function and cause problems. For large application systems, due to the large number of business scenarios and the complex system functions, the old functions, old logics and old scenarios that need to be tested in regression test are also large, which consumes a lot of manpower and time.

[0003] At present, in order to improve the test efficiency, automatic test is used to replace manual test to improve the efficiency of regression test. However, for large and complex systems, due to the complex functions and the large number of logic scenarios, there are a large number of interfaces. It is also a large workload to check which interface method calls the target method from the large number of interfaces, and if the target method is indirectly called, it is more difficult to check and needs to consume more time to determine the interfaces that need to be tested. In the product or requirement, there may be a case that various internal methods are modified, and it is also possible that the internal methods called in the methods corresponding to each interface will change, so it is necessary to consume a lot of time and manpower to check and locate which interfaces need to be regression tested from the automatic test cases each time, and manual determination of regression interfaces may also be missed, resulting in low efficiency and inaccuracy of regression test. SUMMARY

[0004] In order to solve the problem that the existing technology cannot accurately and quickly determine the regression interface due to the complex call relationship in the application, thereby resulting in low efficiency and inaccuracy of regression test, the present disclosure provides a regression interface query method, device, equipment and storage medium, which is used to improve the accuracy and efficiency of regression interface determination, thereby improving the efficiency and accuracy of regression test.

[0005] To achieve the above purpose, the present disclosure adopts the following technical solutions:

[0006] In a first aspect, a regression interface query method is provided, and the method comprises:

[0007] display a first display interface; the first display interface is used to display a calling condition of the monitored application in a running state, the calling condition comprises a number of all un-called methods in an interface package path and a method package path corresponding to the application, and calling information of called methods in the method package path, the calling information is used to indicate all calling methods used to call the called methods;

[0008] in response to a first operation performed by a user when the number of all un-called methods in the interface package path and the method package path corresponding to the application in the calling condition is zero, a second display interface is displayed, the second display interface comprises an input area used to input a target method and a query button used to query a regression interface corresponding to the target method; the target method is a method in the method package path, the regression interface is an interface corresponding to a target calling method directly or indirectly calling the target method, and the target calling method is a method in the interface package path;

[0009] in response to a second operation performed by the user on the query button in the second display interface, all regression interfaces corresponding to the target method are displayed in a regression interface display area of the second display interface.

[0010] With reference to the first aspect, in a possible implementation manner, the method further comprises:

[0011] receiving a monitoring instruction of an application input by a user, the monitoring instruction is used to indicate a monitored application, and the monitoring instruction comprises an interface package path and a method package path corresponding to the application.

[0012] With reference to the first aspect, in a possible implementation manner, the method further comprises:

[0013] monitoring, based on the monitoring instruction, a method called in a running process of the monitored application, to obtain a number of all called methods in the interface package path and the method package path corresponding to the application;

[0014] calculating a difference between a total number of methods in the interface package path and the method package path corresponding to the application and the number of all called methods in the interface package path and the method package path corresponding to the application, to obtain a number of all un-called methods in the interface package path and the method package path corresponding to the application.

[0015] With reference to the first aspect, in a possible implementation manner, the process of determining the regression interface comprises:

[0016] obtain a call stack information of the target method, the call stack information comprising all calling methods of the target method;

[0017] traverse all calling methods from a calling method directly calling the target method as a starting point;

[0018] when the current traversed calling method is a method in the interface package path, stop traversing and determine that an interface corresponding to the current traversed calling method is a regression interface.

[0019] In a second aspect, a regression interface query device is provided, and the device comprises:

[0020] a first display module configured to display a first display interface, the first display interface being configured to display a calling condition of a monitored application during running, the calling condition comprising a number of all uncalled methods in an interface package path and a method package path corresponding to the application, and calling information of called methods in the method package path, the calling information being configured to indicate all calling methods, the calling methods being configured to call the called methods;

[0021] a second display module configured to display a second display interface in response to a first operation performed by a user on the calling information, the second display interface comprising an input area configured to input a target method, and a query button configured to query a regression interface corresponding to the target method, the target method being a method in the method package path, the regression interface being an interface corresponding to a target calling method directly or indirectly calling the target method, the target calling method being a method in the interface package path;

[0022] a third display module configured to display all regression interfaces corresponding to the target method in a regression interface display area of the second display interface in response to a second operation performed by the user on the query button in the second display interface.

[0023] With reference to the second aspect, in a possible implementation manner, the device further comprises:

[0024] a monitoring instruction receiving module configured to receive a monitoring instruction of an application by a user, the monitoring instruction being configured to indicate a monitored application, the monitoring instruction comprising an interface package path and a method package path corresponding to the application.

[0025] With reference to the second aspect, in a possible implementation manner, the first display module comprises:

[0026] The calling monitoring unit is configured to monitor the called methods in the running process of the monitored application based on the monitoring instruction, to obtain the number of all called methods in the interface package path and the method package path corresponding to the application.

[0027] The calculating unit is configured to calculate the difference between the total number of methods in the interface package path and the method package path corresponding to the application and the number of all called methods in the interface package path and the method package path corresponding to the application, to obtain the number of all uncalled methods in the interface package path and the method package path corresponding to the application.

[0028] With reference to the second aspect, in a possible implementation manner, the second display module includes:

[0029] The call stack information obtaining unit is configured to obtain the call stack information of the target method, the call stack information including all calling methods of the target method.

[0030] The traversing unit is configured to traverse all calling methods with the calling method directly calling the target method as a starting point.

[0031] The regression interface determining unit is configured to, when the currently traversed calling method is a method in the interface package path, stop the traversal and determine that the interface corresponding to the currently traversed calling method is a regression interface.

[0032] The third aspect provides a regression interface query device, which includes a processor and a memory; the memory is configured to store computer execution instructions; when the regression interface query device is running, the processor executes the computer execution instructions stored in the memory, so that the regression interface query device executes the regression interface query method described in the first aspect and any possible implementation manner of the first aspect.

[0033] The fourth aspect provides a computer readable storage medium, which stores instructions; when the instructions in the computer readable storage medium are executed by the processor of the regression interface query device, the regression interface query device can execute the regression interface query method described in the first aspect and any possible implementation manner of the first aspect.

[0034] In the present disclosure, the name of the regression interface query device does not constitute a limitation on the device or functional module itself, and in actual implementation, these devices or functional modules can appear in other names. As long as the functions of each device or functional module are similar to those of the present disclosure, they belong to the scope of the claims of the present disclosure and equivalent technologies.

[0035] These and other aspects of the present disclosure will become more fully understood from the following description.

[0036] The technical scheme provided by the present disclosure has at least the following beneficial effects: the regression interface query method comprises: displaying a first display interface; the first display interface is used to display the calling condition of the monitored application during runtime, and the calling condition comprises the interface package path and the method package path corresponding to the application, the number of all uncalled methods in the method package path, and the calling information of the called methods in the method package path, the calling information is used to indicate all calling methods, and the calling methods are used to call the called methods; in response to a first operation performed by a user when the number of all uncalled methods in the interface package path and the method package path corresponding to the application in the calling information is zero, a second display interface is displayed, the second display interface comprises an input area for inputting a target method and a query button for querying the regression interface corresponding to the target method; the target method is a method in the method package path, the regression interface is an interface corresponding to a target calling method that directly or indirectly calls the target method, and the target calling method is a method in the interface package path; in response to a second operation performed by the user on the query button in the second display interface, all regression interfaces corresponding to the target method are displayed in a regression interface display area of the second display interface. By monitoring the application, the calling condition of the application during runtime can be obtained, and the calling condition is displayed on the first display interface. Based on the number of all uncalled methods in the interface package path and the method package path corresponding to the application in the calling condition and the first operation performed by the user on the first display interface, the second display interface is displayed, so that when the user queries the regression interface of the target method based on the second display interface, the calling condition of all methods corresponding to the application has been obtained, and the accuracy of obtaining the regression interface corresponding to the target method based on the calling condition is ensured. Based on the calling information of the called methods in the method package path obtained by monitoring the application, all calling methods that call the called methods can be seen, and therefore, the regression interface corresponding to the target method input by the user can be directly and quickly queried based on the calling information, thereby improving the efficiency of regression interface query and the efficiency of regression testing. BRIEF DESCRIPTION OF DRAWINGS

[0037] Figure 1 A schematic diagram of a called relationship of an internal method provided by the present disclosure;

[0038] Figure 2 A flowchart of a regression interface query method provided by the present disclosure;

[0039] Figure 3An interface schematic diagram of a first display interface of a regression interface query method provided by the present disclosure;

[0040] Figure 4 An interface schematic diagram of a second display interface of a regression interface query method provided by the present disclosure;

[0041] Figure 5 An interface schematic diagram of a regression interface query method provided by the present disclosure;

[0042] Figure 6 An interface schematic diagram of a first display interface of another regression interface query method provided by the present disclosure;

[0043] Figure 7 A structural schematic diagram of a regression interface query device provided by the present disclosure;

[0044] Figure 8 A hardware structural schematic diagram of a regression interface query device provided by the present disclosure. DETAILED DESCRIPTION

[0045] The regression interface query method, device and storage medium provided by the embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.

[0046] The term "and / or" in the present document merely describes an association relationship of associated objects, and indicates that there can be three relationships, for example, A and / or B can represent three cases of A alone, A and B together, and B alone.

[0047] The terms "first", "second", and "third" and the like in the description of the present disclosure and the accompanying drawings are used to distinguish different objects or to distinguish different treatments of the same object, and are not used to describe a specific order of the object.

[0048] In addition, the terms "include" and "have" and any variations thereof mentioned in the description of the present disclosure are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but can optionally include other steps or units not listed, or can optionally include other steps or units inherent to the process, method, product or device.

[0049] It should be noted that in the embodiments of the present disclosure, the words "exemplary" or "for example" are used to mean serving as an example, instance, or illustration. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of the present disclosure should not be construed as being more preferred or having more advantages than other embodiments or design schemes. Rather, the use of "exemplary" or "for example" is intended to present relevant concepts in a concrete manner.

[0050] The following explains the terms involved in the present application.

[0051] 1. JVM (Java Virtual Machine) :

[0052] It is a specification for computing devices, which is a fictitious computer, and is implemented by simulating various computer functions on actual computers.

[0053] 2. Sandbox (Chinese name: Sandbox) :

[0054] It is an Aspect Oriented Programming (AOP) solution framework, which can perform related operations on programs in the JVM process without restarting and without invading the target JVM application. Aspect Oriented Programming is a technology that unifies the maintenance of program functions through pre-compilation and dynamic proxy during runtime.

[0055] 3. Regression testing

[0056] Regression testing refers to retesting after modifying old code to confirm that the modification has not introduced new errors or caused errors in other code. Regression interface refers to the associated interface that is affected after a certain method is modified, i.e., the interface that needs to be tested for regression.

[0057] In the software development process, testing is an essential step before a product or requirement is officially put online. A product or requirement must pass testing before it can be released and put online, and a product or requirement that does not pass testing is likely to have various defects after being released. The testing of a product or requirement includes relevant testing of the new functions and associated old functions of the product or requirement, such as function testing, performance testing, and compatibility testing. Regression testing of the old functions associated with a new function is performed to ensure that the old functions are not affected by the new function and do not have problems. Large-scale applications involve numerous and complex business scenarios, and the functions provided by the applications are also complex, so such applications have many interfaces that need to be tested for regression, resulting in low efficiency of regression testing.

[0058] To improve regression testing, automated testing is commonly used to replace manual testing, thereby increasing efficiency. Automated testing can be categorized into User Interface (UI) automated testing and API automated testing based on the object being tested. The success rate of UI automated testing heavily relies on the stability of page elements. However, due to frequent changes to front-end pages, the stability of page elements is relatively poor, resulting in limited benefits from UI automated testing and its uncommon use. In contrast, APIs are typically functionally stable, and therefore, API automated testing is frequently used to improve testing efficiency.

[0059] An API can be understood as a network request. For example, after opening an application, the first step is to log in or automatically log in. This login operation is essentially initiating a network request to the login API. Upon receiving this request, the application system dispatches it to the corresponding method within the login API to handle it. The method executes the code to implement the login logic and then returns a successful login response message to the application. API automation testing refers to executing network requests to APIs using code and verifying whether the returned results meet expectations. For example, in the login application example above, the tester opening the application, performing the login operation, and checking if the login was successful is a manual testing process, which can be considered a manual test case. To implement this using API automation testing, code is used to execute the network request to the login API and check the response message for a successful login, which is considered an automated API test case. API automation testing based on test cases is fast and stable, improving testing efficiency compared to manual testing. However, for large and complex applications, due to the complexity of application functions, numerous logical scenarios, and a large number of APIs, automated testing is more efficient. For example, when implementing a certain requirement, developers may need to modify an internal method, which may be called or indirectly called by methods corresponding to one or more interfaces. Figure 1 As shown, internal method D1 is directly called by interface method C1, and internal method E2 is indirectly called by interface method C1. Specifically, internal method E2 is called by internal method D2, which in turn is called by interface method C1. Internal method D1 is called not only by interface method C1 but also by interface method B1. Internal method E2 is indirectly called not only by interface method C1 but also by interface method A1. Specifically, internal method E2 is called by internal method C2, which in turn is called by interface method A1. In actual projects, the calling relationships of internal methods are more complex than... Figure 1 The calls shown are much more complex, and the call hierarchy between methods is also deeper. Finding the regression interfaces that need to be tested still requires a lot of manpower and time.

[0060] When an internal method is modified, related interfaces may be affected, such as... Figure 1 After the internal method E2 is modified, interfaces A1 and C1 may also be affected. Therefore, regression testing of these interfaces is required, and automated test cases for these interfaces need to be executed. In actual applications, there are a large number of interfaces in the interface layer, and identifying which regression interfaces call the target method is a significant undertaking. Furthermore, if the target method is called indirectly, the investigation becomes even more difficult, requiring more time and potentially resulting in missed regression interfaces. To address this, this application provides a regression interface query method. This method can directly display the regression interfaces corresponding to the user-input target method by analyzing the runtime call information of the monitored application. This allows for direct querying of interfaces requiring regression testing, eliminating the need for testers to sift through complex call logic, thus improving the efficiency and accuracy of regression interface identification.

[0061] like Figure 2 The diagram shows a flowchart of a regression interface query method provided in an embodiment of this application. The method includes the following steps (steps S110-S130):

[0062] Step S110: Display the first display interface.

[0063] The first display interface is used to display the call status of the monitored application during runtime. The call status includes the number of all uncalled methods in the interface package path and method package path corresponding to the application, as well as the call information of the methods that have been called in the method package path. The call information is used to indicate all calling methods, and all calling methods are used to call the methods that have been called.

[0064] The method package path and interface package path include all internal and interface methods corresponding to the application. For an application, all internal methods developed by developers are placed under a specified package path, i.e., the method package path; all interface methods are placed under a specified interface package path, which is usually named XXX.controller by convention. Therefore, by analyzing and monitoring the application's runtime process through the methods in the method package path and interface package path, all target methods and interface methods can be covered.

[0065] Please refer to Figure 3 , Figure 3 This is a schematic diagram of a first display interface provided in an embodiment of this application. The first display interface displays methods that have not been called, and the number of uncalled methods displayed is 12.

[0066] Understandably, the first display interface can also show other types of calls made by the monitored application during runtime, such as the ratio between the number of methods that have been called in the interface package path and method package path corresponding to the above application and the total number of methods in the interface package path and method package path.

[0067] Users can directly understand the application's running status by looking at the number of uncalled methods displayed on the first display interface. If the total number of uncalled methods is 0, it means that the application's running process has called all methods in the interface package path and method package path, and it also means that the monitoring of the application has covered all methods in the corresponding interface package path and method package path of the application.

[0068] Step S120: In response to the first operation performed when the number of all uncalled methods in the interface package path and method package path corresponding to the above application in the above calling situation is zero, the second display interface is displayed.

[0069] The second display interface includes an input area for inputting the target method and a query button for querying the regression interface corresponding to the target method; the target method is the method in the method package path, the regression interface is the interface corresponding to the target calling method that directly or indirectly calls the target method, and the target calling method is the method in the interface package path.

[0070] When the number of uncalled methods in the interface package path and method package path corresponding to the above application is zero, it indicates that the application's execution process has called all methods in the interface package path and method package path, and the user can perform the first operation at this time. For details, please continue reading. Figure 3 , Figure 3 The first display interface shown includes a "Confirm" button. When the number of uncalled methods is zero, the user can perform a first operation using this "Confirm" button. In response to this first operation, a second display interface is displayed; please refer to [link / reference]. Figure 4 , Figure 4 This is a schematic diagram of a second display interface provided in an embodiment of this application. Figure 4 The text box below the Chinese characters "Target Method:" is the input area for entering the target method. Users can enter the name of the target method they want to query in this input area by selecting or typing text. For example, the user enters the name of the target method as method D1. Then the user can... Figure 4 Use the query button shown to query the regression interface corresponding to the target method you entered.

[0071] Understandably, since the second display interface is displayed in response to the first operation, and the second display interface includes an input area for inputting the target method and a query button for querying the regression interface corresponding to the target method, if there are still uncalled methods in the interface package path and method package path corresponding to the application, that is, the number of uncalled methods is not zero, then there may be a situation where the uncalled method is the target method that the user is about to input. In this case, since the target method input by the user has not been called, it is also impossible to obtain all the calling methods of the target method, and therefore it is impossible to query the regression interface corresponding to the target method. As one implementation method, Figure 3 The "OK" button can be displayed only in the second display interface when the number of uncalled methods is zero, allowing the user to click it to execute the first operation. Furthermore, the "OK" button can also have an operable state and an inoperable state. For example, an operable state indicates that the number of uncalled methods is 0, and the user can click the "OK" button to execute the first operation; an inoperable state indicates that the number of uncalled methods is not zero, and the user cannot click the "OK" button. The shape or color of the "OK" button can be set to distinguish between the two operation states. For example, when the "OK" button is in the operable state, it can be displayed as a raised button shape; when the "OK" button is in the inoperable state, it can be displayed as a recessed button shape. Alternatively, when the "OK" button is in the operable state, it can be displayed as a red button; when the "OK" button is in the inoperable state, it can be displayed as a gray button.

[0072] Step S130: In response to the second operation performed by the user on the query button on the second display interface, display all regression interfaces corresponding to the target method in the regression interface display area of ​​the second display interface.

[0073] When users are on such Figure 4 After the query button in the second display interface is executed, the second operation is performed. Figure 4 The regression interface display area below the input area on the second display interface shows all regression interfaces corresponding to the target method. The regression interface is the interface corresponding to the target calling method that directly or indirectly calls the target method; the target calling method is the method in the aforementioned interface package path.

[0074] When testers click the query button, all regression interfaces corresponding to the target method will be displayed in the regression interface display area of ​​the second display interface. Once testers see the regression interfaces affected by the target method in this area, they can clearly identify which interfaces need regression testing. At this point, whether executing automated or manual test cases, regression testing verification can be completed specifically, saving significant time and manpower while ensuring accuracy.

[0075] In one possible implementation, the process of determining the above regression interface includes the following steps (steps 1-3):

[0076] Step 1: Obtain the call stack information of the target method. The call stack information includes all methods that call the target method.

[0077] In other words, the call information of methods that have been called in the obtained method package path can be the call stack information.

[0078] Step 2: Iterate through all calling methods, starting from the method that directly calls the target method mentioned above;

[0079] Step 3: When the currently traversed calling method is a method in the above interface package path, stop the traversal and determine that the interface corresponding to the currently traversed calling method is the regression interface.

[0080] In the embodiments provided in this application, the above method further includes the following steps:

[0081] Receive user monitoring instructions for the application. The monitoring instructions are used to instruct the application being monitored. The monitoring instructions include the interface package path and method package path corresponding to the application.

[0082] After obtaining the monitoring command corresponding to the user, the runtime process of the monitored application can be monitored based on the monitoring command to obtain the method calls made during the application's runtime. In one possible implementation, the above method also includes the following process:

[0083] First, based on the aforementioned monitoring instructions, the methods called during the operation of the monitored application are monitored to obtain the number of all called methods in the interface package path and method package path corresponding to the application. Then, the difference between the total number of methods in the interface package path and method package path corresponding to the application and the number of all called methods in the interface package path and method package path corresponding to the application is calculated to obtain the number of all uncalled methods in the interface package path and method package path corresponding to the application.

[0084] Please refer to Figure 5 , Figure 5 The included input fields allow users to enter information about the application being monitored. After entering the application information, the user clicks "Start Collector" to issue a monitoring command to begin monitoring the application. For example... Figure 5 The four input boxes are for the application's server address, application name, method package path, and interface package path, respectively. After entering the application information in the input boxes, the user clicks the "Start Collector" button to begin monitoring the application.

[0085] When monitoring an application, you can pull and save the code of project C, which provides monitoring functionality, in advance. Project C is a Maven project that integrates the jvm-sandbox package, which includes the ServiceMethodCollectorModule.java source file, defining the code that provides monitoring functionality for the application.

[0086] The system retrieves the method names of all methods under the corresponding "Method Package Path" and "Interface Package Path" input by the user, and stores these method names as a list in the first cache. Specifically, it scans all files under the "Method Package Path." If a file ends with the .class extension, it retrieves the filename and creates a class object of the corresponding class using reflection. If a file is a directory, it continues scanning down to the next level. It iterates through each created class object, retrieving the method names of all methods under that object and storing these method names as a list in the first cache. The same logic is applied to the "Interface Package Path," storing the method names of all methods under that path as a list in the second cache. Finally, it uses regular expressions to search and replace the contents of the variables `methodPackagePath` and `interfacePackagePath` in the `ServiceMethodCollectorModule.java` file with the contents entered by the user in the "Method Package Path" and "Interface Package Path" text boxes, respectively. For example, if the user inputs "method package path" and "interface package path" as cn.how2j.trend.kcard-admin.methods and cn.how2j.trend.kcard-admin.controlle respectively, after searching and replacing using regular expressions, the values ​​corresponding to methodPackagePath and interfacePackagePath in the ServiceMethodCollectorModule.java file will become cn.how2j.trend.kcard-admin.methods and cn.how2j.trend.kcard-admin.controlle respectively.

[0087] After using regular expressions to search and replace the contents of the variables `methodPackagePath` and `interfacePackagePath` in the `ServiceMethodCollectorModule.java` file, execute the `mvncleanpackage` command to package the project code in `ServiceMethodCollectorModule.java` into a JAR file, for example, named `collector.jar`. Then, remotely copy `collector.jar` to the `~ / .sandbox-module` directory of the server where the monitored application resides. The address of the server where the monitored application resides is the address of the user-defined server. Figure 5The content entered in the "Server Address" text box. Assuming the server address of the monitored application is 130.54.3.129, the command for remote copying is: `scptar get / collector.jar root@130.54.3.129:~ / .sandbox-module / `.

[0088] Mount the JVM sandbox to the process of the application being monitored. Let's assume the application name is kcard-ad min. Figure 5 If the content entered in the "Application Name" text box is correct, then the mount command is: `ps -ef|grep-ikcard-admin|awk'{print$2}'|. / sandbox.sh -p`. Here, `ps -ef` is used to obtain information about all processes, `grep-ikcard-admin` is used to filter processes containing the `kcard-admin` application, `awk'{print$2}'` is used to obtain the process ID (the second column of the process information), and `. / sandbox.sh -p` mounts the sandbox to the process corresponding to the specified process ID. Therefore, if the process ID of the `kcard-admin` application is 64229, then the command triggered after the user clicks "Start Collector" is: `. / sandbox.sh -p64229 -d'service-method-collector / beginCollect'`. At this time, all methods under the method package path corresponding to the application mounted in the sandbox (such as kcard-admin), such as all methods under cn.how2j.trend.kcard-admin.methods, will be monitored. When a method under the method package path is called and executed, in addition to the normal logic of the method code being executed, the call information of the methods that have been called will also be obtained.

[0089] When the number of uncalled methods in the application's corresponding interface package path and method package path is zero, the target regression interface corresponding to the target method can be obtained based on the user-input target method and the call information of the methods that have already been called. The specific process of obtaining the target regression interface is as follows:

[0090] First, obtain the method name of the target method. Then, based on the method name, obtain the call stack information of the upper-level callers of the target method. For example, if the target method is 'a', and 'd' calls 'c', which in turn calls 'b', and 'b' ultimately calls the target method 'a', then the call stack information for the target method 'a' is 'bcd', meaning the first caller is 'b', which directly called the target method, and the subsequent calls are ordered sequentially.

[0091] The regression interface corresponding to the target method can be determined by traversing the call stack information. For example, starting with the method that directly calls the target method, the call stack information is traversed, and it is determined whether the currently traversed call method is an interface method. If the currently traversed method is an interface method in the interface package path, it means that the interface corresponding to this call method is the regression interface corresponding to the target method. At this time, the method name of the call method can be written to the regression interface list cache of the target method, and then the traversal ends. If the currently traversed call method is neither a method in the interface package path nor a method in the method package path, the traversal ends directly. If the currently traversed call method is neither a method in the interface package path nor a method in the method package path, it means that the call method is another internal method. Even if the traversal continues, it is impossible to traverse to an interface method, so continuing the traversal is meaningless.

[0092] Understandably, due to the complexity of the call relationships, the target method may contain multiple call stack information. Each call stack information of the target method is traversed to determine the regression interface. For example, if the target method is 'a', and 'd' calls 'c', 'c' calls 'b', and 'b' ultimately calls 'a', then the call stack information for target method 'a' is 'bcd'. Furthermore, it's possible that 'm' calls 'b', and 'b' ultimately calls 'a', in which case the call stack information for target method 'a' is 'bm'. Therefore, target method 'a' has two call stack information: 'bcd' and 'bm'. After traversing each call stack information, if 'd' is an interface method, only one regression interface can be determined—the interface corresponding to 'd'. If both 'd' and 'm' are interface methods, then two regression interfaces can be determined: the interface corresponding to 'd' and the interface corresponding to 'm'.

[0093] Since the first display interface shows the call status of the monitored application during runtime, and the application's execution process takes a certain amount of time, the call status displayed in the first display interface can be obtained in real time. For example, the first display interface sends a progress query request every second to check the currently obtained real-time call status.

[0094] Each time the first display interface retrieves the call status, it can do so through the following process and then display the retrieved call status on the first display interface.

[0095] Specifically, based on the above examples, when the user is based on Figure 5After inputting the "Method Package Path" and "Interface Package Path" on the interface shown, the system retrieves the method names of all methods under the corresponding "Method Package Path" and "Interface Package Path," and saves these method names as lists in the first cache and the second cache, respectively. When displaying the first display interface, the system first reads the list of method names under the "Method Package Path" stored in the first cache, and then reads the list of method names under the "Interface Package Path" stored in the second cache. It then reads the method names of all called methods stored in the cache to retrieve the called interface methods, which are the methods in the interface path package. The system removes duplicate interface method names from the cache to obtain the called interface methods. Based on the information retrieved, the collection progress can be calculated, which is the ratio of the number of collected methods to the number of methods in the interface path package and the total number of methods in the interface path package. This value is then displayed on the first display interface, as shown below. Figure 6 The call progress shown is this ratio. Furthermore, as... Figure 6 As shown, based on the information read above, methods that have not been called in the method path package and methods that have not been called in the interface path package can also be calculated.

[0096] As can be seen, the above mainly describes the technical solutions provided by the embodiments of this disclosure from a methodological perspective. To achieve the above functions, it includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, in conjunction with the modules and algorithm steps of the various examples described in the embodiments disclosed herein, the embodiments of this disclosure can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this disclosure.

[0097] This embodiment of the disclosure can divide the regression interface query device into functional modules according to the above method example. For example, each function can be divided into its own functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. Optionally, the module division in this embodiment of the disclosure is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.

[0098] like Figure 7 As shown, a regression interface query device 700 is provided in an embodiment of this disclosure. The device includes:

[0099] The first display module 710 is used to display a first display interface; the first display interface is used to display the calling status of the monitored application during runtime, the calling status includes the number of all uncalled methods in the interface package path and method package path corresponding to the application, and the calling information of the methods that have been called in the method package path, the calling information is used to indicate all calling methods, and all calling methods are used to call the methods that have been called.

[0100] The second display module 720 is configured to respond to a first operation performed by the user when the number of uncalled methods in the interface package path and method package path corresponding to the application in the above-mentioned calling situation is zero, and to display a second display interface. The second display interface includes an input area for inputting a target method and a query button for querying a regression interface corresponding to the target method. The target method is a method in the method package path, and the regression interface is an interface corresponding to the target calling method that directly or indirectly calls the target method. The target calling method is a method in the interface package path.

[0101] The third display module 730 is used to respond to the second operation performed by the user on the query button on the second display interface and to display all regression interfaces corresponding to the target method in the regression interface display area of ​​the second display interface.

[0102] Optionally, in one possible implementation, the above-mentioned apparatus further includes:

[0103] The monitoring instruction receiving module is used to receive monitoring instructions from users for the application. The monitoring instructions are used to instruct the application being monitored, and the monitoring instructions include the interface package path and method package path corresponding to the application.

[0104] Optionally, in one possible implementation, the first display module includes:

[0105] The monitoring unit is invoked to monitor the methods called during the operation of the monitored application based on the above monitoring instructions, so as to obtain the interface package path and the number of all methods that have been called in the method package path corresponding to the application.

[0106] The calculation unit is used to calculate the difference between the total number of methods in the interface package path and method package path corresponding to the application and the number of all methods that have been called in the interface package path and method package path corresponding to the application, so as to obtain the number of all methods that have not been called in the interface package path and method package path corresponding to the application.

[0107] Optionally, in one possible implementation, the second display module includes:

[0108] The call stack information acquisition unit is used to acquire the call stack information of the target method, which includes all calling methods that call the target method.

[0109] The traversal unit is used to traverse all calling methods, starting from the calling method that directly calls the target method mentioned above.

[0110] The regression interface determination unit is used to stop traversing and determine the interface corresponding to the currently traversed calling method as the regression interface when the currently traversed calling method is a method in the above interface package path.

[0111] This disclosure provides a regression interface query device for executing the method required by any device in the aforementioned data integrity determination system. This regression interface query device may be the regression interface query device described in this disclosure, or a module within a regression interface query apparatus; it may also be a chip within a regression interface query device, or other apparatus for executing the regression interface query method; this disclosure does not limit its scope.

[0112] When implemented in hardware, the specific implementation method of the regression interface query device in this application embodiment is as follows: Figure 8 As shown, Figure 8 This is a schematic diagram of the structure of a regression interface query device 800 provided in an embodiment of the present disclosure. The regression interface query device 800 includes at least one processor 801, a communication line 802, and at least one communication interface 804, and may also include a memory 803. The processor 801, memory 803, and communication interface 804 are connected to each other via the communication line 802.

[0113] The processor 801 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present disclosure, such as one or more digital signal processors (DSPs), or one or more field-programmable gate arrays (FPGAs).

[0114] Communication line 802 may include a path for transmitting information between the aforementioned components.

[0115] The communication interface 804 is used to communicate with other devices or communication networks. It can use any transceiver-like device, such as Ethernet, radio access network (RAN), wireless local area network (WLAN), etc.

[0116] The memory 803 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of including or storing desired program code having the form of instructions or data structures and accessible by a computer, but not limited thereto.

[0117] In one possible design, the memory 803 can exist independently of the processor 801, meaning the memory 803 can be an external memory of the processor 801. In this case, the memory 803 can be connected to the processor 801 via a communication line 802 to store execution instructions or application code, and its execution is controlled by the processor 801 to implement the regression interface query method provided in the following embodiments of this disclosure. In another possible design, the memory 803 can also be integrated with the processor 801, meaning the memory 803 can be an internal memory of the processor 801. For example, the memory 803 can be a cache, used to temporarily store some data and instruction information.

[0118] As one possible implementation, processor 801 may include one or more CPUs, for example Figure 8 CPU0 and CPU1 in the example. As another possible implementation, the regression interface query device 800 may include multiple processors, such as... Figure 8 The processors 801 and 807 are included. Alternatively, the regression interface query device 800 may also include an output device 805 and an input device 806.

[0119] Through the above description of the implementation methods, those skilled in the art will clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the network node can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, modules, and network nodes described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0120] This disclosure also provides a computer-readable storage medium storing instructions that, when executed by a computer, perform each step of the method flow shown in the above method embodiments.

[0121] The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), registers, hard disks, optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing, or any other form of computer-readable storage medium in the art. An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium may also be a component of the processor. The processor and the storage medium may reside in an application-specific integrated circuit (ASIC). In this embodiment of the disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0122] Embodiments of this disclosure provide a chip including a processor and a communication interface, the communication interface being coupled to the processor. The processor is used to run computer programs or instructions to implement the regression interface query method as described in the above method embodiments. Since the apparatus, device, computer-readable storage medium, and computer program product in the embodiments of this disclosure can be applied to the above methods, the technical effects obtained can also be referred to the above method embodiments, and the embodiments of this disclosure will not be repeated here.

[0123] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0124] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0125] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0126] The above description is merely a specific embodiment of this disclosure, but the scope of protection of this disclosure is not limited thereto. Any changes or substitutions within the technical scope disclosed in this disclosure should be included within the scope of protection of this disclosure. Therefore, the scope of protection of this disclosure should be determined by the scope of the claims.

Claims

1. A method of querying a regression interface, the method comprising: The method comprises: displaying a first display interface; the first display interface is used to display a calling condition of a monitored application during running, the calling condition comprising a number of all un-called methods in an interface package path and a method package path corresponding to the application, and calling information of called methods in the method package path, the calling information being used to indicate all calling methods used to call the called methods; in response to a first operation performed by a user when the number of all un-called methods in the interface package path and the method package path corresponding to the application in the calling condition is zero, displaying a second display interface, the second display interface comprising an input area used to input a target method and a query button used to query a regression interface corresponding to the target method; the target method is a method in the method package path, and the regression interface is an interface corresponding to a target calling method directly or indirectly calling the target method, the target calling method being a method in the interface package path; in response to a second operation performed by the user on the query button in the second display interface, displaying all regression interfaces corresponding to the target method in a regression interface display area of the second display interface; wherein the process of determining the regression interface comprises: obtaining calling stack information of the target method, the calling stack information comprising all calling methods calling the target method; traversing all the calling methods with a calling method directly calling the target method as a starting point of traversal; when a currently traversed calling method is a method in the interface package path, stopping the traversal and determining that an interface corresponding to the currently traversed calling method is a regression interface.

2. The method of claim 1, wherein, The method further comprises: receiving a monitoring instruction of an application by a user, the monitoring instruction being used to indicate a monitored application, and the monitoring instruction comprising an interface package path and a method package path corresponding to the application.

3. The method of claim 2, wherein, The method further comprises: monitoring, based on the monitoring instruction, a method called during a running process of the monitored application, to obtain a number of all called methods in the interface package path and the method package path corresponding to the application; calculating a difference between a total number of methods in the interface package path and the method package path corresponding to the application and the number of all called methods in the interface package path and the method package path corresponding to the application, to obtain a number of all un-called methods in the interface package path and the method package path corresponding to the application.

4. A regression interface query device, characterized by, The apparatus comprises: a first display module, configured to display a first display interface; the first display interface is used to display a calling condition of a monitored application during running, the calling condition comprising a number of all un-called methods in an interface package path and a method package path corresponding to the application, and calling information of called methods in the method package path, the calling information being used to indicate all calling methods used to call the called methods; The second display module is configured to display a second display interface in response to a first operation performed by the user in the calling condition, the second display interface comprising an input area for inputting a target method and a query button for querying a regression interface corresponding to the target method, the target method being a method in the method package path, and the regression interface being an interface corresponding to a target calling method that directly or indirectly calls the target method, the target calling method being a method in the interface package path. The third display module is configured to display all regression interfaces corresponding to the target method in a regression interface display area of the second display interface in response to a second operation performed by the user on the query button in the second display interface. The second display module comprises: A call stack information acquisition unit configured to acquire call stack information of the target method, the call stack information comprising all calling methods that call the target method. A traversal unit configured to traverse all calling methods with a calling method that directly calls the target method as a starting point. A regression interface determination unit configured to stop the traversal and determine an interface corresponding to a currently traversed calling method as a regression interface when the currently traversed calling method is a method in the interface package path.

5. The apparatus of claim 4, wherein, The device further comprises: A monitoring instruction receiving module configured to receive a monitoring instruction of an application from a user, the monitoring instruction being used to indicate a monitored application, and the monitoring instruction comprising an interface package path and a method package path corresponding to the application.

6. The apparatus of claim 5, wherein, The first display module comprises: A calling monitoring unit configured to monitor calling methods in a running process of the monitored application based on the monitoring instruction to acquire a number of all called methods in the interface package path and the method package path corresponding to the application. A calculation unit configured to calculate a difference between a total number of methods in the interface package path and the method package path corresponding to the application and the number of all called methods in the interface package path and the method package path corresponding to the application to obtain a number of all uncalled methods in the interface package path and the method package path corresponding to the application.

7. A regression interface query device, characterized by, The device comprises: A processor and a memory, wherein the memory is configured to store computer execution instructions, and the processor is configured to execute the computer execution instructions stored in the memory to enable the regression interface query device to perform the regression interface query method in any one of claims 1-3 when the regression interface query device is running.

8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores instructions, and the instructions are executed by the processor of the regression interface query device to enable the regression interface query device to perform the regression interface query method in any one of claims 1-3.

Citation Information

Patent Citations

  • Data enquiring method, device, computer equipment and storage medium

    CA3151209A1

  • Automatically testing interface of graphical user interface program and automatically testing method thereof

    CN101082877A