CN116383283A - Regression interface query method, device, equipment and storage medium - Google Patents

Regression interface query method, device, equipment and storage medium Download PDF

Info

Publication number
CN116383283A
CN116383283A CN202211632097.9A CN202211632097A CN116383283A CN 116383283 A CN116383283 A CN 116383283A CN 202211632097 A CN202211632097 A CN 202211632097A CN 116383283 A CN116383283 A CN 116383283A
Authority
CN
China
Prior art keywords
interface
calling
regression
application
packet path
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
CN202211632097.9A
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.)
China United Network Communications Group Co Ltd
Original Assignee
China United Network Communications Group 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 China United Network Communications Group Co Ltd filed Critical China United Network Communications Group Co Ltd
Priority to CN202211632097.9A priority Critical patent/CN116383283A/en
Publication of CN116383283A publication Critical patent/CN116383283A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
    • 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/3696Methods or tools to render software testable
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/248Presentation of query results
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The disclosure provides a regression interface query method, a device, equipment and a storage medium, relates to the technical field of computers, and can improve accuracy and efficiency of regression interface determination, thereby improving efficiency and accuracy of regression test. According to the method, the calling condition of the application in the running process can be obtained through monitoring the application, and the calling condition is displayed on the first display interface. And displaying a second display interface based on the number of the interface packet paths corresponding to the application in the calling situation, the number of all the methods which are not called in the method packet paths and the first operation of the user, and ensuring the calling situation of all the acquired methods corresponding to the application, thereby ensuring the accuracy of acquiring the regression interface based on the calling situation. All calling methods for calling the called method can be obtained based on the calling information, so that the regression interface corresponding to the target method input by the user can be quickly queried, and the query efficiency of the regression interface is improved.

Description

Regression interface query method, device, equipment and storage medium
Technical Field
The disclosure relates to the technical field of computers, and in particular relates to a regression interface query method, a regression interface query device, regression interface query equipment and a storage medium.
Background
In a software development process, products or requirements need to be tested before being formally online to discover possible defects before release. When testing a product or demand, it is necessary to perform related tests, such as functional tests, performance tests, compatibility tests, etc., on the new functionality of the product or demand and the associated old functionality. The test for the related old functions is performed to ensure that the old functions are not affected by the new functions and are not in question. For large-scale application systems, because the service scenes are numerous and complex, the functions provided by the system are also intricate and complex, so that the old functions, the old logics and the old scenes which are often required to carry out regression tests are also numerous, and a great deal of manpower and time are consumed.
At present, in order to improve the test efficiency, an automatic test is adopted to replace a manual test so as to improve the regression test efficiency. However, for large complex systems, the functions are complex, the logic scenes are numerous, and therefore, various interfaces are very many. The effort to find out which interface methods the target method is called by from among the numerous interfaces is thus greater, and if the target method is called indirectly, it is more difficult to find out, and it takes more time to determine the interface that needs to be tested. Various internal methods are modified in products or requirements, and the methods corresponding to the interfaces can be called and can be changed, so that a great deal of time and labor are consumed each time to check and position interfaces from an automatic test case to be subjected to regression testing, and omission of the regression interfaces is manually determined, so that the problems of low efficiency and inaccuracy of the regression testing are caused.
Disclosure of Invention
In order to solve the problems that in the prior art, due to the fact that complex calling relations exist in application, a regression interface cannot be accurately and rapidly determined, so that regression testing efficiency is low and inaccurate, the disclosure provides a regression interface query method, device, equipment and storage medium, which are used for improving accuracy and efficiency of regression interface determination, so that efficiency and accuracy of regression testing are improved.
In order to achieve the above purpose, the present disclosure adopts the following technical scheme:
in a first aspect, a regression interface query method is provided, where the method includes:
displaying a first display interface; the first display interface is used for displaying the calling condition of the monitored application in the running process, the calling condition comprises the number of all the non-called methods in an interface packet path and a method packet path corresponding to the application and the calling information of the called methods in the method packet path, the calling information is used for indicating all the calling methods, and the all the calling methods are used for calling the called methods;
responding to a first operation executed when the number of the interface packet paths corresponding to the application and all the non-called methods in the method packet paths in the calling situation by a user is zero, and displaying a second display interface, wherein the second display interface comprises an input area for inputting a target method and a query key for querying a regression interface corresponding to the target method; the target method is a method in the method packet path, the regression interface is an interface corresponding to a target calling method for directly or indirectly calling the target method, and the target calling method is a method in the interface packet path;
And responding to a second operation of the user on the query key on the second display interface, and displaying all regression interfaces corresponding to the target method in a regression interface display area of the second display interface.
With reference to the first aspect, in a possible implementation manner, the method further includes:
and receiving a monitoring instruction of a user to the application, wherein the monitoring instruction is used for indicating the monitored application, and the monitoring instruction comprises an interface packet path and a method packet path corresponding to the application.
With reference to the first aspect, in a possible implementation manner, the method further includes:
monitoring a method called in the running process of the monitored application based on the monitoring instruction so as to acquire the number of all called methods in an interface packet path and a method packet path corresponding to the application;
and calculating the difference value between the total number of the methods in the interface packet path and the method packet path corresponding to the application and the number of all the called methods in the interface packet path and the method packet path corresponding to the application to obtain the number of all the non-called methods in the interface packet path and the method packet path corresponding to the application.
With reference to the first aspect, in a possible implementation manner, the determining the regression interface includes:
acquiring call stack information of the target method, wherein the call stack information comprises all call methods for calling the target method;
traversing all calling methods by taking the calling method for directly calling the target method as a traversing starting point;
stopping traversing and determining that an interface corresponding to the currently traversed calling method is a regression interface when the currently traversed calling method is the method in the interface packet path.
In a second aspect, a regression interface query apparatus is provided, where the apparatus includes:
the first display module is used for displaying a first display interface; the first display interface is used for displaying the calling condition of the monitored application in the running process, the calling condition comprises the number of all the non-called methods in an interface packet path and a method packet path corresponding to the application and the calling information of the called methods in the method packet path, the calling information is used for indicating all the calling methods, and the all the calling methods are used for calling the called methods;
the second display module is used for responding to the first operation executed when the number of the interface packet paths corresponding to the application and the method packet paths in the calling information is zero, and displaying a second display interface, wherein the second display interface comprises an input area for inputting a target method and a query key for querying a regression interface corresponding to the target method; the target method is a method in the method packet path, the regression interface is an interface corresponding to a target calling method for directly or indirectly calling the target method, and the target calling method is a method in the interface packet path;
And the third display module is used for responding to a second operation of the user on the query key on the second display interface and displaying all regression interfaces corresponding to the target method in a regression interface display area of the second display interface.
With reference to the second aspect, in one possible implementation manner, the apparatus further includes:
the monitoring instruction receiving module is used for receiving a monitoring instruction of a user to an application, wherein the monitoring instruction is used for indicating the monitored application, and the monitoring instruction comprises an interface packet path and a method packet path corresponding to the application.
With reference to the second aspect, in one possible implementation manner, the first display module includes:
the calling monitoring unit is used for monitoring the method called in the running process of the monitored application based on the monitoring instruction so as to acquire the number of all the called methods in the interface packet path and the method packet path corresponding to the application;
and the calculating unit is used for calculating the difference value between the total number of the methods in the interface packet path and the method packet path corresponding to the application and the number of all the called methods in the interface packet path and the method packet path corresponding to the application so as to obtain the number of all the non-called methods in the interface packet path and the method packet path corresponding to the application.
With reference to the second aspect, in one possible implementation manner, the second display module includes:
a call stack information obtaining unit, configured to obtain call stack information of the target method, where the call stack information includes all call methods for calling the target method;
the traversal unit is used for traversing all the calling methods by taking the calling method for directly calling the target method as a traversal starting point;
and the regression interface determining unit is used for stopping traversing and determining that the interface corresponding to the currently traversed calling method is a regression interface when the currently traversed calling method is the method in the interface packet path.
In a third aspect, a regression interface query apparatus is provided, the regression interface query apparatus including: a processor and a memory; wherein the memory is configured to store computer-executable instructions that, when executed by the regression interface query device, cause the processor to execute the regression interface query device to perform a regression interface query method as described in any one of the first aspect and the possible implementation manners of the first aspect.
In a fourth aspect, the present disclosure provides a computer readable storage medium having instructions stored therein that, when executed by a processor of a regression interface querying device, enable the regression interface querying device to perform the regression interface querying method as described in any one of the possible implementations of the first aspect and the first aspect.
In this disclosure, the names of the regression interface querying devices described above do not constitute limitations on the devices or function modules themselves, and in actual implementations, these devices or function modules may appear under other names. Insofar as the function of each device or function module is similar to the present disclosure, it is within the scope of the claims of the present disclosure and the equivalents thereof.
These and other aspects of the disclosure will be more readily apparent from the following description.
The technical scheme provided by the disclosure at least brings the following beneficial effects: the regression interface query method comprises the following steps: displaying a first display interface; the first display interface is used for displaying the calling condition of the monitored application in the running process, the calling condition comprises the number of all the non-called methods in an interface packet path and a method packet path corresponding to the application and the calling information of the called methods in the method packet path, the calling information is used for indicating all the calling methods, and the all the calling methods are used for calling the called methods; responding to a first operation executed when the number of the interface packet paths corresponding to the application and the method packet paths in the calling information is zero by a user, and displaying a second display interface, wherein the second display interface comprises an input area for inputting a target method and a query key for querying a regression interface corresponding to the target method; the target method is a method in the method packet path, the regression interface is an interface corresponding to a target calling method for directly or indirectly calling the target method, and the target calling method is a method in the interface packet path; and responding to a second operation of the user on the query key on the second display interface, and displaying all regression interfaces corresponding to the target method in a regression interface display area of the second display interface. By monitoring the application, the calling condition of the application in the running process can be obtained, and the calling condition is displayed on the first display interface. And displaying a second display interface based on the number of the interface package paths corresponding to the application and all the methods which are not called in the method package paths in the calling situation and the first operation executed by the user on the first display interface, so that the accuracy of acquiring the regression interface corresponding to the target method based on the calling situation is ensured when the user inquires the regression interface of the target method based on the second display interface. By the call information of the called method in the method packet path obtained by monitoring the application, all the call methods for calling the called method can be seen, so that the regression interface corresponding to the target method input by the user can be directly and rapidly queried based on the call information, the query efficiency of the regression interface is improved, and the regression test efficiency is improved.
Drawings
FIG. 1 is a diagram of a called relationship of an application internal method provided by the present disclosure;
fig. 2 is a flow chart of a regression interface query method provided in the present disclosure;
fig. 3 is an interface schematic diagram of a first display interface of a regression interface query method provided by the present disclosure;
fig. 4 is an interface schematic diagram of a second display interface of a regression interface query method provided by the present disclosure;
FIG. 5 is an interface schematic diagram of a regression interface query method provided by the present disclosure;
FIG. 6 is an interface schematic diagram of a first display interface of another regression interface query method provided by the present disclosure;
fig. 7 is a schematic structural diagram of a regression interface query device provided in the present disclosure;
fig. 8 is a schematic hardware structure of a regression interface query device provided in the present disclosure.
Detailed Description
The regression interface query method, device and storage medium provided by the embodiment of the disclosure are described in detail below with reference to the accompanying drawings.
The term "and/or" is herein merely an association relationship describing an associated object, meaning that there may be three relationships, e.g., a and/or B, may represent: a exists alone, A and B exist together, and B exists alone.
The terms "first," "second," and "third," and the like, in the description and in the drawings, are used for distinguishing between different objects or between different processes of the same object and not for describing a particular sequential order of objects.
Furthermore, references in the description of this disclosure to the terms "comprise" and "have," and any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed but may optionally include other steps or elements not listed or inherent to such process, method, article, or apparatus.
It should be noted that in the embodiments of the present disclosure, words such as "exemplary" or "such as" are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "e.g." in the examples of this disclosure should not be taken as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion.
The terms related to the present application are explained below.
1. JVM (Java virtual machine):
is a specification for a computing device that is an imaginary computer implemented by emulating various computer functions on an actual computer.
2. Sandbox (chinese name: sandbox):
is a solution framework facing to tangent plane programming (AspectOrientedProgramming, AOP) and can perform related operation on programs in a JVM process on the premise of not restarting and not invading a target JVM application. The tangent plane programming is a technology for realizing unified maintenance of program functions through a precompilation mode and dynamic agents during running.
3. Regression testing
Regression testing refers to the re-testing after an old code has been modified to confirm that the modification did not introduce new errors or caused other code to produce errors. The regression interface refers to an affected associated interface, i.e. an interface needing regression testing, after a certain method is modified.
In the software development process, testing is an essential loop before the product or demand is formally on line. One product or demand must be tested and passed before it can be released on line, and products or demands that fail the test are likely to have various defects after release. Testing a product or demand includes performing related tests, such as functional tests, performance tests, compatibility tests, etc., on new functions and associated old functions of the product or demand. The regression test is performed on the old function associated with a new function, so as to ensure that the old function is not affected by the new function and is not in question. The business scenario related to the large-scale application is numerous and complex, and the functions provided by the application are also intricate, so that the interfaces of the application requiring regression testing are also numerous, and the efficiency of the regression testing is low.
To improve the regression testing, automated testing is currently generally used instead of manual testing to improve the efficiency of the regression testing. Automated testing may be categorized into user interface (UserInterface, UI) automated testing and interface automated testing according to the objects tested. The success rate of the UI automation test is very dependent on the stability of the page element, but the stability of the page element is poor because the front-end page is changed frequently, so that the benefit of the UI automation test is not high, and the UI automation test is not commonly used. Since the interfaces are generally stable in function, the interfaces are often tested by using interface automation tests, so that the testing efficiency is improved.
An interface may be understood as a network request. For example, after a certain application is opened, firstly, a login or automatic login is performed, the login operation is that a network request for a login interface is initiated, after the application system receives the network request for the login interface, the application system distributes the network request for the login interface to a method corresponding to the login interface for processing, codes in the method are executed, and after login logic is realized, a response message of successful login is returned to the application. The interface automatization test refers to the process of executing the network request to the interface in a code mode and verifying whether the returned result of the request meets the expectations. For example, in the above example of the login application, the test personnel opens the application, performs the login operation, and checks whether the login is successful, and this process is a manual test process, that is, a manual test case, if the login is to be implemented by using the interface automation test, the test personnel uses codes to execute the network request to the login interface, and uses the codes to check whether the response message of the login interface is successful, that is, a test case for the interface automation test. The interface automation test is performed based on the interface automation test case, so that the speed is high, the stability is high, and the efficiency of the test can be improved compared with the manual execution test. However, for large complex applications, various interfaces are very numerous due to the complex functionality of the application and the numerous logical scenarios. For example, a developer may need to modify an internal method when implementing a particular requirement, and the internal method may be called or indirectly called by a method corresponding to one or more interfaces. As shown in fig. 1, the internal method D1 is directly called by the interface method C1, the internal method E2 is indirectly called by the interface method C1, specifically, the internal method E2 is called by the internal method D2, the internal method D2 is called by the interface method C1, the internal method D1 is called by not only the interface method C1 but also the interface method B1, the internal method E2 is indirectly called by not only the interface method C1 but also the interface method A1, specifically, the internal method E2 is called by the internal method C2, and the internal method C2 is called by the interface method A1. In practical terms, the called relationship of the internal method is much more complex than that shown in fig. 1, and the calling hierarchy between the methods is also deeper, so that a lot of manpower and time are still consumed to find out the regression interface needed to perform the regression test.
When the internal method is modified, the associated interfaces may be affected, for example, after the internal method E2 in fig. 1 is modified, the interfaces A1 and C1 may be affected, so that regression testing needs to be performed on these interfaces, and the interface automation test cases of these interfaces are executed. There are a large number of interfaces in the interface layer of the actual application, from which the effort to find out which regression interfaces the target method is called by is great. And if the target method is called indirectly, the investigation is more difficult, more time is required to be consumed, and the situation that regression interface investigation is omitted exists. Therefore, the regression interface query method can directly display the regression interface corresponding to the target method input by the user through the acquired call information of the monitored application in the running process, and can directly query the interface needing regression test without the need of a tester to check from complex call logic, thereby improving the efficiency and accuracy of determining the regression interface.
As shown in fig. 2, a flowchart of a regression interface query method according to an embodiment of the present application includes the following steps (step S110-step S130):
Step S110: and displaying the first display interface.
The first display interface is used for displaying the calling condition of the monitored application in the running process, the calling condition comprises the number of all the non-called methods in an interface packet path and a method packet path corresponding to the application and the calling information of the called methods in the method packet path, the calling information is used for indicating all the calling methods, and the all the calling methods are used for calling the called methods.
The method packet path and the interface packet path comprise all internal methods and interface methods corresponding to the application. For one application, all internal methods developed by developers are placed under a specified packet path, namely a method packet path; all interface methods are placed under the specified interface packet path, which is commonly named xxx. Therefore, by analyzing and monitoring the running process of the application by the methods in the method packet path and the interface packet path, all the target methods and the interface methods can be covered.
Referring to fig. 3, fig. 3 is a schematic diagram of a first display interface provided in an embodiment of the present application, in which the method that is not called is displayed, and the number of the method that is not called is displayed as 12.
It may be appreciated that other types of call situations of the monitored application during the running process may also be displayed in the first display interface, for example, a ratio between the number of methods that have been called in the interface packet path and the method packet path corresponding to the application and the number of all methods in the interface packet path and the method packet path.
The user can directly know the running condition of the application through the number of the non-called methods displayed on the first display interface, if the number of all the non-called methods is 0, the running process of the application is indicated to call all the methods in the interface packet path and the method packet path, and the monitoring of the application is also indicated to cover all the methods in the interface packet path and the method packet path corresponding to the application.
Step S120: and responding to the first operation executed when the number of all the non-called methods in the interface packet path and the method packet path corresponding to the application in the calling condition by the user is zero, and displaying a second display interface.
The second display interface comprises an input area for inputting a target method and a query key for querying a regression interface corresponding to the target method; the target method is a method in the method packet path, the regression interface is an interface corresponding to a target calling method for directly or indirectly calling the target method, and the target calling method is a method in the interface packet path.
When the number of the interface packet paths and the method packet paths corresponding to the application is zero, the running process of the application is indicated to call all the methods in the interface packet paths and the method packet paths, and the user can execute the first operation at the moment. Specifically, with continued reference to fig. 3, a determination key is included in the first presentation interface shown in fig. 3, through which the user can perform a first operation when the number of non-invoked methods is zero. In response to the first operation, a second display interface is displayed, please refer to fig. 4, fig. 4 is a schematic diagram of a second display interface provided in an embodiment of the present application. In fig. 4 the text "target method: the "lower text box" is an input area for inputting a target method, and the user can input the name of the target method that the user wants to query in the input area here by selecting a manner and typing text, for example, the name of the target method input by the user is the method D1. The user may then operate the query button shown in FIG. 4 to query the regression interface corresponding to the target method that he entered.
It can be appreciated that, since the second presentation interface is displayed in response to the first operation, the second presentation interface includes an input area for inputting the target method and a query key for querying a regression interface corresponding to the target method. If there are still non-called methods in the interface packet path and the method packet path corresponding to the application, that is, the number of non-called methods is not zero, there may be a case that the non-called method is the target method to be input by the user, at this time, since the target method input by the user is not called, all the calling methods of the target method cannot be obtained, and then the regression interface corresponding to the target method cannot be queried. As an implementation manner, the determination key in fig. 3 may be displayed in the second display interface only when the number of all the non-invoked methods is zero, so that the user may click to execute the first operation. In addition, the determination key may further include an operable state and an inoperable state, for example, the operable state indicates that the number of methods that have not been invoked at this time is 0, and the user may perform operations such as clicking on the determination key to perform the first operation; the inoperable state indicates that the number of methods that have not been called at this time is not 0, and the user cannot perform operations such as clicking the determination button. The two operating states can be distinguished by setting the shape or color of the determined case. For example, the button may be in a convex button shape when it is determined that the key is in an operable state; the key may be presented in a concave button shape when it is determined that the key is in an inoperable state. As another example, a button that may appear red when the key is determined to be in an operable state; when the key is determined to be in the inoperable state, the button may appear gray.
Step S130: and responding to a second operation of the user on the query key on the second display interface, and displaying all regression interfaces corresponding to the target method in a regression interface display area of the second display interface.
After the user performs the second operation on the query key in the second presentation interface as shown in fig. 4, all the regression interfaces corresponding to the target method are presented in the regression interface presentation area under the input area of the second presentation interface in fig. 4. The regression interface is an interface corresponding to a target calling method for directly or indirectly calling a target method, and the target calling method is a method in the interface packet path.
After the tester clicks the query key, all the regression interfaces corresponding to the target method are displayed in the regression interface display area of the second display interface. When the tester sees the regression interfaces affected by the target method in the regression interface display area of the second display interface, it is clear which interfaces to perform regression testing. At the moment, whether the interface automatic test case is executed or the manual test case is executed, regression test verification can be completed pertinently, a great deal of time and manpower are saved, and accuracy is guaranteed.
In one possible implementation, the process of determining the regression interface includes the following processes (step 1-step 3):
step 1, acquiring call stack information of the target method, wherein the call stack information comprises all call methods for calling the target method.
That is, the call information of the method that has been called in the acquired method package path may be call stack information.
Step 2, traversing all the calling methods by taking the calling method for directly calling the target method as a traversing starting point;
and step 3, stopping traversing and determining that the interface corresponding to the currently traversed calling method is a regression interface when the currently traversed calling method is the method in the interface packet path.
In an embodiment provided in the present application, the method further includes the following steps:
and receiving a monitoring instruction of a user to the application, wherein the monitoring instruction is used for indicating the monitored application, and the monitoring instruction comprises an interface packet path and a method packet path corresponding to the application.
After the monitoring instruction corresponding to the user is obtained, the running process of the monitored application can be monitored based on the monitoring instruction, so that the condition that the method is called in the running process of the application is obtained. In one possible implementation manner, the method further includes the following process:
Firstly, monitoring a method called in the running process of the monitored application based on the monitoring instruction to obtain the number of all called methods in an interface packet path and a method packet path corresponding to the application, and then calculating the difference value between the total number of the methods in the interface packet path and the method packet path corresponding to the application and the number of all called methods in the interface packet path and the method packet path corresponding to the application to obtain the number of all non-called methods in the interface packet path and the method packet path corresponding to the application.
Referring to fig. 5, an input box included in fig. 5 is used for a user to input information of an application to be monitored, and after inputting the information of the application, the user clicks a start collector to send a monitoring instruction for monitoring the application, namely, starts to monitor the application. The four input boxes in fig. 5 are the server address, application name, method packet path, and interface packet path of the application, respectively. After the user inputs the information of the application in the input box, clicking the "start collector" button to start monitoring the application.
When monitoring the application, the code pull of the engineering C capable of providing the monitoring function for the application can be saved in advance. The project C is a maven project integrated with jvm-sadbox package, wherein the maven project comprises a ServiceMethodCalecterModulator.java source file, and codes for providing monitoring functions for applications are defined.
And acquiring the method names of all the methods under the corresponding method packet path and interface packet path through the 'method packet path and the interface packet path' input by a user, and storing the acquired method names in a first cache in a list mode. Specifically, all files under a 'method package path' are scanned, if a certain file is finished by a class suffix, the file name of the file is obtained, and a class object of a class corresponding to the file is created in a reflection mode; if a file is a directory, then continuing scanning into its next layer. And traversing each created class object, acquiring the method names of all methods of the class object, and storing the method names in a first cache in a list mode. The "interface packet path" is handled in the same logic, so that the method names of all methods under the "interface packet path" are also saved in the second buffer in a list manner. Then, the regular expression is used for searching and replacing the contents of the two variables methodPackagePath, interfacePackagePath in the ServiceMethodCallectorModulator.java file, and the contents filled in the two text boxes of the method package path and the interface package path input by the user are replaced respectively. For example, the "method packet path" and the "interface packet path" input by the user are cn.how2j.tree.kcard-admin.methods, cn.how2j.tree.kcard-admin.control, and after searching and replacing by using the regular expression, the corresponding values of methodPackagePath, interfacePackagePath in the servicemethodcolselector mo file.java file are changed into cn.how2j.tree.kcard-admin.methods, cn.how2j.tree.kcard-admin.control.
After replacing the contents of the two variables met hodPackagePath and interfacePackagePath in the servicemethodcolselector module.java file with regular expression search, executing an engineering packaging command mvncleancan package, and packaging engineering codes in a servicemethod selector module. And then remotely copying the collector. Jar to the directory of the server where the monitored application is located. The address of the server where the monitored application is located, i.e. the content in the text box "server address" entered by the user based on fig. 5. Assuming that the address of the server where the monitored application is located is 130.54.3.129, the command for remote copy is: the scaler get/collector. Jaroot@130.54.3.129:/. Samdbox-module/.
The sandbox jvm-sadbox is mounted to the process of the monitored application, and assuming that the application name is kcard-ad min, i.e., the "application name" text box in fig. 5 is filled in, then the mount command is: ps-ef|grep-ikcard-admin|awk '{ print $2}' |/sadbox. The ps-ef command is used for obtaining all process information, the grep-ikcard-admin command is used for screening out a process containing kcard-admin application, the awk '{ print $2}' command is used for obtaining an information process number of a second column in the process information, and the sand box is mounted on a process corresponding to the designated process number by the aid of the samdbox. Based on this, if the process number of the kcard-admin application is 64229, then the command triggered by the user after clicking "start collector" is: sh-p64229-d 'service-method-collector/begin collector'. At this time, all methods under the method packet path corresponding to the sandboxed application (such as kcard-admin), such as cn. How2j. Tree. Kcar d-admin. Methods, are monitored, and when a certain method under the method packet path is called and executed, in addition to the logic of the normal code of the method is executed, the calling information of the called method is acquired.
When the number of the interface packet paths corresponding to the application and all the methods which are not called in the method packet paths is zero, the target regression interface corresponding to the target method can be obtained based on the calling information of the target method input by the user and the method which is called, and the specific process of obtaining the target regression interface is as follows:
firstly, the method name of the target method is obtained, and then the call stack information of the upper layer caller of the target method is obtained based on the method name of the target method. For example, the target method is a, at this time, since d calls c, and c calls b, and b finally calls the target method a, the call stack information of the target method a is b-c-d, that is, the first is b directly calling the target method, and then sequentially ordering according to the order of calling.
The regression interface corresponding to the target method can be determined by traversing the call stack information. The method comprises the steps of starting to traverse the calling method in the call stack information from a method for directly calling the target method, judging whether the currently traversed calling method is an interface method, if the currently traversed method is the interface method in the interface packet path, indicating that an interface corresponding to the calling method is a regression interface corresponding to the target method, writing the name of the calling method into a regression interface list cache of the target method, and ending the traversing. If the currently traversed calling method is not the method in the interface packet path or the method in the method packet path, the traversal is directly ended. If the currently traversed calling method is not the method in the interface packet path or the method in the method packet path, the calling method is described as other internal methods, and the method cannot be traversed to the interface method even if the traversal is continued, so that the continued traversal is meaningless.
It may be appreciated that, due to the complex call relationships, the target method may include multiple call stack information, each of which is traversed to determine the regression interface. For example, if the target method is a, at this time, since d calls c, and c calls b, b eventually calls target method a, then the call stack information of target method a is b-c-d. In addition, there may be m calling b, b eventually calling the target method a, and the call stack information of the target method a is b-m. The target method a has two call stack information, b-c-d and b-m, respectively. At this time, after each call stack information is traversed, if d is an interface method, only one regression interface, that is, an interface corresponding to d, can be determined. If d and m are both interface methods, two regression interfaces, namely an interface corresponding to d and an interface corresponding to m, can be determined.
The call condition of the monitored application in the running time is displayed in the first display interface, and a certain time is required for the running process of the application, so that the call condition displayed in the first display interface can be acquired in real time. Illustratively, the first presentation interface sends a request for querying progress once every 1 second to query the call situation currently acquired in real time.
And when the first display interface acquires the calling condition every time, the calling condition can be acquired through the following process, and the acquired calling condition is displayed on the first display interface.
Specifically, based on the above example, after the user inputs the "method package path" and the "interface package path" based on the interface shown in fig. 5, the method names of all the methods under the corresponding "method package path" and "interface package path" are acquired, and the acquired method names are respectively stored in the first cache and the second cache in a list manner. When the first display interface is displayed, a method name list of all methods under the "method package path" stored in the first buffer may be read first, and a method name list of all methods under the "interface package path" stored in the second buffer may be read. And reading the method names of all the called methods stored in the cache to acquire the called interface methods based on the method names of all the called methods, wherein the interface methods are the methods in the interface path packet. And performing deduplication on all the interface method names stored in the cache, thereby obtaining the called interface method. Based on the read information, the collecting progress, that is, the ratio of the number of collected methods to the number of methods in the interface path packet and the interface path packet, can be calculated, and the value is displayed on the first display interface, and the calling progress shown in fig. 6 is the ratio. In addition, as shown in fig. 6, a method that is not called in the method path packet and a method that is not called in the interface path packet may also be calculated based on the above-described read information.
It can be seen that the foregoing description has mainly been presented with respect to a method of providing a technical solution according to an embodiment of the present disclosure. To achieve the above functions, it includes corresponding hardware structures and/or software modules that perform the respective functions. Those of skill in the art will readily appreciate that the various illustrative modules and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.
The embodiment of the disclosure may divide the functional modules of the regression interface query device according to the above method example, for example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The integrated modules may be implemented in hardware or in software functional modules. Optionally, the division of the modules in the embodiments of the present disclosure is schematic, which is merely a logic function division, and other division manners may be actually implemented.
As shown in fig. 7, a regression interface query device 700 according to an embodiment of the disclosure includes:
a first display module 710, configured to display a first display interface; the first display interface is used for displaying the calling condition of the monitored application in the running process, the calling condition comprises the number of all the non-called methods in an interface packet path and a method packet path corresponding to the application and the calling information of the called methods in the method packet path, the calling information is used for indicating all the calling methods, and the all the calling methods are used for calling the called methods;
a second display module 720, configured to respond to a first operation performed when the number of all the non-invoked methods in the interface package path and the method package path corresponding to the application is zero, where the first operation is performed by a user, and the second display module displays a second display interface, where the second display interface includes an input area for inputting a target method and a query key for querying a regression interface corresponding to the target method; the target method is a method in the method packet path, the regression interface is an interface corresponding to a target calling method for directly or indirectly calling the target method, and the target calling method is a method in the interface packet path;
And a third display module 730, configured to respond to a second operation performed by the user on the query key on the second display interface, and display all regression interfaces corresponding to the target method in a regression interface display area of the second display interface.
Optionally, in one possible implementation manner, the apparatus further includes:
the monitoring instruction receiving module is used for receiving a monitoring instruction of a user to an application, wherein the monitoring instruction is used for indicating the monitored application, and the monitoring instruction comprises an interface packet path and a method packet path corresponding to the application.
Optionally, in one possible implementation manner, the first display module includes:
the calling monitoring unit is used for monitoring the method called in the running process of the monitored application based on the monitoring instruction so as to acquire the number of all the called methods in the interface packet path and the method packet path corresponding to the application;
and the calculating unit is used for calculating the difference value between the total number of the methods in the interface packet path and the method packet path corresponding to the application and the number of all the called methods in the interface packet path and the method packet path corresponding to the application so as to obtain the number of all the non-called methods in the interface packet path and the method packet path corresponding to the application.
Optionally, in one possible implementation manner, the second display module includes:
a call stack information obtaining unit, configured to obtain call stack information of the target method, where the call stack information includes all call methods for calling the target method;
the traversal unit is used for traversing all the calling methods by taking the calling method for directly calling the target method as a traversal starting point;
and the regression interface determining unit is used for stopping traversing and determining that the interface corresponding to the currently traversed calling method is a regression interface when the currently traversed calling method is the method in the interface packet path.
The embodiment of the disclosure provides regression interface query equipment for executing a method required to be executed by any equipment in the data integrity determination system. The regression interface query device may be a regression interface query device referred to in the present disclosure, or a module in a regression interface query apparatus; or a chip in the regression interface query device, or other devices for executing the regression interface query method, which is not limited in this disclosure.
When implemented in hardware, a specific implementation manner of the regression interface query device in the embodiment of the present application is shown in fig. 8, and fig. 8 is a schematic structural diagram of a regression interface query device provided in the embodiment of the present disclosure, where 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 further include a memory 803. The processor 801, the memory 803, and the communication interface 804 may be connected by a communication line 802.
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).
Communication line 802 may include a pathway for communicating information between the aforementioned components.
The communication interface 804, for communicating with other devices or communication networks, may use any transceiver-like device, such as ethernet, radio Access Network (RAN), wireless Local Area Network (WLAN), etc.
The memory 803 may be, but is not limited to, a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (randoma ccessmemory, RAM) or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (electricallyerasableprogrammablere ad-only memory, EEPROM), compact disc-only memory (CD-ROM) or other optical disk storage, optical disk storage (including compact disc, laser disc, optical disc, digital versatile disc, blu-ray disc, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to contain or store the desired program code in the form of instructions or data structures and that can be accessed by a computer.
In a possible design, the memory 803 may exist independent of the processor 801, i.e., the memory 803 may be a memory external to the processor 801, where the memory 803 may be connected to the processor 801 through a communication line 802 for storing execution instructions or application program codes, and the execution is controlled by the processor 801 to implement a regression interface query method provided by the embodiments of the disclosure described below. In yet another possible design, the memory 803 may be integrated with the processor 801, i.e., the memory 803 may be an internal memory of the processor 801, e.g., the memory 803 may be a cache, may be used to temporarily store some data and instruction information, etc.
As one implementation, the processor 801 may include one or more CPUs, such as CPU0 and CPU1 in fig. 8. As another implementation, regression interface query device 800 may include multiple processors, such as processor 801 and processor 807 in fig. 8. As yet another implementation, regression interface query device 800 may also include an output device 805 and an input device 806.
From the foregoing description of the embodiments, it will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of functional modules is illustrated, and in practical application, the above-described functional allocation may be implemented by different functional modules according to needs, i.e. the internal structure of the network node is divided into different functional modules to implement all or part of the functions described above. The specific working processes of the above-described system, module and network node may refer to the corresponding processes in the foregoing method embodiments, which are not described herein.
The present disclosure also provides a computer-readable storage medium having instructions stored therein, which when executed by a computer, perform the steps of the method flow shown in the method embodiments described above.
The computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: electrical connections having one or more wires, portable computer diskette, hard disk. Random access memory (RandomAccess Memory, RAM), read-only memory (ROM), erasable programmable Read-only memory (ErasableProgrammableReadOnlyMemory, EPROM), registers, hard disk, optical fiber, portable compact disk Read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any other form of computer readable storage medium of any suitable combination of the foregoing, or values in the art. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an application specific integrated circuit (ApplicationSpecificInteg ratedCircuit, ASIC). In the disclosed embodiments, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
Embodiments of the present disclosure provide a chip comprising a processor and a communication interface, the communication interface and the processor being coupled, the processor being configured to execute a computer program or instructions to implement a regression interface query method as in the method embodiments described above. Since the apparatus, device, computer readable storage medium, and computer program product in the embodiments of the present disclosure may be applied to the above-mentioned method, the technical effects that may be obtained by the apparatus, device, computer readable storage medium, and computer program product may also refer to the above-mentioned method embodiments, and the embodiments of the present disclosure are not repeated herein.
In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, e.g., the division of the above-described elements is merely a logical functional division, and may be implemented in other ways, e.g., multiple elements or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interface, indirect coupling or communication connection of devices or units, electrical, mechanical, or other form.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The foregoing is merely a specific embodiment of the disclosure, but the protection scope of the disclosure is not limited thereto, and any changes or substitutions within the technical scope of the disclosure should be covered by the protection scope of the disclosure. Therefore, the protection scope of the present disclosure should be subject to the protection scope of the claims.

Claims (10)

1. A regression interface query method, the method comprising:
displaying a first display interface; the first display interface is used for displaying the calling condition of the monitored application in the running process, the calling condition comprises the number of all the non-called methods in an interface packet path and a method packet path corresponding to the application and the calling information of the called methods in the method packet path, the calling information is used for indicating all the calling methods, and the all the calling methods are used for calling the called methods;
Responding to a first operation executed when the number of the interface packet paths corresponding to the application and all the non-called methods in the method packet paths in the calling situation by a user is zero, and displaying a second display interface, wherein the second display interface comprises an input area for inputting a target method and a query key for querying 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 for directly or indirectly calling the target method, and the target calling method is a method in the interface package path;
and responding to a second operation of the user on the query key on the second display interface, and displaying all regression interfaces corresponding to the target method in a regression interface display area of the second display interface.
2. The method according to claim 1, wherein the method further comprises:
and receiving a monitoring instruction of a user to the application, wherein the monitoring instruction is used for indicating the monitored application, and the monitoring instruction comprises an interface packet path and a method packet path corresponding to the application.
3. The method according to claim 2, wherein the method further comprises:
monitoring a method called in the running process of the monitored application based on the monitoring instruction so as to acquire the number of all called methods in an interface packet path and a method packet path corresponding to the application;
and calculating the difference value between the total number of the methods in the interface packet path and the method packet path corresponding to the application and the number of all the called methods in the interface packet path and the method packet path corresponding to the application to obtain the number of all the non-called methods in the interface packet path and the method packet path corresponding to the application.
4. The method of claim 1, wherein determining the regression interface comprises:
acquiring call stack information of the target method, wherein the call stack information comprises all call methods for calling the target method;
traversing all the calling methods by taking the calling method for directly calling the target method as a traversing starting point;
stopping traversing and determining that an interface corresponding to the currently traversed calling method is a regression interface when the currently traversed calling method is the method in the interface packet path.
5. A regression interface query apparatus, the apparatus comprising:
the first display module is used for displaying a first display interface; the first display interface is used for displaying the calling condition of the monitored application in the running process, the calling condition comprises the number of all the non-called methods in an interface packet path and a method packet path corresponding to the application and the calling information of the called methods in the method packet path, the calling information is used for indicating all the calling methods, and the all the calling methods are used for calling the called methods;
the second display module is used for responding to the first operation executed when the number of all the non-called methods in the interface packet path and the method packet path corresponding to the application in the calling situation by the user is zero, and displaying a second display interface, wherein the second display interface comprises an input area for inputting a target method and a query key for querying 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 for directly or indirectly calling the target method, and the target calling method is a method in the interface package path;
And the third display module is used for responding to a second operation of the user on the query key on the second display interface and displaying all regression interfaces corresponding to the target method in a regression interface display area of the second display interface.
6. The apparatus of claim 5, wherein the apparatus further comprises:
the monitoring instruction receiving module is used for receiving a monitoring instruction of a user on an application, wherein the monitoring instruction is used for indicating the monitored application, and the monitoring instruction comprises an interface packet path and a method packet path corresponding to the application.
7. The apparatus of claim 6, wherein the first display module comprises:
the call monitoring unit is used for monitoring the method called in the running process of the monitored application based on the monitoring instruction so as to acquire the number of all the called methods in the interface packet path and the method packet path corresponding to the application;
and the calculating unit is used for calculating the difference value between the total number of the methods in the interface packet path and the method packet path corresponding to the application and the number of all the called methods in the interface packet path and the method packet path corresponding to the application so as to obtain the number of all the non-called methods in the interface packet path and the method packet path corresponding to the application.
8. The apparatus of claim 5, wherein the second display module comprises:
the call stack information acquisition unit is used for acquiring call stack information of the target method, wherein the call stack information comprises all call methods for calling the target method;
the traversal unit is used for traversing all the calling methods by taking the calling method for directly calling the target method as a traversal starting point;
and the regression interface determining unit is used for stopping traversing and determining that the interface corresponding to the currently traversed calling method is a regression interface when the currently traversed calling method is the method in the interface packet path.
9. A regression interface query apparatus, comprising: a processor and a memory; wherein the memory is configured to store computer-executable instructions that, when executed by the regression interface query device, cause the processor to execute the computer-executable instructions stored by the memory to cause the regression interface query device to perform the regression interface query method of any one of claims 1-4.
10. A computer readable storage medium having instructions stored therein, which when executed by a processor of a regression interface query device, cause the regression interface query device to perform the regression interface query method of any of claims 1-4.
CN202211632097.9A 2022-12-19 2022-12-19 Regression interface query method, device, equipment and storage medium Pending CN116383283A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211632097.9A CN116383283A (en) 2022-12-19 2022-12-19 Regression interface query method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211632097.9A CN116383283A (en) 2022-12-19 2022-12-19 Regression interface query method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116383283A true CN116383283A (en) 2023-07-04

Family

ID=86963832

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211632097.9A Pending CN116383283A (en) 2022-12-19 2022-12-19 Regression interface query method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116383283A (en)

Similar Documents

Publication Publication Date Title
CN109302522B (en) Test method, test device, computer system, and computer medium
US10419546B2 (en) Migration assessment for cloud computing platforms
US10360141B2 (en) Automated application test system
US20130159977A1 (en) Open kernel trace aggregation
US20140372986A1 (en) Timed API Rules for Runtime Verification
CN111897724B (en) Automatic testing method and device suitable for cloud platform
CN110287696B (en) Detection method, device and equipment for rebound shell process
CN111142971B (en) Cloud platform application ready checking method suitable for traditional application clouding
US20150236799A1 (en) Method and system for quick testing and detecting mobile devices
CN110879781B (en) Program debugging method, device, electronic equipment and computer readable storage medium
CN113626102A (en) Data processing method and device, electronic equipment and storage medium
CN110928777B (en) Test case processing method, device, equipment and storage medium
CN116383283A (en) Regression interface query method, device, equipment and storage medium
CN114676198A (en) Benchmark evaluation system for multimode database and construction method thereof
CN109358972B (en) Log management method and device of middleware client and computer system
CN113220586A (en) Automatic interface pressure test execution method, device and system
CN115658540B (en) Smart phone application function testing method and device
US11940900B1 (en) Determining and providing representations of program flow control
CN115373696B (en) Low code configuration method, system, equipment and storage medium for software resource generation
US11822465B2 (en) Operational multipliers for heterogeneous build architectures
Alpernas et al. This is not the End: Rethinking Serverless Function Termination
CN115982035A (en) Interface data simulation method, device, equipment and storage medium
Team Service Observability
CN116225863A (en) Interface performance determining method, device, equipment and storage medium
US20190057017A1 (en) Correlation Of Function Calls To Functions In Asynchronously Executed Threads

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