Search

CN-114328246-B - Method, device, equipment and storage medium for determining software testing range

CN114328246BCN 114328246 BCN114328246 BCN 114328246BCN-114328246-B

Abstract

The disclosure provides a method, a device, equipment and a storage medium for determining a software testing range, relates to the technical field of computers, and particularly relates to the technical field of computer software. The method comprises the steps of obtaining an updating component in software to be tested, obtaining an associated component influenced by the updating component based on a prestored component association relation, and finally obtaining a page to be tested based on the updating component, the associated component and a prestored minimum page set covering all component combinations. By applying the embodiment of the disclosure, based on the component association relationship, other components influenced by the updated component can be obtained, instead of considering the updated component alone, so that the estimated influence surface of the updated component is more perfect, and meanwhile, the minimum page set covering all component combinations covers all pages because the page to be tested is obtained from the minimum page set covering all component combinations, so that the integrity of the software test coverage is further improved.

Inventors

  • WANG YANAN
  • Han Zhaoguang

Assignees

  • 北京百度网讯科技有限公司

Dates

Publication Date
20260505
Application Date
20211230

Claims (15)

  1. 1. A method for determining a software testing range, comprising: acquiring an updating component updated in software to be tested; determining an association component associated with the updated component based on a pre-stored component association relationship in the software to be tested; Determining a page to be tested of the software to be tested based on the updating component, the association component and a pre-stored minimum page set covering all component combinations in the software to be tested; The assembly is formed by all assemblies covered by the same page of the software to be tested, and the minimum page set covering all assembly assemblies is obtained in advance by adopting the following steps: acquiring a corresponding relation between a page and a component in software to be tested; Based on the corresponding relation between the pages and the components, taking the page covering the most components as a candidate page; Repeating the step of taking the page which covers the most components as a candidate page based on the corresponding relation between the page and the components aiming at the pages except the candidate page until each candidate page covers all the component combination relations; And storing all the obtained candidate pages as a minimum page set covering all the component combinations.
  2. 2. The method of claim 1, wherein the step of obtaining the correspondence between the pages and the components in the software under test comprises: Acquiring a code to be tested of the software to be tested; babel analysis is carried out on the code to be tested, and an abstract syntax tree corresponding to the code to be tested is obtained; and performing Babel traversal and analysis on the abstract syntax tree, acquiring the corresponding relation between the page and the component in the code to be tested, and storing the corresponding relation.
  3. 3. The method according to claim 2, wherein the component association relationship is obtained in advance by: analyzing the abstract syntax tree corresponding to the code to be tested, obtaining the association relation of each ONEUI component in the software to be tested, storing, and/or, For each WIDGETID component, acquiring the dependency relationship between the component and other components set when the component is generated; And acquiring and storing the association relation of each component in the software to be tested based on the dependency relation of each component and other components.
  4. 4. The method of claim 1, wherein the step of obtaining the correspondence between the pages and the components in the software under test comprises: And acquiring the corresponding relation between the prestored page and the component from the service system database.
  5. 5. The method of claim 1, wherein the step of determining the page to be tested of the software to be tested based on the updated component, the associated component, and a pre-stored minimum set of pages covering all component combinations in the software to be tested comprises: And matching the component combination contained in each page in the minimum page set covering all the component combinations with the updating component and the association component to obtain a page to be tested.
  6. 6. The method of claim 1, further comprising: and generating an influence surface evaluation report of the updating component in the software to be tested based on the page to be tested, wherein the evaluation report comprises the updating component information, the association component information and the page to be tested.
  7. 7. A device for determining a software testing range, comprising: The updating component acquisition module is used for acquiring an updating component updated in the software to be tested; The association component acquisition module is used for determining an association component associated with the updating component based on a pre-stored association relation of components in the software to be tested; The page to be tested determining module is used for determining a page to be tested of the software to be tested based on the updating component, the association component and a pre-stored minimum page set covering all component combinations in the software to be tested; The assembly is formed by the assemblies covered by the same page of the software to be tested, and the device further comprises a construction module which is used for: acquiring a corresponding relation between a page and a component in software to be tested; Based on the corresponding relation between the pages and the components, taking the page covering the most components as a candidate page; Repeating the step of taking the page which covers the most components as a candidate page based on the corresponding relation between the page and the components aiming at the pages except the candidate page until each candidate page covers all the component combination relations; And storing all the obtained candidate pages as a minimum page set covering all the component combinations.
  8. 8. The apparatus of claim 7, wherein the obtaining the correspondence between the page and the component in the software under test comprises: Acquiring a code to be tested of the software to be tested; babel analysis is carried out on the code to be tested, and an abstract syntax tree corresponding to the code to be tested is obtained; and performing Babel traversal and analysis on the abstract syntax tree, acquiring the corresponding relation between the page and the component in the code to be tested, and storing the corresponding relation.
  9. 9. The apparatus of claim 8, wherein the component association relationship is obtained in advance by: analyzing the abstract syntax tree corresponding to the code to be tested, obtaining the association relation of each ONEUI component in the software to be tested, storing, and/or, For each WIDGETID component, acquiring the dependency relationship between the component and other components set when the component is generated; And acquiring and storing the association relation of each component in the software to be tested based on the dependency relation of each component and other components.
  10. 10. The apparatus of claim 7, wherein the obtaining the correspondence between the page and the component in the software under test comprises: And acquiring the corresponding relation between the prestored page and the component from the service system database.
  11. 11. The apparatus of claim 7, wherein the to-be-tested page determining module is configured to match a combination of components included in each page in the minimum page set covering all combinations of components with the update component and the association component to obtain a to-be-tested page.
  12. 12. The apparatus of claim 7, further comprising: the evaluation report generation module is used for generating an influence surface evaluation report of the updating component in the software to be tested based on the page to be tested, wherein the evaluation report comprises the updating component information, the association component information and the page information to be tested.
  13. 13. An electronic device, comprising: at least one processor, and A memory communicatively coupled to the at least one processor, wherein, The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.
  14. 14. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-6.
  15. 15. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any of claims 1-6.

Description

Method, device, equipment and storage medium for determining software testing range Technical Field The present disclosure relates to the field of computer technology, and in particular, to the field of computer software technology. Background Typically, after a software development or update is completed, the software needs to be tested to determine whether the software can operate properly. Before the software test is performed, the range of the software test is usually required to be determined. Disclosure of Invention The present disclosure provides a method, apparatus, device and storage medium for determining a software testing scope for improving the integrity of the testing scope. According to an aspect of the present disclosure, there is provided a method for determining a software testing range, including: acquiring an updating component updated in software to be tested; determining an association component associated with the updated component based on a pre-stored component association relationship in the software to be tested; And determining a page to be tested of the software to be tested based on the updating component, the association component and a pre-stored minimum page set covering all component combinations in the software to be tested. According to another aspect of the present disclosure, there is provided a determining apparatus of a software testing range, including: The updating component acquisition module is used for acquiring an updating component updated in the software to be tested; The association component acquisition module is used for determining an association component associated with the updating component based on a pre-stored association relation of components in the software to be tested; And the page to be tested determining module is used for determining a page to be tested of the software to be tested based on the updating component, the association component and a pre-stored minimum page set covering all component combinations in the software to be tested. According to another aspect of the present disclosure, there is provided an electronic device including: at least one processor, and A memory communicatively coupled to the at least one processor, wherein, The memory stores instructions executable by the at least one processor to enable the at least one processor to perform any one of the software testing scope determination methods described above. According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the method of determining the software test range described in any one of the above. According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements a method of determining a software testing scope as described in any of the above. It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification. Drawings The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein: FIG. 1a is a schematic diagram of a first embodiment of a method of determining a software test scope provided in accordance with the present disclosure; FIG. 1b is a schematic illustration of the relationship of pages to components in the present disclosure; FIG. 2 is a schematic flow chart of obtaining page and component correspondence in the present disclosure; FIG. 3 is a schematic diagram of a process for obtaining page and component correspondence in the present disclosure; FIG. 4 is a schematic diagram of a process for obtaining component associations based on component dependencies in the present disclosure; FIG. 5 is a flow diagram of the present disclosure for obtaining a minimum set of pages covering all component combinations; FIG. 6 is a schematic diagram of one embodiment of the present disclosure for obtaining a minimum set of pages covering all component combinations; FIG. 7 is a schematic diagram of a second embodiment of a method of determining a software test scope provided in accordance with the present disclosure; FIG. 8 is a schematic illustration of a component impact range assessment report generated in the present disclosure; FIG. 9 is a schematic diagram of a third embodiment of a method of determining a software test range provided in accordance with the present disclosure; FIG. 10 is a schematic diagram of a first embodiment of a determination device of software testing scope provided according to the present disclosure; FIG. 11 is a schematic diagram of a second embodiment of a determination device of so