A business-driven page comparison test method and device
Through a business-driven page comparison testing method, the business data of the new and old versions of the App are automatically collected and compared, which solves the problem of insufficient UI test coverage scenarios and improves test efficiency and coverage.
Patent Information
- Application Number
- CN202111538011.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-15
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2041-12-15
AI Technical Summary
In the existing technology, the user interface UI testing of Apps does not cover enough scenarios, has low testing efficiency, and the workload of manual testing is huge with a high risk of missed tests.
Adopt a business-driven page comparison test method, collect business data through automated testing, establish a business mapping relationship between the new and old interfaces, configure the simulation interface to generate simulation data, perform page screenshot comparison, and output error reports.
It achieves automation and comprehensive coverage of business scenarios, improves testing efficiency, reduces manpower investment, and reduces the risk of missed tests.
Smart Images

Figure CN114201405B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software testing, and in particular to a business-driven page comparison testing method and device. Background Art
[0002] With the rapid development of mobile Internet, the functions that can be realized by apps (Applications) are becoming more and more complex, making the user interface display and interaction methods of apps more and more diverse. This brings great challenges to testers when performing regression testing on apps before release.
[0003] For scenarios where the business functions of the app's user interface (UI) remain unchanged, but only the related service interfaces are modified, the current testing approach involves testing the related service functions with the interface, then testing the new app version to verify that the new service interfaces are functioning properly. This process requires reverting to the old app version and revising all UI interactions and functionality related to the business.
[0004] The existing technology uses manual testing solutions, which require manual simulation of data and checking of parameters of new app versions and new interfaces. This is a huge workload, requires a large amount of human resources, and has low testing efficiency. At the same time, manual testing does not cover enough business scenarios, has a high rate of missed tests, and poses a high risk of missed tests. Summary of the Invention
[0005] The purpose of the present invention is to provide a business-driven page comparison test method and device to solve the technical problems of insufficient manual test coverage and low test efficiency in the prior art.
[0006] The purpose of the present invention can be achieved through the following technical solutions:
[0007] A business-driven page comparison testing method includes the following steps:
[0008] Performing automated testing on both the new and old versions of the target application, triggering business scenarios for service changes during the testing process and collecting business data. Based on the business data, a business mapping relationship is established between the new and old interfaces. The service changes are services where the interface services have changed between the new and old versions of the target application. The new interface corresponds to the new version of the application, and the old interface corresponds to the old version of the application.
[0009] Determining interfaces corresponding to the changed services in the new and old versions of the target application respectively according to the service data and the service mapping relationship;
[0010] Configuring a simulation interface to simulate an interface corresponding to the changed service and generating simulation data corresponding to the changed service;
[0011] The new and old versions of the target application are tested respectively according to the simulation data, a screenshot of the page associated with the changed business is taken, and the page screenshot is compared with the preset page image of the corresponding version. If they are the same, the page comparison test is passed, otherwise an error report is output.
[0012] Optionally, collecting business data specifically includes:
[0013] Collect business tracking data, page tracking data, behavior tracking data, and interface tracking data through business tracking data, page tracking data, behavior tracking data, and interface tracking data respectively;
[0014] Among them, the business burial data includes the business code corresponding to the changed business and the page code associated with the changed business, the page burial data includes the page code and the interface name of the interface request contained in the page, the behavior burial data includes the interface name of the interface request when the behavior is generated, and the interface burial data includes the page code, interface name, request parameters and returned response data of the interface request.
[0015] Optionally, collecting business data further includes:
[0016] The business buried data, the page buried data, the behavior buried data and the interface buried data are obtained through the proxy server of the target application.
[0017] Optionally, determining, based on the business data and the business mapping relationship, interfaces corresponding to the changed business in the new and old versions of the target application program specifically includes:
[0018] The pages corresponding to the changed business in the new and old versions of the target application are determined respectively according to the business embedding data, and the interfaces corresponding to the pages are determined according to the page embedding data and the business mapping relationship.
[0019] Optionally, it also includes:
[0020] Determine whether there are different versions of interface services for the business based on the business code.
[0021] The present invention also provides a business-driven page comparison test device, comprising:
[0022] A business data collection module is configured to perform automated testing on the new and old versions of the target application, trigger business scenarios for business changes during testing, collect business data, and establish a business mapping relationship between the new and old interfaces based on the business data; wherein the business changes are businesses in which the interface services have changed between the new and old versions of the target application, the new interface corresponds to the new version of the application, and the old interface corresponds to the old version of the application;
[0023] A service interface determination module, configured to determine, based on the service data and the service mapping relationship, the interfaces corresponding to the changed service in the new and old versions of the target application;
[0024] A data simulation module is used to configure a simulation interface to simulate the interface corresponding to the changed service and generate simulation data corresponding to the changed service;
[0025] The page comparison module is used to test the new and old versions of the target application according to the simulated data, take screenshots of the pages associated with the changed business, and compare the page screenshots with the preset page images of the corresponding versions. If they are the same, the page comparison test is passed, otherwise an error report is output.
[0026] Optionally, the business data collection module collects business data specifically including:
[0027] The business data collection module collects business buried point data, page buried point data, behavior buried point data and interface buried point data respectively through business buried point data, page buried point data, behavior buried point data and interface buried point data;
[0028] Among them, the business burial data includes the business code corresponding to the changed business and the page code associated with the changed business, the page burial data includes the page code and the interface name of the interface request contained in the page, the behavior burial data includes the interface name of the interface request when the behavior is generated, and the interface burial data includes the page code, interface name, request parameters and returned response data of the interface request.
[0029] Optionally, the business data collection module collecting business data further includes:
[0030] The proxy server of the target application is used to obtain the business buried data, the page buried data, the behavior buried data and the interface buried data.
[0031] Optionally, the service interface determination module determines, based on the service data and the service mapping relationship, interfaces corresponding to the changed service in the new and old versions of the target application program, including:
[0032] The business interface determination module determines the pages corresponding to the changed business in the new and old versions of the target application according to the business embedding data, and determines the interface corresponding to the page according to the page embedding data and the business mapping relationship.
[0033] Optionally, the service interface determination module is further configured to:
[0034] Determine whether there are different versions of interface services for the business based on the business code.
[0035] The present invention provides a business-driven page comparison test method and device, wherein the method includes the following steps: performing automated testing on the new and old versions of a target application respectively, triggering a business scenario of a changed business and collecting business data during the test, and establishing a business mapping relationship between the new and old interfaces based on the business data; wherein the changed business is a business in which the interface service changes in the new and old versions of the target application, the new interface corresponds to the new version of the application, and the old interface corresponds to the old version of the application; according to the business data and the business mapping relationship, determining the interface corresponding to the changed business in the new and old versions of the target application respectively; configuring a simulation interface to simulate the interface corresponding to the changed business, and generating simulation data corresponding to the changed business; testing the new and old versions of the target application respectively according to the simulation data, taking a screenshot of the page associated with the changed business, and performing an image comparison between the page screenshot and the preset page image of the corresponding version; if they are the same, the page comparison test is passed, otherwise an error report is output.
[0036] In view of this, the beneficial effects brought about by the present invention are:
[0037] The present invention performs automated testing on the new and old versions of the target application, triggers business scenarios in which interface services are changed, collects corresponding business information data into a database, establishes a business mapping relationship between the new and old interfaces based on the business information data, and can automatically and comprehensively cover business scenarios; obtains the interface corresponding to the changed business based on the analysis of the business information data and the business mapping relationship, configures a simulation interface based on the interface corresponding to the changed business, and can automatically generate simulation data corresponding to the changed business, quickly achieve data consistency between the new and old interfaces, and significantly improve test efficiency while comprehensively covering business scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 Schematic diagram of the method flow of the present invention;
[0039] Figure 2 A schematic diagram of a process of an embodiment of the method of the present invention;
[0040] Figure 3A schematic diagram of substructure changes in an embodiment of the method of the present invention;
[0041] Figure 4 A schematic diagram of structural changes of an embodiment of the method of the present invention;
[0042] Figure 5 Schematic diagram of the structure of an embodiment of the device of the present invention. DETAILED DESCRIPTION
[0043] The embodiment of the present invention provides a business-driven page comparison test method and device to solve the technical problems of insufficient manual test coverage and low test efficiency in the prior art.
[0044] To facilitate understanding of the present invention, the present invention will be described more fully below with reference to the accompanying drawings. Preferred embodiments of the present invention are shown in the drawings. However, the present invention may be embodied in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and comprehensive disclosure of the present invention.
[0045] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one skilled in the art to which this invention pertains. The terms used in this specification of the present invention are for the purpose of describing specific embodiments only and are not intended to limit the present invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0046] In scenarios where the functional user interface (UI) of a target application (app) remains unchanged, only the interface services of related services are modified. Current testing methods test the relevant business functions through the interface, then test the new app version to verify the new interface services are functioning properly. This requires reverting to the old app version, a significant workload requiring reverting all UI interactions and functional points of the related services. This carries a high test risk and is prone to omissions. The business-driven page comparison testing method and apparatus provided by the present invention can effectively improve test efficiency and increase business coverage.
[0047] See also Figure 1 The present invention provides an embodiment of a business-driven page comparison test method, comprising the following steps:
[0048] S100: Automated testing is performed on the new and old versions of the target application, triggering business scenarios for service changes and collecting business data during the testing process. A business mapping relationship is established between the new and old interfaces based on the business data. The changed service is a service whose interface service has changed between the new and old versions of the target application, the new interface corresponds to the new version of the application, and the old interface corresponds to the old version of the application.
[0049] S200: Determine, based on the service data and the service mapping relationship, interfaces corresponding to the changed service in the new and old versions of the target application;
[0050] S300: Configuring a simulation interface to simulate an interface corresponding to the changed service, and generating simulation data corresponding to the changed service;
[0051] S400: Test the new and old versions of the target application respectively according to the simulation data, take screenshots of the pages associated with the changed business, and compare the page screenshots with the preset page images of the corresponding versions. If they are the same, the page comparison test is passed, otherwise an error report is output.
[0052] In step S100, the new version of the target application means that the interface services of some businesses have changed relative to its old version. The changed business is the business whose interface services have changed in the new and old versions of the target application. When the interface service corresponding to the changed business changes, a UI automation test is performed on the new and old versions of the target application App respectively to trigger the business scenario corresponding to the changed business, collect business-related information data into the database, and then establish a business field mapping relationship between the new and old interfaces based on the stored information data.
[0053] In this embodiment, when performing automated testing on the new and old versions of the target application App, the business scenarios corresponding to the changed business are covered, with the purpose of triggering the sending of business tracking points, page tracking points, and behavior tracking points in order to collect business-related information data. Specifically, business tracking points, page tracking points, behavior tracking points, and interface tracking points are used to collect business tracking point data, page tracking point data, behavior tracking point data, and interface tracking point data, respectively, and these data can be saved in corresponding data tables;
[0054] in:
[0055] (1) Business tracking refers to triggering the business scenario corresponding to the business change by executing the business use case, and then sending the corresponding business tracking to collect business tracking data. The business tracking data may include the business name, business code (i.e. business id), the page associated with the business (page id), the interface name corresponding to the page (interface api), the UI page / UI module involved in the business, and the interface field corresponding to the page / module.
[0056] See also Figure 3 and Figure 4 For example, in the product bundle recommendation module displayed on the product details page, suppose the interface service changes include modifying the suite structure in the old app version to the suiteV2 structure in the new app version, and modifying the SuiteInfo substructure within the suite structure to the SuiteInfoV2 substructure within the suiteV2 structure. Business tracking can be used to map the business ID between the old and new app versions. For the same business ID (product bundle recommendation module), the old interface service corresponds to the suite structure and SuiteInfo substructure in the business tracking data for the old app version; while the new interface service corresponds to the suiteV2 structure and SuiteInfoV2 substructure in the business tracking data for the new app version. In other words, the data for the product bundle recommendation module is recorded in the database as two pieces of data: one representing the old interface service suite data structure in the old app version, and the other representing the new interface service suiteV2 data structure in the new app version. This relationship allows the differences between the old and new app versions to be identified.
[0057] It is worth mentioning that Figure 3 The comparison of a field in a certain functional business of the new and old interfaces is to describe the differences in the field structure between the new and old interfaces. Figure 4 The differences are specifically listed in the figure. The left side of the arrow is the field structure of the old interface, and the right side is the field structure of the new interface.
[0058] (2) Page tracking records the page IDs of all pages of the App and the interface names (interface APIs) of all interface requests contained in the pages. Similar to business tracking, the interface APIs of interface requests for certain cross-page businesses can be obtained through page tracking data.
[0059] For example, in the ordering process, you select a product from the product list, enter the product details, trigger the add to cart action on the product details page, proceed to the shopping cart page to check out, and then pay on the checkout page. This business process involves multiple pages. By using page tracking and combining it with the previous business tracking, you can obtain data differences between the interface fields of cross-page business operations between the new and old versions of the app.
[0060] (3) Integration is then performed through interface tracking. Interface tracking records the parameters of each interface request and the response data returned by the interface in the new and old versions of the App. Interface tracking data specifically includes: the page ID that currently issues the interface request, the interface name (interface API), the interface request parameters, and the response data returned by the interface. By integrating the three types of tracking data, namely business tracking data, page tracking data, and interface tracking data, a business mapping relationship can be established between the new and old interfaces corresponding to the new and old versions of the App.
[0061] In this embodiment, the new and old versions of the App respectively perform UI automation testing or manual smoke testing or development debugging of the development process, and both will collect business tracking information, that is, as long as the App is started, data will be collected, and the interface data of the unified business tracking and the captured interface return data will be stored together. The new and old version interface services are distinguished according to the new and old versions of the App, and the business mapping relationship between the new and old interfaces is established through the business id, that is, the new interface service corresponds to the new version of the application, and the old interface service corresponds to the old version of the application. Duplicate data is filtered and cleaned, for example, data with the same App version and the same interface service version are filtered out.
[0062] In this embodiment, a business mapping relationship between the new interface and the old interface is established based on the business ID to record the relationship between interface services of different versions for the same business. That is, for the same business, the new version of the App corresponds to the new interface service, and the old version of the App corresponds to the old interface service.
[0063] It is worth noting that in this embodiment, the business mapping relationship between the new and old interfaces is established through key-value pairs.
[0064] Mapping is performed through the data tables in the database. The keyword key of the business data table is the business id. Each business id has a corresponding value. For example, each business id has a corresponding interface information list (json format), including the interface id list, interface version, App version, interface request parameters, and response data returned by the interface.
[0065] In step S200, interfaces corresponding to the changed services in the new and old versions of the target application are determined respectively according to the service data and the service mapping relationship.
[0066] In this embodiment, for the changed business in which the interface service changes between the new and old versions of the App, the page object on which the changed business relies is analyzed through the business dictionary, and then the interface API of the interface request contained in the page is further analyzed to analyze all the interface APIs supported by the changed business.
[0067] Specifically, the business dictionary includes information such as the version of the App, the pages involved in the business change, the interface services carried by the pages, the return information of the interface services, whether there are associated new and old versions of the interface services, etc. The business dictionary data is obtained by using the interface packet capture method to obtain business buried data, page buried data, behavior buried data and interface buried data after UI automation execution, and then cleaning these data. Among them, the page buried data records the interface APIs of all requests after entering the page, the behavior buried data records the interface APIs of all requests when a certain behavior occurs, and the interface buried data records the request parameters of all interface APIs. These data are integrated to obtain a data table based on the business ID. According to the business ID, it can be queried whether there are multiple versions of interface services for a certain change business.
[0068] In this embodiment, when executing the test script, the aforementioned data is obtained through the data service interface of the App-proxy server and used in the test case of the automated test. Furthermore, App-proxy data can be obtained based on the App version settings. That is, when a new version of the App requests the interface service, the new interface data is returned, while when an old version of the App requests the interface service, the old interface data is returned.
[0069] It is worth noting that in this embodiment, a business dictionary is obtained based on business tracking data, page tracking data, behavior tracking data and interface tracking data. Through the business dictionary, the corresponding page is matched for each changed business according to the business id, and the interface dependency can be deduced based on the interface API of the interface request contained in the page, that is, all interface APIs corresponding to each changed business (business id) can be determined according to the business dictionary.
[0070] In step S300, a simulation interface is configured to simulate an interface corresponding to the changed service, and simulation data corresponding to the changed service is generated.
[0071] In this embodiment, data mocking is performed on the changed services corresponding to these interfaces through the interface mock service and the service mapping relationship between the new and old interfaces.
[0072] A mock service (i.e., a simulation service) is a service that, through proxy requests, can tamper with interface data or filter out interface responses. For example, if the data retrieved from the business tracking data table corresponding to the order process corresponds to a detailed purchase service, since the purchase requires inventory, if the inventory is expired, the detailed purchase service will fail. Therefore, a mock service is necessary to support the data falsification and tampering. The mock service can also control whether the mock service is used for the new interface or the old interface based on the new and old versions of the app.
[0073] It is worth noting that in this embodiment, mock data is automatically generated, and this data can be obtained through the above-mentioned buried point information and interface information, that is, it can be obtained by collecting business buried point data, page buried point data, behavior buried point data and interface buried point data.
[0074] In step S400, the new and old versions of the target application are tested respectively according to the generated simulation data, a screenshot of the page associated with the changed business is taken, and the page screenshot is compared with the preset page image of the corresponding version. If they are the same, the page comparison test is passed, otherwise an error report is output.
[0075] Specifically, UI automation testing is performed on the new and old versions of the App based on the generated simulation data, and screenshots of the pages involved in the changed business are saved. After all automation tasks are completed, based on the page images of the corresponding businesses carried by the classified new and old versions of the App, image comparison is performed on the page screenshots of the same business and the classified page images in the corresponding versions. If the comparison results are the same, the page comparison test passes. If there are differences, an error report is output.
[0076] It is worth noting that this embodiment uses existing technology to perform image comparison, for example, image comparison is performed based on the image recognition function of OpenCV.
[0077] The business-driven page comparison test method provided in this embodiment performs automated testing on the new and old versions of the target application respectively, triggers business scenarios in which interface services are changed, collects corresponding business information data into a database, and establishes a business mapping relationship between the new and old interfaces based on the business information data, which can automatically and comprehensively cover business scenarios; obtains the interface corresponding to the changed business based on the analysis of the business information data and the business mapping relationship, configures a simulation interface based on the interface corresponding to the changed business, and can automatically generate simulation data corresponding to the changed business, quickly achieve data consistency between the new and old interfaces, and greatly improve test efficiency while comprehensively covering business scenarios.
[0078] See also Figure 5The present invention also provides a business-driven page comparison test device, comprising:
[0079] The business data collection module 11 is configured to perform automated testing on the new and old versions of the target application, trigger business scenarios for business changes during the testing process, collect business data, and establish a business mapping relationship between the new and old interfaces based on the business data. The business changes are businesses in which the interface services have changed between the new and old versions of the target application, with the new interface corresponding to the new version of the application and the old interface corresponding to the old version of the application.
[0080] A service interface determination module 12 is configured to determine, based on the service data and the service mapping relationship, the interfaces corresponding to the changed service in the new and old versions of the target application;
[0081] A data simulation module 13 is used to configure a simulation interface to simulate an interface corresponding to the changed service and generate simulation data corresponding to the changed service;
[0082] The page comparison module 14 is used to test the new and old versions of the target application according to the simulated data, take screenshots of the pages associated with the changed business, and compare the page screenshots with the preset page images of the corresponding versions. If they are the same, the page comparison test is passed, otherwise an error report is output.
[0083] Preferably, the business data collection module collects business data specifically including:
[0084] The business data collection module collects business buried point data, page buried point data, behavior buried point data and interface buried point data respectively through business buried point data, page buried point data, behavior buried point data and interface buried point data;
[0085] Among them, the business burial data includes the business code corresponding to the changed business and the page code associated with the changed business, the page burial data includes the page code and the interface name of the interface request contained in the page, the behavior burial data includes the interface name of the interface request when the behavior is generated, and the interface burial data includes the page code, interface name, request parameters and returned response data of the interface request.
[0086] Preferably, the business data collection module collecting business data further includes:
[0087] The proxy server of the target application is used to obtain the business buried data, the page buried data, the behavior buried data and the interface buried data.
[0088] Preferably, the service interface determination module determines, based on the service data and the service mapping relationship, the interfaces corresponding to the changed service in the new and old versions of the target application program, specifically including:
[0089] The business interface determination module determines the pages corresponding to the changed business in the new and old versions of the target application according to the business embedding data, and determines the interface corresponding to the page according to the page embedding data and the business mapping relationship.
[0090] Preferably, the service interface determination module is further configured to:
[0091] Determine whether there are different versions of interface services for the business based on the business code.
[0092] The business-driven page comparison test device provided in this embodiment performs automated testing on the new and old versions of the target application respectively, triggers business scenarios in which interface services are changed, collects corresponding business information data into a database, and establishes a business mapping relationship between the new and old interfaces based on the business information data, which can automatically and comprehensively cover business scenarios; obtains the interface corresponding to the changed business based on the analysis of the business information data and the business mapping relationship, configures a simulation interface based on the interface corresponding to the changed business, and can automatically generate simulation data corresponding to the changed business, quickly achieve data consistency between the new and old interfaces, and greatly improve test efficiency while comprehensively covering business scenarios.
[0093] The business-driven page comparison test device provided in this embodiment integrates the interfaces of the product details business. The test that originally required 9 man-days to complete can now be completed with only 1 man-day using the page comparison test device provided in this embodiment. The mapping relationship between the new and old interfaces is established, and business scenarios are automatically and comprehensively covered. By automating mock data, consistency between the new and old interface data is achieved, and testing efficiency is greatly improved.
[0094] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0095] In the embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0096] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0097] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0098] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0099] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A page comparison test method based on business drive, characterized in that: The following steps are involved: Performing automated testing on both the new and old versions of the target application, triggering business scenarios for service changes during the testing process and collecting business data. Based on the business data, a business mapping relationship is established between the new and old interfaces. The service changes are services where the interface services have changed between the new and old versions of the target application. The new interface corresponds to the new version of the application, and the old interface corresponds to the old version of the application. Determining interfaces corresponding to the changed services in the new and old versions of the target application respectively according to the service data and the service mapping relationship; Configuring a simulation interface to simulate an interface corresponding to the changed service and generating simulation data corresponding to the changed service; Testing the new and old versions of the target application program based on the simulated data, taking screenshots of the pages associated with the changed business, and comparing the screenshots with preset page images of the corresponding versions. If they are identical, the page comparison test passes; otherwise, an error report is output; The collected business data specifically includes: Collect business tracking data, page tracking data, behavior tracking data, and interface tracking data through business tracking, page tracking data, behavior tracking data, and interface tracking data respectively; Among them, the business burial data includes the business code corresponding to the changed business and the page code associated with the changed business, the page burial data includes the page code and the interface name of the interface request contained in the page, the behavior burial data includes the interface name of the interface request when the behavior is generated, and the interface burial data includes the page code, interface name, request parameters and returned response data of the interface request.
2. The business-driven page comparison test method according to claim 1, characterized in that: The collection of business data also includes: The business buried data, the page buried data, the behavior buried data and the interface buried data are obtained through the proxy server of the target application.
3. The business-driven page comparison test method according to claim 1, characterized in that: Determining, based on the business data and the business mapping relationship, the interfaces corresponding to the changed business in the new and old versions of the target application program specifically include: The pages corresponding to the changed business in the new and old versions of the target application are determined respectively according to the business embedding data, and the interfaces corresponding to the pages are determined according to the page embedding data and the business mapping relationship.
4. The business-driven page comparison test method according to claim 1, characterized in that: Also includes: Determine whether there are different versions of interface services for the business based on the business code.
5. A business-driven page comparison test device, characterized in that: include: A business data collection module is configured to perform automated testing on the new and old versions of the target application, trigger business scenarios for business changes during testing, collect business data, and establish a business mapping relationship between the new and old interfaces based on the business data; wherein the business changes are businesses in which the interface services have changed between the new and old versions of the target application, the new interface corresponds to the new version of the application, and the old interface corresponds to the old version of the application; A service interface determination module, configured to determine, based on the service data and the service mapping relationship, the interfaces corresponding to the changed service in the new and old versions of the target application; A data simulation module is used to configure a simulation interface to simulate the interface corresponding to the changed service and generate simulation data corresponding to the changed service; a page comparison module, configured to test the new and old versions of the target application respectively according to the simulated data, take screenshots of the pages associated with the changed business, and compare the screenshots with preset page images of the corresponding versions; if they are identical, the page comparison test passes; otherwise, an error report is output; The business data collection module collects business buried point data, page buried point data, behavior buried point data and interface buried point data respectively through business buried point data, page buried point data, behavior buried point data and interface buried point data; Among them, the business burial data includes the business code corresponding to the changed business and the page code associated with the changed business, the page burial data includes the page code and the interface name of the interface request contained in the page, the behavior burial data includes the interface name of the interface request when the behavior is generated, and the interface burial data includes the page code, interface name, request parameters and returned response data of the interface request.
6. The business-driven page comparison test device according to claim 5, characterized in that: The business data collection module collects business data and further includes: The proxy server of the target application is used to obtain the business buried data, the page buried data, the behavior buried data and the interface buried data.
7. The business-driven page comparison test device according to claim 5, characterized in that: The service interface determination module determines, based on the service data and the service mapping relationship, the interfaces corresponding to the changed services in the new and old versions of the target application program. Specifically, the interface determination module determines, based on the service data and the service mapping relationship, the interfaces corresponding to the changed services in the new and old versions of the target application program. The business interface determination module determines the pages corresponding to the changed business in the new and old versions of the target application according to the business embedding data, and determines the interface corresponding to the page according to the page embedding data and the business mapping relationship.
8. The business-driven page comparison test device according to claim 5, characterized in that: The service interface determination module is further configured to: Determine whether there are different versions of interface services for the business based on the business code.
Citation Information
Patent Citations
Interface document, test and simulation generation method and device, and computer storage medium
CN113778883A
System and method for comparative test on difference between new and old versions of program
JP2013105358A