Component testing method and apparatus, electronic device, and storage medium
Patent Information
- Application Number
- CN202310308227.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-27
- Publication Date
- 2026-08-28
- Estimated Expiration
- 2043-03-27
AI Technical Summary
但是这种基于git代码文件提交变化的方法,虽然可以反映代码的实际改动范围,但是反应不出在实际运行过程中组件代码的执行路径,不能保证组件在不同APP上集成时是否需要重复测试
[0020] The technical solution of this application embodiment, when the target component undergoes a version update, obtains the target test point set corresponding to the target component, integrates the target component into the first application of N applications, receives the point data reported by the first application, obtains the first point set corresponding to the target test point set in the first application based on the point data, compares the target test point set with the first point set, and outputs the point test status corresponding to the target test point set based on the comparison result. This can realize the testing of the version-updated target component based on the first application and output the test status. Based on the test status, it can determine whether the target component needs to be tested when integrated and released in other applications. This can avoid repeated testing of the target component or test the target component at a very low cost, thereby saving testing costs.
Smart Images

Figure CN116501611B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a component testing method, apparatus, electronic device, and storage medium. Background Technology
[0002] In a component-based multi-app development architecture (e.g., an app factory), the same component can be reused during development, which can greatly improve development efficiency. However, since there is no controllable method for component testing, repeated testing is required when a component is integrated into various apps.
[0003] See Figure 1 The diagram shown is a schematic of the component architecture under a component-based multi-App development architecture. Upper-layer business 1 belongs to the first app, and upper-layer business 2 belongs to the second app. Figure 1 For a component (such as component 2) that is jointly depended upon by upper-layer business 1 and upper-layer business 2, after component 2's functionality is upgraded and a new version is released, it is first integrated into the first app and then deployed online. During the process of component 2 being integrated and deployed online by the first app, the functionality of component 2 needs to be tested to ensure the quality of the released functionality. When component 2 is integrated and deployed by the second app, testers still need to test it again.
[0004] Existing technical solutions can automate regression testing based on changes made to Git code files, thereby improving testing efficiency. In component testing scenarios within a component-based multi-App development architecture, the testing scope of a component can also be determined based on changes made to Git code files. However, while this method based on Git code file changes reflects the actual scope of code modifications, it does not reflect the execution path of the component code during actual runtime, and cannot guarantee whether repeated testing is needed when the component is integrated into different apps. Summary of the Invention
[0005] In view of the above problems, embodiments of this application provide a component testing method, apparatus, electronic device, and storage medium that overcome or at least partially solve the above problems.
[0006] In a first aspect, embodiments of this application provide a component testing method, including:
[0007] After the target component is updated, obtain the target test point set corresponding to the target component. The target component is a shared component of N applications, where N is an integer greater than or equal to 2.
[0008] In the case where the target component is integrated into the first application of the N applications, the tracking data reported by the first application is received, and the tracking data is the response data of the tracking after the tester triggers the tracking.
[0009] Based on the embedded data, determine the first embedded data set corresponding to the first application, which includes the already measured embedded data set, of the target set of embedded data to be tested;
[0010] Based on the comparison results between the first set of event tracking points and the target set of event tracking points to be tested, the event tracking point test status corresponding to the target set of event tracking points to be tested is output so as to determine the event tracking points to be tested based on the event tracking point test status when the target component is integrated in the second application.
[0011] The second application is the application that is distinct from the first application among the N applications.
[0012] Secondly, embodiments of this application provide a component testing apparatus, including:
[0013] The acquisition module is used to acquire the target test point set corresponding to the target component after the target component is updated. The target component is a shared component of N applications, where N is an integer greater than or equal to 2.
[0014] The receiving module is used to receive the event tracking data reported by the first application when the target component is integrated into the first application of the N applications. The event tracking data is the response data of the event tracking after the tester triggers the event tracking.
[0015] The determination module is used to determine, based on the embedded data, the first embedded point set corresponding to the target set of embedded points to be tested in the first application, which includes the already tested embedded points;
[0016] The output module is used to output the test status of the target test set of the target test set based on the comparison result between the first set of test points and the target test set of test points, so as to determine the test points based on the test status when the target component is integrated in the second application.
[0017] The second application is the application that is distinct from the first application among the N applications.
[0018] Thirdly, embodiments of this application provide an electronic device, including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the component testing method as described in the first aspect above.
[0019] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the component testing method described in the first aspect above.
[0020] The technical solution of this application embodiment, when the target component undergoes a version update, obtains the target test point set corresponding to the target component, integrates the target component into the first application of N applications, receives the point data reported by the first application, obtains the first point set corresponding to the target test point set in the first application based on the point data, compares the target test point set with the first point set, and outputs the point test status corresponding to the target test point set based on the comparison result. This can realize the testing of the version-updated target component based on the first application and output the test status. Based on the test status, it can determine whether the target component needs to be tested when integrated and released in other applications. This can avoid repeated testing of the target component or test the target component at a very low cost, thereby saving testing costs. Attached Figure Description
[0021] Figure 1 This diagram illustrates a single-component architecture corresponding to the component-based multi-App development architecture provided in this application embodiment.
[0022] Figure 2 A schematic diagram illustrating the component testing method provided in an embodiment of this application;
[0023] Figure 3 This is a schematic diagram illustrating the display of a sharing pop-up window provided in an embodiment of this application;
[0024] Figure 4 This illustration shows the relationship between the application and sharing component functions provided in the embodiments of this application. Figure 1 ;
[0025] Figure 5 This illustration shows the relationship between the application and sharing component functions provided in the embodiments of this application. Figure 2 ;
[0026] Figure 6 This is a schematic diagram of the component testing apparatus provided in an embodiment of this application;
[0027] Figure 7 This is a schematic diagram of the electronic device structure provided in the embodiments of this application. Detailed Implementation
[0028] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0029] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Multiple embodiments in this application may include two or more.
[0030] In the various embodiments of this application, it should be understood that the sequence number of each process described below does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0031] This application pre-embeds observation points in the component under test. After the component under test is first released online, the triggering status of the observation points is obtained. Based on the triggering status of the observation points, it is determined whether the component under test needs to be tested when it is integrated and released in other applications, so as to avoid repeated testing or test at a very low cost, thereby saving testing costs.
[0032] The component testing method provided in the embodiments of this application is described below. See also... Figure 2 As shown, the method includes the following steps:
[0033] Step 201: After the target component is updated, obtain the target test point set corresponding to the target component. The target component is a shared component of N applications, where N is an integer greater than or equal to 2.
[0034] In this embodiment of the application, the target component is a shared component of N applications, where N is an integer greater than or equal to 2. That is, at least two applications share the target component. The N applications can be different applications under the same App factory. For example, application 1, application 2 and application 3 are three different applications under the same APP development architecture, and all three applications depend on the target component. In this case, the target component is a shared component of the three applications.
[0035] For components, a component releases its first version, and subsequent versions are continuously released as features and requirements iterate. Component version updates are essentially updates to the component's code. After a target component undergoes a version update, it needs to be tested. Before testing, the server obtains the target component's set of event tracking points to be tested. This set includes the event tracking points that need to be tested due to the version update.
[0036] Step 202: When the target component is integrated into the first application of the N applications, receive the event tracking data reported by the first application. The event tracking data is the response data of the event tracking after the tester triggers the event tracking.
[0037] For target components that have undergone version updates, during testing, the target component can be integrated into the first application. The first application is the first selected application among N applications to test the target component. When the target component is integrated into the first application, it will trigger the pre-embedded observation points of the target component when the new version of the first application is released. The first application will then report the observation point data through the application's event tracking function.
[0038] The event tracking data reported by the first application can include event tracking data corresponding to all event tracking points triggered by the target component, or event tracking data corresponding to event tracking points to be tested (event tracking points that need to be retested based on version updates of the target component) among all event tracking points triggered by the target component.
[0039] Step 203: Based on the embedded data, determine the first embedded point set corresponding to the target set of embedded points in the first application, which includes the already measured embedded points.
[0040] After receiving the event tracking data reported by the client (first application), the server can filter out the event tracking data that has been tested by the first application from the target event tracking set to be tested. That is, it obtains the tested event tracking data corresponding to the target event tracking set in the first application, and determines the first event tracking set based on the obtained tested event tracking data. The first event tracking set may include at least some of the event tracking data in the target event tracking set to be tested. It should be noted that, in special cases, the first event tracking set may not include any event tracking data; in this case, the event tracking data triggered by the first application will not include the event tracking data in the target event tracking set to be tested.
[0041] Step 204: Based on the comparison result between the first set of event tracking points and the target set of event tracking points to be tested, output the event tracking point test status corresponding to the target set of event tracking points to be tested, so as to determine the event tracking points to be tested based on the event tracking point test status when the target component is integrated in the second application; wherein, the second application is the application that is different from the first application among the N applications.
[0042] After determining the first set of event tracking points, the server compares the event tracking points in the first set with those in the target set of event tracking points to be tested, obtains the comparison results, and outputs the test status of the event tracking points in the target set based on the comparison results. By outputting the test status of the event tracking points corresponding to the target set of event tracking points to be tested, the server can identify untested event tracking points in the target set of event tracking points to be tested when integrating the target component into the second application. This allows the server to then test the untested event tracking points based on the second application.
[0043] The second application is an application that is different from the first application among N applications. If the testing of the target component is not completed after testing the target component through the first application, the second application, which shares the target component with the first application, can be used to test the target component to continue testing the target component.
[0044] The comparison results between the first set of event tracking points and the target set of event tracking points to be tested can be: the first set of event tracking points includes all event tracking points in the target set of event tracking points to be tested; the first set of event tracking points includes some event tracking points in the target set of event tracking points to be tested; or the first set of event tracking points does not include event tracking points in the target set of event tracking points to be tested. When outputting event tracking test results based on the comparison results, the matching event tracking test results are output based on the detailed information of the comparison results.
[0045] In the above-described implementation scheme of this application, when the target component undergoes a version update, the target test point set corresponding to the target component is obtained. After integrating the target component into the first application of N applications, the instrumentation data reported by the first application is received. Based on the instrumentation data, the first instrumentation set corresponding to the target test point set in the first application is obtained. The target test point set and the first instrumentation set are compared. Based on the comparison result, the instrumentation test status corresponding to the target test point set is output. This can realize the testing of the version-updated target component based on the first application and output the test status. Based on the test status, it can determine whether the target component needs to be tested when integrated and released in other applications. This can avoid the repeated testing of the target component or test the target component at a very low cost, thereby saving testing costs.
[0046] The following describes the process of obtaining the corresponding set of target test points after a version update of the target component. Obtaining the set of target test points corresponding to the target component after a version update includes one of the following methods:
[0047] In the second set of event tracking points corresponding to the target component, determine the first event tracking point involved in the version update of the target component, and obtain the target event tracking point set based on the first event tracking point;
[0048] Determine the second tracking point added due to the version update of the target component, and obtain the target set of tracking points to be tested based on the second tracking point;
[0049] After the target component undergoes a version update, the newly added second tracking point and the first tracking point involved in the second tracking point set corresponding to the target component are determined, and the target tracking point set to be tested is obtained based on the first tracking point and the second tracking point.
[0050] The second set of tracking points is the set of tracking points corresponding to the target component before the version update.
[0051] In this embodiment, observation points need to be pre-embedded for the target component. From a testing perspective, component testing requires several test cases, which simulate normal user operations and trigger the functions included in the component. Figure 3 Taking the sharing component shown as an example, a test case could be: clicking the share button to bring up a share pop-up window, clicking the friend button of social application 1 in the pop-up window, and jumping to social application 1 to share the content with a friend.
[0052] In this embodiment, the pre-embedded observation points are actually pre-embedded observation points at key nodes. The key nodes correspond to the nodes in the test cases. For example, the appearance of the share pop-up is a node, clicking "Friend 1 of Social Applications" on the pop-up is a node, and returning after successful sharing is a node. Correspondingly, the action of clicking the "Friend 1 of Social Applications" button corresponds to a tracking point. The timing of this tracking point is when the "Friend 1 of Social Applications" button is clicked. After clicking, log data is generated and uploaded to the server through the client tracking point function.
[0053] Embedding observation points in components can reflect the state of component functionality during application testing. For example, clicking the "Share to a friend in Social App 1" button in the sharing component indicates that the function of sharing to a friend in Social App 1 has been triggered; a successful sharing event trigger indicates that the user has successfully returned to the current application after sharing to Social App 1. By embedding observation points in components, the triggering status of these points can be obtained in the application testing environment. If these points are triggered in the application testing environment, it can be assumed that the corresponding functionality is running stably in the application testing environment.
[0054] When pre-embed observation points for a target component, the original set of observation points corresponding to the target component includes the pre-embedded observation points. As the version of the target component is updated, the original set of observation points can be updated, and the observation points can also be updated. When obtaining the target test point set corresponding to the target component after a version update, one of the following three schemes can be included.
[0055] Option 1
[0056] If a version update of a target component affects existing event tracking points, you can first obtain the second event tracking point set corresponding to the target component before the version update, determine the first event tracking point involved in the version update of the target component from the second event tracking point set, and obtain the target event tracking point set to be tested based on the determined first event tracking point.
[0057] In this case, the target set of event tracking points to be tested can be regarded as a subset of the second set of event tracking points. For example, the sharing component has pre-embedded event tracking points related to sharing to "Friends of Social Application 1", "Dynamic Circle of Social Application 1", and "Friends of Social Application 2", but the change (version update) of the sharing component only involves event tracking points related to "Friends of Social Application 1", so the target set of event tracking points to be tested only includes event tracking points related to "Friends of Social Application 1".
[0058] Option 2
[0059] For cases where a version update of the target component results in the addition of new event points, a second event point can be determined based on the second event point set, and then the target event point set to be tested can be obtained based on the determined second event point.
[0060] Option 3
[0061] In cases where a version update of a target component results in the addition of new tracking points and affects existing tracking points, a second set of tracking points corresponding to the target component before the version update can be obtained. The first tracking points involved in the version update of the target component can be determined from the second set of tracking points. Based on the second set of tracking points, the second tracking points added by the version update of the target component can be determined. The first and second tracking points are aggregated to determine the target set of tracking points to be tested.
[0062] In the three implementation schemes described above, the target set of monitoring points can be determined in a corresponding manner based on the specific changes caused by version updates of the target component.
[0063] It's important to note that version updates of the target component may also lead to a reduction in event tracking points. Since the target set of event tracking points to be tested includes the affected points, in this case, the affected point will not be included in the target set. The server can also directly receive the target set of event tracking points to be tested reported by the component developer. That is, the component developer determines the target set of event tracking points to be tested when the target component is released, reports it to the server, and stores it on the server for use in subsequent processes. When storing data on the server, a Map data structure can be used, where the key is the component name + component version, and the value is the target set of event tracking points to be tested.
[0064] The above implementation scheme determines the event tracking points affected by the version update when the target component is updated (including existing event tracking points and / or newly added event tracking points), and obtains the target event tracking point set based on the determined event tracking points, thereby determining the target event tracking point set based on the specific changes caused by the version update of the target component.
[0065] As an optional embodiment, the method further includes:
[0066] Among the N applications, the first application that can cover the most embedding points in the target set of embedding points is selected.
[0067] When obtaining the target test point set corresponding to the target component based on the version update of the target component, the first application can be selected from N applications that share the target component, and the first application will integrate the target component and test the target component first.
[0068] In the process of selecting the first application from N applications, the number of event points included in the target set of event points to be tested can be determined. For each application, the corresponding event points are determined based on the functions required by the application. The application with the most event points in the target set of event points to be tested is selected from the N applications and then selected as the first application.
[0069] By selecting the first application and integrating the target component into it, priority is given to integrating the target component into the application that can cover the most tracking points in the target test set for online verification. When integrating the target component into other applications, no testing is required or only untested functions are tested, thus minimizing testing costs.
[0070] It should be noted that if there are multiple applications that can cover the maximum number of event points in the target event point set, one of the multiple applications can be randomly selected as the first application. For example, if application 1, application 2 and application 3 share the target component, and application 1 and application 2 can cover 3 event points in the target event point set, and application 3 can cover 1 event point in the target event point set, then application 1 or application 2 can be used as the first application.
[0071] The above implementation scheme, by selecting the first application from among N applications sharing the target component, can prioritize the application with the most tracking points in the target test point set to integrate the target component for online verification, avoiding duplicate testing of other applications or testing at a very low cost, thereby minimizing testing costs to the greatest extent.
[0072] The process of receiving event tracking data reported by the client is described below. When the target component is integrated into the first application of the N applications, receiving the event tracking data reported by the first application includes one of the following methods:
[0073] After the target component is integrated into the first application, the first application receives the tracking data corresponding to the target tracking data set to be tested sent by the first application. The first application obtains the target tracking data set to be tested based on the request information sent to the server, and filters out the tracking data corresponding to the target tracking data set to be tested from the triggered tracking data based on the target tracking data set to be tested.
[0074] After the target component is integrated into the first application, it receives the full set of event tracking data triggered by the first application.
[0075] When the server receives event tracking data reported by the client, it can also receive event tracking data corresponding to the target event tracking set sent by the first application. In this case, based on the principle of saving resources, the client queries the server for the target event tracking set. That is, the server receives the request information sent by the client (first application) to obtain the target event tracking set. The request information received by the server can carry the client identifier, the identifier of the target component, and the version of the target component. The server returns the target event tracking set to the client based on the received request information. The client filters the event tracking data corresponding to the target event tracking set from the triggered event tracking data based on the target event tracking set, and then sends the filtered event tracking data to the server, realizing the upload of only the data related to the target event tracking set. The server stores the event tracking data and determines the event tracking data of the target component based on the target event tracking set tested by the first application based on the received event tracking data.
[0076] When the server receives the event tracking data reported by the client, it can also receive the full event tracking data triggered by the first application. The server can filter the received event tracking data according to the target event tracking set to obtain the data related to the target event tracking set, so as to determine the event tracking of the target component based on the target event tracking set tested by the first application. In this solution, the client needs to upload the full event tracking data, which will cause a waste of resources compared to the solution where the client only uploads the data related to the target event tracking set.
[0077] The above implementation scheme allows the client to request a target set of event tracking points to be tested, filter event tracking data associated with the target set of event tracking points from the triggered event tracking data, and report it to the server. This can achieve the goal of uploading only necessary event tracking data, saving upload resources. Alternatively, the client can upload all event tracking data, and the server can filter the data in the received event tracking data to determine the tested event tracking points in the target set of event tracking points based on the filtered data. This achieves the goal of obtaining valid data and determining the tested event tracking points based on server-side filtering.
[0078] As an optional embodiment, since the server can receive the tracking data corresponding to the target tracking data set to be tested uploaded by the client or receive the full tracking data, when determining the target tracking data set to be tested within the first tracking data set corresponding to the first application, one of the following schemes is included:
[0079] Upon receiving the data corresponding to the target set of data points to be tested sent by the first application, the first set of data points to be tested in the first application is determined based on the data corresponding to the target set of data points to be tested.
[0080] Upon receiving the full set of event tracking data triggered by the first application, the event tracking data corresponding to the target event tracking set is filtered out from the received event tracking data based on the target event tracking set to be tested, and the first event tracking set corresponding to the target event tracking set in the first application is determined based on the filtered event tracking data.
[0081] When the server receives data from the first application corresponding to the target set of event tracking points, the server can directly determine the event tracking points tested by the first application on the target set of event tracking points based on the received event tracking data, and generate the first set of event tracking points based on the determined event tracking points. That is, the server directly determines the first set of event tracking points corresponding to the target set of event tracking points in the first application based on the received event tracking data.
[0082] In the case where the server receives the full set of event tracking data corresponding to the target component sent by the first application, the server can filter out the event tracking data corresponding to the target event tracking set from the received event tracking data based on the target event tracking set to be tested. Then, based on the filtered event tracking data, the server determines the event tracking data that the first application tests in the target event tracking set corresponding to the target component, and generates the first event tracking set based on the determined event tracking data.
[0083] In the above process, the server can determine the event points tested by the first application in the target event point set based on the received event point data, so as to obtain the first event point set, which is convenient for outputting the event point test status corresponding to the target event point set based on the first event point set.
[0084] The following describes the process of outputting the event tracking test results. When outputting the event tracking test results corresponding to the target event tracking set based on the comparison results between the first event tracking set and the target event tracking set to be tested, the process includes:
[0085] When the first set of embedded points covers all the embedded points in the target set of embedded points to be tested, output a prompt message indicating that all embedded points in the target set of embedded points to be tested have completed the test.
[0086] When the first set of embedded points covers some of the embedded points in the target set of embedded points to be tested, the coverage details of each embedded point in the target set of embedded points to be tested are output.
[0087] After determining the first set of tracking points, the first set of tracking points can be compared with the target set of tracking points to be tested. Since the first set of tracking points includes the tested tracking points corresponding to the target set of tracking points to be tested, by comparing the two and obtaining the comparison results, the coverage of the tracking points in the target set of tracking points by the first set of tracking points can be determined.
[0088] If the first set of event tracking points covers all event tracking points in the target set to be tested, a message can be output indicating that all event tracking points in the target set to be tested have been tested. Subsequent applications integrating the target component will not need to perform this testing. See [example documentation]. Figure 4 As shown, the version update of the sharing component affects the sharing functionality to friends in Social Application 1, the Moments section of Social Application 1, friends in Social Application 2, and Social Application 3. Therefore, the target set of event tracking points to be tested includes event tracking points associated with the sharing functionality to friends in Social Application 1, the sharing functionality to the Moments section of Social Application 1, the sharing functionality to friends in Social Application 2, and the sharing functionality to Social Application 3. The business logic of Application 1 and Application 2, which integrate the sharing component, will trigger the event tracking points in the target set of event tracking points to be tested. If all event tracking points in the target set of event tracking points are triggered when the sharing component is integrated into Application 1, then Application 2 does not need to perform further testing when integrating the sharing component. That is, if the event tracking points involved in the functional changes of the target component are verified in the application testing environment of one application, then they do not need to be verified repeatedly in other applications under the component-based multi-App development architecture.
[0089] If the first set of event tracking points covers only a portion of the event tracking points in the target set, the coverage details of each event tracking point in the target set can be output. This allows subsequent applications, when integrating target components, to test only the untested event tracking points based on the test results of each event tracking point in the target set, thereby reducing testing costs. See [link to relevant documentation]. Figure 5As shown, the version update of the sharing component affects the functionality of sharing to friends in Social Application 1, the Moments section of Social Application 1, friends in Social Application 2, and Social Application 3. Therefore, the target set of event tracking points to be tested can include event tracking points associated with the sharing functionality to friends in Social Application 1, the sharing functionality to the Moments section of Social Application 1, the sharing functionality to friends in Social Application 2, and the sharing functionality to Social Application 3. Based on business requirements, Application 1 does not need to integrate the sharing functionality to friends in Social Application 2, and Application 2 does not need to integrate the sharing functionality to friends in Social Application 1. Therefore, in Application 1's scenario, event tracking points related to sharing to friends in Social Application 2 will not be triggered, and in Application 2's scenario, event tracking points related to sharing to friends in Social Application 1 will not be triggered. In this case, if Application 1 integrates the sharing component first, only the event tracking points associated with the sharing functionality to friends in Social Application 1, the sharing functionality to the Moments section of Social Application 1, and the sharing functionality to Social Application 3 in the target set of event tracking points to be tested will be triggered; the event tracking points associated with the sharing functionality to friends in Social Application 2 will not be triggered. The server will eventually output the trigger status of each event point in the target set of event points to be tested, so that developers and testers can make a final decision on how to narrow the testing scope when integrating the sharing component into other applications. For example, when integrating the sharing component into application 2, only the sharing function to friends in social application 2 needs to be tested, which can save testing costs to a certain extent.
[0090] The above implementation scheme, based on the characteristics of application components, uses the testing status of the target test points in the application testing environment to determine whether the component needs to be tested when integrated into different applications. In the best case, it can save (m-1)*n man-days of testing cost (m represents the number of applications sharing a certain component in a multi-App development architecture based on the component, and n represents the test man-days for a certain upgrade of the component), and conduct component testing at low cost.
[0091] The above is the overall implementation process of the component testing method embodiment provided in this application. When the target component undergoes a version update, the target test point set corresponding to the target component is obtained. After the target component is integrated into the first application of N applications, the event point data reported by the first application is received. Based on the event point data, the first event point set corresponding to the target test point set in the first application is obtained. The target test point set and the first event point set are compared. Based on the comparison result, the event point test status corresponding to the target test point set is output. This can realize the testing of the version-updated target component based on the first application and output the test status. Based on the test status, it can be determined whether the target component needs to be tested when it is integrated and released in other applications. This can avoid repeated testing of the target component or test the target component at a very low cost, thereby saving testing costs.
[0092] Furthermore, when the target component undergoes a version update, the affected event tracking points (which may include existing event tracking points and / or newly added event tracking points) are determined. Based on the determined event tracking points, the target event tracking point set to be tested is obtained. This allows the target event tracking point set to be determined based on the specific changes caused by the version update of the target component. By selecting the first application from among N applications sharing the target component, the application that can cover the most event tracking points in the target event tracking point set can be prioritized to integrate the target component for online verification. This avoids duplicate testing of other applications or tests them at a very low cost, thereby minimizing testing costs to the greatest extent.
[0093] By having the client filter the event tracking data that is associated with the target set of event tracking points and report it to the server, only necessary event tracking data can be uploaded, saving upload resources. Alternatively, by having the client upload all event tracking data and the server filter the data received, the tested event tracking points in the target set of event tracking points can be determined based on the filtered data, thus enabling the server to filter and obtain valid data and determine the tested event tracking points.
[0094] By outputting the test results of the target set of test points, it is possible to determine whether a component needs to be tested when integrated into different applications, thus completing the testing of the target component at the lowest cost.
[0095] This application provides a component testing apparatus, see [link to relevant documentation]. Figure 6 As shown, it includes:
[0096] The acquisition module 601 is used to acquire the target test point set corresponding to the target component after the target component is updated. The target component is a shared component of N applications, where N is an integer greater than or equal to 2.
[0097] The receiving module 602 is used to receive the tracking data reported by the first application when the target component is integrated into the first application of the N applications. The tracking data is the response data of the tracking after the tester triggers the tracking.
[0098] The determining module 603 is used to determine, based on the embedded data, the first embedded point set corresponding to the target set of embedded points to be tested in the first application, which includes the already tested embedded points;
[0099] The output module 604 is used to output the tracking point test status corresponding to the target tracking point set according to the comparison result between the first tracking point set and the target tracking point set to be tested, so as to determine the tracking point to be tested based on the tracking point test status when the target component is integrated in the second application.
[0100] The second application is the application that is distinct from the first application among the N applications.
[0101] Optionally, the acquisition module includes one of the following sub-modules:
[0102] The first acquisition submodule is used to determine the first tracking point involved in the version update of the target component in the second tracking point set corresponding to the target component, and to acquire the target tracking point set to be tested based on the first tracking point;
[0103] The second acquisition submodule is used to determine the second tracking point added when the target component is updated, and to acquire the target tracking point set based on the second tracking point.
[0104] The third acquisition submodule is used to determine the added second tracking point and the first tracking point involved in the second tracking point set corresponding to the target component after the target component is updated, and to acquire the target tracking point set based on the first tracking point and the second tracking point.
[0105] The second set of tracking points is the set of tracking points corresponding to the target component before the version update.
[0106] Optionally, the device further includes:
[0107] The filtering module is used to filter out the first application from the N applications that can cover the most embedding points in the target set of embedding points to be tested.
[0108] Optionally, the receiving module includes one of the following sub-modules:
[0109] The first receiving submodule is used to receive the tracking data corresponding to the target tracking data set to be tested sent by the first application after the target component is integrated into the first application. The first application obtains the target tracking data set to be tested based on the request information sent to the server, and filters out the tracking data corresponding to the target tracking data set to be tested from the triggered tracking data based on the target tracking data set to be tested.
[0110] The second receiving submodule is used to receive the triggered full-scale data points sent by the first application after the target component is integrated into the first application.
[0111] Optionally, the determining module includes:
[0112] The first processing submodule is used to determine, based on the tracking data corresponding to the target tracking data set sent by the first application, the first tracking data set corresponding to the target tracking data set.
[0113] The second processing submodule is used to, upon receiving the triggered full set of event tracking data sent by the first application, filter out the event tracking data corresponding to the target event tracking set from the received event tracking data, and determine the first event tracking set corresponding to the target event tracking set in the first application based on the filtered event tracking data.
[0114] Optionally, the output module includes:
[0115] The first output submodule is used to output a prompt message indicating that all the embeddings in the target set of embeddings have been tested when the first set of embeddings covers all the embeddings in the target set of embeddings to be tested.
[0116] The second output submodule is used to output the coverage details of each embedding point in the target set of embedding points when the first set of embedding points covers some of the embedding points in the target set of embedding points to be tested.
[0117] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0118] This application also provides an electronic device, including: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the various processes of the above-described component testing method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0119] For example, Figure 7 A schematic diagram of the physical structure of an electronic device is shown. (For example...) Figure 7As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730, and a communication bus 740, wherein the processor 710, the communication interface 720, and the memory 730 communicate with each other through the communication bus 740. The processor 710 can call logical instructions in the memory 730. The processor 710 is used to perform the following steps: after the target component undergoes a version update, obtain the target test point set corresponding to the target component, where the target component is a shared component of N applications, and N is an integer greater than or equal to 2; when the target component is integrated into the first application of the N applications, receive the point data reported by the first application, where the point data is the response data of the point data triggered by the tester; based on the point data, determine the first point set of the target test point set in the first application, which includes the tested point data; based on the comparison result between the first point set and the target test point set, output the point test status corresponding to the target test point set, so as to determine the test points based on the point test status when the target component is integrated into the second application; wherein, the second application is an application that is different from the first application among the N applications. The processor 710 can also execute other schemes in the embodiments of this application, which will not be further described here.
[0120] Furthermore, the logical instructions in the aforementioned memory 730 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion 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 to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.
[0121] This application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described component testing method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here. The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0122] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0123] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0124] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
[0125] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0126] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0127] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0128] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0129] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0130] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion 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 to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0131] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A component testing method, characterized in that, include: After the target component is updated, obtain the target test point set corresponding to the target component. The target component is a shared component of N applications, where N is an integer greater than or equal to 2. In the case where the target component is integrated into the first application of the N applications, the tracking data reported by the first application is received, and the tracking data is the response data of the tracking after the tester triggers the tracking. Based on the embedded data, determine the first embedded data set corresponding to the first application, which includes the already measured embedded data set, of the target set of embedded data to be tested; Based on the comparison results between the first set of event tracking points and the target set of event tracking points to be tested, the event tracking point test status corresponding to the target set of event tracking points to be tested is output so as to determine the event tracking points to be tested based on the event tracking point test status when the target component is integrated in the second application. The second application is the application that is distinct from the first application among the N applications.
2. The method according to claim 1, characterized in that, The step of obtaining the target test point set corresponding to the target component after the target component undergoes a version update includes one of the following methods: In the second set of event tracking points corresponding to the target component, determine the first event tracking point involved in the version update of the target component, and obtain the target event tracking point set based on the first event tracking point; Determine the second tracking point added due to the version update of the target component, and obtain the target set of tracking points to be tested based on the second tracking point; After the target component undergoes a version update, the newly added second tracking point and the first tracking point involved in the second tracking point set corresponding to the target component are determined, and the target tracking point set to be tested is obtained based on the first tracking point and the second tracking point. The second set of tracking points is the set of tracking points corresponding to the target component before the version update.
3. The method according to claim 1, characterized in that, The method further includes: Among the N applications, the first application that can cover the most embedding points in the target set of embedding points is selected.
4. The method according to claim 1, characterized in that, When the target component is integrated into the first application of the N applications, receiving the event tracking data reported by the first application includes one of the following schemes: After the target component is integrated into the first application, the first application receives the tracking data corresponding to the target tracking data set to be tested sent by the first application. The first application obtains the target tracking data set to be tested based on the request information sent to the server, and filters out the tracking data corresponding to the target tracking data set to be tested from the triggered tracking data based on the target tracking data set to be tested. After the target component is integrated into the first application, it receives the full set of event tracking data triggered by the first application.
5. The method according to claim 4, characterized in that, The step of determining, based on the embedded data, the first set of embedded points corresponding to the target set of embedded points to be tested in the first application, including the first set of embedded points already tested, includes: Upon receiving the data corresponding to the target set of data points to be tested sent by the first application, the first set of data points to be tested in the first application is determined based on the data corresponding to the target set of data points to be tested. Upon receiving the full set of event tracking data triggered by the first application, the event tracking data corresponding to the target event tracking set is filtered out from the received event tracking data based on the target event tracking set to be tested, and the first event tracking set corresponding to the target event tracking set in the first application is determined based on the filtered event tracking data.
6. The method according to claim 1, characterized in that, The step of outputting the tracking point test status corresponding to the target tracking point set based on the comparison result between the first tracking point set and the target tracking point set includes: When the first set of embedded points covers all the embedded points in the target set of embedded points to be tested, output a prompt message indicating that all embedded points in the target set of embedded points to be tested have completed the test. When the first set of embedded points covers some of the embedded points in the target set of embedded points to be tested, the coverage details of each embedded point in the target set of embedded points to be tested are output.
7. A component testing apparatus, characterized in that, include: The acquisition module is used to acquire the target test point set corresponding to the target component after the target component is updated. The target component is a shared component of N applications, where N is an integer greater than or equal to 2. The receiving module is used to receive the event tracking data reported by the first application when the target component is integrated into the first application of the N applications. The event tracking data is the response data of the event tracking after the tester triggers the event tracking. The determination module is used to determine, based on the embedded data, the first embedded point set corresponding to the target set of embedded points to be tested in the first application, which includes the already tested embedded points; The output module is used to output the test status of the target test set of the target test set based on the comparison result between the first set of test points and the target test set of test points, so as to determine the test points based on the test status when the target component is integrated in the second application. The second application is the application that is distinct from the first application among the N applications.
8. The apparatus according to claim 7, characterized in that, The acquisition module includes one of the following sub-modules: The first acquisition submodule is used to determine the first tracking point involved in the version update of the target component in the second tracking point set corresponding to the target component, and to acquire the target tracking point set to be tested based on the first tracking point; The second acquisition submodule is used to determine the second tracking point added when the target component is updated, and to acquire the target tracking point set based on the second tracking point. The third acquisition submodule is used to determine the added second tracking point and the first tracking point involved in the second tracking point set corresponding to the target component after the target component is updated, and to acquire the target tracking point set based on the first tracking point and the second tracking point. The second set of tracking points is the set of tracking points corresponding to the target component before the version update.
9. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the component testing method as described in any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the steps of the component testing method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Common component test method, apparatus, computer apparatus, and storage medium
CN109408372A
Burial point reporting method and device, terminal and storage medium
CN114816949A