CN112131114A - Application testing method, device, equipment and storage medium - Google Patents

Application testing method, device, equipment and storage medium Download PDF

Info

Publication number
CN112131114A
CN112131114A CN202011008623.5A CN202011008623A CN112131114A CN 112131114 A CN112131114 A CN 112131114A CN 202011008623 A CN202011008623 A CN 202011008623A CN 112131114 A CN112131114 A CN 112131114A
Authority
CN
China
Prior art keywords
application
test
source code
target
changed
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
CN202011008623.5A
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.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202011008623.5A priority Critical patent/CN112131114A/en
Publication of CN112131114A publication Critical patent/CN112131114A/en
Pending legal-status Critical Current

Links

Images

Classifications

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

Landscapes

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

Abstract

The application testing method, the device, the equipment and the storage medium locate the changed method from the source code of the application, inquire the changed method to have the correlation method of the calling or called relation according to the calling relation between the methods in the source code, inquire the changed method and the corresponding interface of the correlation method according to the mapping relation between the uniform resource identifier and the method in the source code, and call the test case testing application of the test changed method and the corresponding interface of the correlation method. Because the test is only performed for the method affected by the change, namely the test is an incremental test and not a full test, the time length of the test can be compressed. And because the association method is determined according to the calling relationship between the methods, and the interface influenced by the change is determined according to the mapping relationship between the URI and the method, the determined interface takes the source code as the basis, thereby reducing the artificial subjective influence and improving the efficiency of determining the interface.

Description

Application testing method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of testing, and in particular, to a method, an apparatus, a device, and a storage medium for testing an application.
Background
With the rapid development of applications, applications are updated more frequently, and the time left for application testing is continuously compressed. Therefore, for updated applications, full-scale regression testing (i.e., testing all source code of the application) has not been applicable.
Incremental regression testing (i.e., testing only for source code affected by the update) requires locating the interfaces affected by the update and testing the located interfaces. Currently, a tester locates an interface affected by an update and compiles a test case for the located interface.
The manual positioning mode is not only low in efficiency, but also easy to miss interfaces to cause missing test, and therefore, the efficiency and the accuracy of the existing application test method are all required to be improved.
Disclosure of Invention
The present disclosure provides an application test method, apparatus, device and storage medium, so as to at least solve the problem of how to improve the efficiency and accuracy of application test. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided a test method for an application, including:
locating a method of change from source code of an application;
inquiring the association method of the changed method according to the calling relationship among the methods in the source code, wherein the association method is the method which has calling or called relationship with the changed method;
inquiring an interface corresponding to a target method according to a mapping relation between a uniform resource identifier and a method in the source code, wherein the target method comprises the changed method and the association method;
and calling a target test case to test the application, wherein the target test case is used for testing an interface corresponding to the target method.
Optionally, the method for locating a change from a source code of an application includes:
locating the changed content from the source code of the application;
and analyzing the changed content to obtain the changed method.
Optionally, the obtaining process of the call relationship between the methods includes:
compiling the source code of the application to obtain a compiled file;
identifying information of the method from the compiled file, the information of the method including parameters of a calling instruction of the method;
and obtaining the calling relation among the methods by traversing and identifying the parameters of the calling instruction.
Optionally, the method further includes:
identifying information of an interface, information of an abstract class, information of an implementation class, and a correspondence between the implementation class and the interface from the compiled file.
Optionally, the obtaining process of the mapping relationship between the uniform resource identifier and the method includes:
compiling the source code of the application to obtain a compiled file;
and identifying the content of the annotation of the preset category in the compiled file to obtain the mapping relation between the uniform resource identifier and the method, wherein the uniform resource identifier comprises routing information.
Optionally, the method further includes:
and sending first prompt information under the condition that an interface corresponding to the target method is not inquired, wherein the first prompt information is used for prompting a test case providing the target method.
Optionally, the invoking the target test case includes:
and querying the target test case corresponding to the interface from a preset test case library.
Optionally, the method further includes:
counting the proportion of the called test cases in the test case library;
and sending an adjustment prompt according to the proportion, wherein the adjustment prompt is used for prompting the adjustment of the test cases in the test case library.
Optionally, the method further includes: and sending second prompt information under the condition that the target test case is not inquired in the test case library, wherein the second prompt information is used for prompting to supplement the target test case.
According to a second aspect of the embodiments of the present disclosure, there is provided a test apparatus for an application, including:
a positioning module configured to position a method of the change from source code of the application;
a first query module configured to query an association method of the changed method according to a call relationship between the methods in the source code, where the association method is the method having a call or called relationship with the changed method;
a second query module configured to query an interface corresponding to a target method according to a mapping relationship between a uniform resource identifier in the source code and the method, where the target method includes the changed method and the associated method;
and the test module is configured to call a target test case and test the application, wherein the target test case is used for testing an interface corresponding to the target method.
According to a third aspect of embodiments of the present disclosure, there is provided a test apparatus for an application, including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the method of testing an application disclosed in the first aspect.
According to a fourth aspect of embodiments of the present disclosure, there is provided a storage medium having instructions that, when executed by a processor of a retrieval device for multimedia files, enable the retrieval device for multimedia files to execute the test method of the application disclosed in the first aspect.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product which, when executed by a processor of an applied test device, enables the applied test device to perform the above applied test method.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
the application testing method, the device, the equipment and the storage medium locate the changed method from the source code of the application, inquire the changed method to have the correlation method of the calling or called relation according to the calling relation between the methods in the source code, inquire the changed method and the corresponding interface of the correlation method according to the mapping relation between the uniform resource identifier and the method in the source code, and call the test case testing application of the test changed method and the corresponding interface of the correlation method. Because the test case is used for testing the changed method and the interface corresponding to the associated method, the test is only performed on the method affected by the change, namely the test is an incremental test instead of a full test, and therefore the test time can be shortened. And because the association method is determined according to the calling relationship between the methods, and the interface influenced by the change is determined according to the mapping relationship between the uniform resource identifier and the method, the determined interface takes the source code as the basis, the artificial subjective influence is reduced, and the efficiency of determining the interface is improved. In summary, compared with the prior art, the efficiency and the accuracy are improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is an exemplary diagram of a connection relationship of a test device of an application to a runtime server of the application;
FIG. 2 is a flow diagram illustrating a method for testing an application in accordance with an exemplary embodiment;
FIG. 3 is a flow chart illustrating a method of testing an application in accordance with an exemplary embodiment;
FIG. 4 is a flow chart illustrating a method of testing an application in accordance with an exemplary embodiment;
FIG. 5 is a flowchart illustrating a process for obtaining a calling relationship between methods, in accordance with an illustrative embodiment;
FIG. 6 is a flow chart illustrating a method of testing an application in accordance with an exemplary embodiment;
FIG. 7 is a block diagram illustrating an application testing apparatus according to an exemplary embodiment;
FIG. 8 is a block diagram illustrating test equipment for an application in accordance with an exemplary embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
An example of a scenario to which the testing solution of the present disclosure is adapted is shown in fig. 1: developers write and update source programs of applications using the Java language. Therefore, the source code of the application can be acquired from the running server of the application, and the testing method of the application disclosed by the disclosure is executed by taking the source code as a processing object, so that the purpose is to perform incremental testing on the changed application after the source code of the application is changed, and compared with the prior art, the incremental testing process has higher efficiency and accuracy.
Optionally, the testing apparatus or device of the application of the present disclosure may be independent of the application running server, and is connected to the application running server (illustrated in fig. 1), or may be integrated with the application running server (not illustrated in fig. 1), which is not limited herein.
FIG. 2 is a flow chart illustrating a method of testing an application, according to an exemplary embodiment, including the steps of:
s201: the method of the change is located from the source code of the application.
A method (method) is an object in Java-based source code that implements logic. An optional implementation manner of S201 is: and positioning the changed content from the source code of the application, and analyzing the changed content to obtain the changed method. The above process can be implemented using existing tools. The changed content is directly positioned from the source code by using the existing tool, so that the changed positioning is more accurate and the method is easy to realize.
It is understood that S201 may also be implemented using other existing methods, which are not limited herein.
S202: and inquiring the associated method of the changed method according to the calling relationship among the methods in the source code.
The method associated with the changed method is a method having a calling or called relationship with the changed method. Because there is a call or called relationship, the associated method may be affected by the changed method.
The specific implementation flow of the call relation is shown in fig. 5.
S203: and inquiring the interface corresponding to the target method according to the mapping relation between the URI and the method in the source code.
Wherein the target methods include methods that are subject to change and associated methods.
Uniform Resource Identifiers (URIs) include routing information of resources that can be called by a method, so that routing information of instructions in method execution can be obtained through the URIs, and interface information in the routing information is an interface corresponding to the method.
Specifically, one way to obtain the mapping relationship between the URI and the method is as follows: and identifying the content of the annotation of the preset category in the compiled file to obtain the mapping relation between the URI and the method. Wherein the annotations of the preset category are annotations beginning with @ and comprising a URI.
It can be understood that the above specific manner is only an example, and other manners may also be used to obtain the mapping relationship between the URI and the method, for example, a developer of the application records the mapping relationship between the URI and the method in the source code of the application in advance, and in this embodiment, the record may be directly queried.
Obviously, the method for acquiring the mapping relation through annotation can save labor cost and improve efficiency and recording accuracy.
S204: and calling a target test case and testing the application.
The target test case is used for testing an interface corresponding to the target method.
Optionally, the target test case may be compiled in real time by a developer after obtaining the interface corresponding to the target method.
Or, in order to further improve the test efficiency, a test case library may be configured in advance, and a correspondence between the test cases and the interfaces is recorded, where an interface used for testing the test cases is an interface corresponding to the test cases. In this embodiment, after the interface corresponding to the target method is obtained, the test case corresponding to the interface, that is, the target test case, is queried from a preset test case library.
The flow shown in fig. 2 has the following beneficial effects:
1. the interface affected by the change, namely the interface corresponding to the target method, is obtained according to the calling relationship between the methods in the source code and the mapping relationship between the URI and the methods, and the interface is obtained on the basis of the source code, so that compared with the existing manual determination mode, the inaccuracy caused by subjective influence can be reduced, the possibility of missing the interface and misjudging the interface is reduced, and the test accuracy is improved.
2. And the interface is automatically acquired, so that the efficiency can be improved.
3. The interface of the called target test case test is the interface affected by the change, namely the test is the incremental test, so the test time can be shortened, and the requirement of quick iteration of the application can be met.
4. The test cases can be repeatedly used due to the arrangement of the test case library, so that the workload of research and development personnel is reduced, the test efficiency is improved, and the test time is shortened.
Fig. 3 is a flow chart illustrating a testing method of an application according to an exemplary embodiment, which is different from fig. 2 in that a step of performing test guidance for a user (e.g., a tester) is added.
The flow shown in fig. 3 includes the following steps:
s301: the method of the change is located from the source code of the application.
S302: and inquiring the associated method of the changed method according to the calling relationship among the methods in the source code.
S303: and compiling the source code of the application to obtain a compiled file.
S304: and identifying the content of the annotation of the preset category in the compiled file to obtain the mapping relation between the URI and the method.
S305: for any target method, judging whether a corresponding URI exists according to the mapping relation between the URI and the method, if so, executing S306, and if not, executing S307.
S306: and inquiring the interface corresponding to the target method according to the mapping relation between the target method and the URI. After S306, S308 is executed.
S307: and sending out first prompt information.
The first prompt message is used for prompting a test case providing the target method.
Because the corresponding URI can not be inquired, the interface corresponding to the target method can not be obtained, and therefore, the test case can not be automatically called from the test case database, a prompt is sent, and a tester can manually determine the interface corresponding to the target method according to the prompt and manually provide the test case to ensure the smooth implementation of the test. Specifically, after the interface is manually determined, the test case may be queried from the test case library and provided to the test flow, or the test case may be manually compiled.
S308: and inquiring and calling the target test case from the test case library according to the corresponding relation between the interface and the test case.
S309: and judging whether an interface which does not inquire the test case exists, and if so, executing S310.
S310: and sending second prompt information, wherein the second prompt information is used for prompting the supplementary target test case.
It can be understood that, under the condition that the target test case is not inquired in the test case library, the prompt for supplementing the target test case can guide the tester to ensure the smooth implementation of the test, and although the tester needs to provide the target test case, the interface is determined to be accurate and efficient because the determination basis of the interface is considerable.
As can be seen from the flow shown in fig. 3, the test method for the application disclosed in this embodiment can not only automatically invoke the test case, but also send out a prompt message to guide a tester to perform a supplementary operation to complete the test process when the interface affected by the change cannot be determined and the test case corresponding to the interface does not exist. Because accurate guide can be given to the tester, so, compare with prior art, still have higher efficiency and precision.
FIG. 4 is a flow chart illustrating a method of testing an application in accordance with an exemplary embodiment, differing from FIG. 3 in that a step of refining the test case library boot is added. Namely the following steps are added:
s311: and counting the proportion of the called test cases in the test case library.
Specifically, the called test cases and the proportion of all test cases in the test case library can be counted for each applied test process.
S312: and sending an adjustment prompt according to the proportion, wherein the adjustment prompt is used for prompting the adjustment of the test cases in the test case library.
Specifically, the average value of the proportions corresponding to all tested applications may be counted, and if the average value is smaller than a preset threshold value, it indicates that there are few frequently used test cases but there are many less frequently used test cases in the test case library.
Furthermore, the written test cases can be added into a test case library. And moreover, the probability of each test case being used can be obtained, and the test cases with the probability smaller than a preset probability threshold are deleted, so that the test case library is optimized, and the efficiency of subsequent tests is further improved.
The process shown in fig. 4 can perform quality evaluation on the test case library, guide the tester to perfect and optimize the test case library, and further improve the efficiency of subsequent tests.
For the description of other steps in fig. 4, reference may be made to the above method embodiment, which is not described herein again.
FIG. 5 is a diagram illustrating a process for obtaining call relationships between methods, according to an exemplary embodiment, including the steps of:
s501: and compiling the source code of the application to obtain a compiled file.
S502: information identifying a method from the compiled file.
Wherein, the information of the method comprises: parameters of the call instructions of the method.
S503: and obtaining the calling relation among the methods by traversing and identifying the parameters of the calling instruction.
For example, traversing invoke instructions of all methods to obtain parameters of the invoke instructions, since the parameters of the calling instructions can reflect the caller and the callee, the calling relationship between the methods can be obtained.
S504: the calling relationship is stored in the form of a relationship tree.
Specifically, based on the characteristics of Java, the control layer controller is used to implement the call of the service layer, so that the controller may be used as a root node to record the call relationship between methods. Because the controller is the starting point of the call instruction, the controller is taken as the root node, so that the call relationship is clearer and more complete.
The specific form of the relationship tree can be seen in the prior art.
Optionally, the relationship tree may be used as a query for calling the relationship in the test process, and may also be used as a query for testing personnel, so that other relationships may be recorded in the relationship tree, for example, the following steps:
s505: information of the interface, information of the abstract class, information of the implementation class, and a correspondence between the implementation class and the interface are identified from the compiled file.
The implementation class for implementing the interface corresponds to the interface.
S506: and recording the information of the interface, the information of the abstract class, the information of the implementation class and the corresponding relation between the implementation class and the interface in a relation tree.
Specifically, the root node of the relationship tree is a controller, the subordinate nodes of the root node are abstract class nodes and implementation class nodes, and the subordinate nodes of the implementation class are method nodes and interface nodes corresponding to the implementation class. Wherein, the method nodes with calling relation are connected.
Because the relation tree records the calling relation and the relation between the interface and the class, the tester can conveniently obtain the logic architecture in the source code by inquiring the relation tree.
It will be appreciated that other means of acquisition, e.g. recording and storage by a tester, may be used in addition to the above described procedure.
In the flow shown in fig. 5, the call relation between the methods is queried by compiling the call instruction in the file, because the parameter of the call instruction can reflect the caller and the callee, the call relation between the methods can be accurately obtained, and because the parameter of the call instruction is traversed, the missing call relation can be reduced.
It is understood that, in order to further shorten the time used by the testing process, the obtaining of the corresponding relationship, the obtaining of the mapping relationship, and the positioning of the changed method may be performed in parallel, fig. 6 is a flowchart illustrating a testing method of an application according to an exemplary embodiment, and includes the following processes:
S601-S606 are performed in a preset cycle.
S601: the source code of the application is extracted.
S602: and compiling the source code of the application to obtain a compiled file.
S603: and acquiring information of a method in the compiled file and acquiring information of an interface, information of an abstract class, information of an implementation class and a corresponding relation between the implementation class and the interface by using a bcel tool.
S604: and obtaining the calling relation among the methods by traversing the parameters of the calling instruction in the information of the identification method.
S605: recording the calling relation between the methods, the information of the interfaces, the information of the abstract classes, the information of the implementation classes and the corresponding relation between the implementation classes and the interfaces in the form of a relation tree.
S606: and identifying the content of the annotation of the preset category in the compiled file to obtain the mapping relation between the URI and the method.
Wherein, S603-S605 are branches for obtaining the relation tree, S606 is a branch for obtaining the mapping relation between the URI and the method, and the two branches are executed in parallel.
S607: from the source code of the application, the changed content is located.
S608: and analyzing the changed content to obtain the changed method.
It is understood that S607-S608 may also be executed in the above-described cycle, i.e., in the above-described execution cycle, S607-S608 are executed as another branch in parallel with S603-S605, S606. Alternatively, S607-S608 may be executed according to a trigger instruction after the source code of the application is changed. The trigger instruction is triggered by the completion of the source code change or manually.
S609: and inquiring the association method of the changed method according to the calling relationship among the methods.
S610: and inquiring the interface corresponding to the target method according to the mapping relation between the URI and the method.
S611: and calling a target test case in the test case library to test the application.
The execution mode shown in fig. 6 can periodically acquire the corresponding relationship and the mapping relationship, so that the acquisition of the corresponding relationship and the mapping relationship can follow the update of the source code, and each branch is executed in parallel, thereby further improving the efficiency of the test and shortening the time of the test.
FIG. 7 is a block diagram illustrating an application testing apparatus according to an exemplary embodiment. The device comprises a positioning module 1, a first query module 2, a second query module 3 and a test module 4.
A positioning module configured to position a method of the change from source code of the application;
a first query module configured to query an association method of the changed method according to a call relationship between the methods in the source code, where the association method is the method having a call or called relationship with the changed method;
a second query module configured to query an interface corresponding to a target method according to a mapping relationship between the URI in the source code and the method, where the target method includes the changed method and the association method;
and the test module is configured to call a target test case and test the application, wherein the target test case is used for testing an interface corresponding to the target method.
With regard to the apparatus for detecting network performance in the above embodiments, the specific manner in which each module performs operations has been described in detail in the embodiments related to the method, and will not be elaborated herein.
Fig. 8 shows a block diagram of a hardware structure of a test apparatus for an application, which may include: a processor 1, a communication interface 2, a memory 3 and a communication bus 4;
in the embodiment of the application, the number of the processor 1, the communication interface 2, the memory 3 and the communication bus 4 is at least one, and the processor 1, the communication interface 2 and the memory 3 complete mutual communication through the communication bus 4;
the processor 1 may be a central processing unit CPU, or an application Specific Integrated circuit asic, or one or more Integrated circuits configured to implement embodiments of the present invention, etc.;
the memory 3 may include a high-speed RAM memory, and may further include a non-volatile memory (non-volatile memory) or the like, such as at least one disk memory;
wherein the memory stores executable instructions and the processor may invoke the instructions stored by the memory for:
locating a method of change from source code of an application;
inquiring the association method of the changed method according to the calling relationship among the methods in the source code, wherein the association method is the method which has calling or called relationship with the changed method;
inquiring an interface corresponding to a target method according to the mapping relation between the Uniform Resource Identifier (URI) and the method in the source code, wherein the target method comprises the changed method and the associated method;
and calling a target test case to test the application, wherein the target test case is used for testing an interface corresponding to the target method.
Optionally, the refinement and extension functions of the instructions may be as described above.
In an exemplary embodiment, there is also provided a storage medium comprising instructions, for example a memory 3 comprising instructions, executable by a processor 1 of a retrieval device for multimedia files to perform the above method. Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A method for testing an application, comprising:
locating a method of change from source code of an application;
inquiring the association method of the changed method according to the calling relationship among the methods in the source code, wherein the association method is the method which has calling or called relationship with the changed method;
inquiring an interface corresponding to a target method according to a mapping relation between a uniform resource identifier and a method in the source code, wherein the target method comprises the changed method and the association method;
and calling a target test case to test the application, wherein the target test case is used for testing an interface corresponding to the target method.
2. The method of claim 1, wherein locating a changed method from source code of an application comprises:
locating the changed content from the source code of the application;
and analyzing the changed content to obtain the changed method.
3. The method according to claim 1, wherein the obtaining process of the calling relationship between the methods comprises:
compiling the source code of the application to obtain a compiled file;
identifying information of the method from the compiled file, the information of the method including parameters of a calling instruction of the method;
and obtaining the calling relation among the methods by traversing and identifying the parameters of the calling instruction.
4. The method according to claim 1, wherein the obtaining of the mapping relationship between the uniform resource identifier and the method comprises:
compiling the source code of the application to obtain a compiled file;
and identifying the content of the annotation of the preset category in the compiled file to obtain the mapping relation between the uniform resource identifier and the method, wherein the uniform resource identifier comprises routing information.
5. The method of claim 1 or 4, further comprising:
and sending first prompt information under the condition that an interface corresponding to the target method is not inquired, wherein the first prompt information is used for prompting a test case providing the target method.
6. The method of claim 1, wherein invoking the target test case comprises:
and querying the target test case corresponding to the interface from a preset test case library.
7. The method of claim 6, further comprising:
counting the proportion of the called test cases in the test case library;
and sending an adjustment prompt according to the proportion, wherein the adjustment prompt is used for prompting the adjustment of the test cases in the test case library.
8. A test apparatus for an application, comprising:
a positioning module configured to position a method of the change from source code of the application;
a first query module configured to query an association method of the changed method according to a call relationship between the methods in the source code, where the association method is the method having a call or called relationship with the changed method;
a second query module configured to query an interface corresponding to a target method according to a mapping relationship between a uniform resource identifier in the source code and the method, where the target method includes the changed method and the associated method;
and the test module is configured to call a target test case and test the application, wherein the target test case is used for testing an interface corresponding to the target method.
9. A test apparatus for an application, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement a method of testing an application as claimed in any one of claims 1 to 7.
10. A storage medium in which instructions, when executed by a processor of a device for detecting network performance, enable a testing device for detecting applications to perform a method of testing an application as claimed in any one of claims 1 to 7.
CN202011008623.5A 2020-09-23 2020-09-23 Application testing method, device, equipment and storage medium Pending CN112131114A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011008623.5A CN112131114A (en) 2020-09-23 2020-09-23 Application testing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011008623.5A CN112131114A (en) 2020-09-23 2020-09-23 Application testing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112131114A true CN112131114A (en) 2020-12-25

Family

ID=73842812

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011008623.5A Pending CN112131114A (en) 2020-09-23 2020-09-23 Application testing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112131114A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2508643A (en) * 2012-12-07 2014-06-11 Ibm Method for Performing a Regression Test after Modifying Source Code File
CN110389896A (en) * 2019-06-18 2019-10-29 中国平安人寿保险股份有限公司 Code automated analysis and test method, device and computer readable storage medium
CN111400164A (en) * 2020-02-07 2020-07-10 浙江口碑网络技术有限公司 Software testing method and device
CN111522734A (en) * 2020-03-17 2020-08-11 上海云励科技有限公司 Software function testing method and device, electronic equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2508643A (en) * 2012-12-07 2014-06-11 Ibm Method for Performing a Regression Test after Modifying Source Code File
CN110389896A (en) * 2019-06-18 2019-10-29 中国平安人寿保险股份有限公司 Code automated analysis and test method, device and computer readable storage medium
CN111400164A (en) * 2020-02-07 2020-07-10 浙江口碑网络技术有限公司 Software testing method and device
CN111522734A (en) * 2020-03-17 2020-08-11 上海云励科技有限公司 Software function testing method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN106909510B (en) Method for obtaining test case and server
CN107622014B (en) Test report generation method and device, readable storage medium and computer equipment
CN108984389B (en) Application program testing method and terminal equipment
CN109522228B (en) Interface automation test data construction method, device, platform and storage medium
CN111522728A (en) Method for generating automatic test case, electronic device and readable storage medium
CN110134583B (en) Software testing and data processing method and device
US20090222646A1 (en) Method and apparatus for detecting processor behavior using instruction trace data
CN111190827A (en) Interface automation test method and device, storage medium and electronic equipment
CN112905441A (en) Test case generation method, test method, device and equipment
CN113448854A (en) Regression testing method and device
CN112540808B (en) Recording method of program behavior hierarchy call relationship and related equipment
CN115658452A (en) Buried point checking method, buried point checking device, readable storage medium and electronic equipment
CN112965912B (en) Interface test case generation method and device and electronic equipment
CN116560996A (en) Automatic testing method and device for business process, medium and equipment
CN112131114A (en) Application testing method, device, equipment and storage medium
CN116069667A (en) Test case auxiliary positioning method and device based on code analysis
CN116107897A (en) Code coverage rate statistics method and device
CN110674024A (en) Electronic equipment integration test system and method thereof
CN114637688A (en) Coverage rate statistical method and device based on version branches
CN114647588A (en) Interface test method and device
CN113032254A (en) Evaluation method and device for test coverage condition
CN113282504A (en) Incremental code coverage rate detection method and service development method and device
CN113656318A (en) Software version testing method and device and computer equipment
CN113094258A (en) Precise test method and device, computer equipment and medium
CN111414194A (en) Interface information generation method and system, electronic equipment and storage medium

Legal Events

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