Operating system testing method and device, electronic equipment and storage medium

By obtaining the test information of the operating system, determining the structural level and extracting the target atomic test cases, the problem of low test efficiency of the operating system is solved, and the rapid generation of test cases is achieved and the test accuracy is improved.

CN118939522APending Publication Date: 2024-11-12BEIJING CO WHEELS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310525904.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-11
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

Operating system testing is low, and existing methods require repeated coding of test cases, resulting in inefficiency.

Method used

By obtaining the test information of the operating system to be tested, multiple structural levels are determined, target atomic test cases at the lowest structural level are extracted, and target test cases are generated by combining them to avoid repeated encoding.

Benefits of technology

Improves the efficiency of operating system testing, reduces test errors caused by encoding errors, and realizes the ability to quickly generate target test cases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939522A_ABST
    Figure CN118939522A_ABST
Patent Text Reader

Abstract

The invention provides an operating system testing method and device, electronic equipment and a storage medium, and relates to the technical field of tests.The method comprises the steps that testing information of a to-be-tested operating system is obtained; determining a plurality of structure hierarchies corresponding to the test information in the to-be-tested operating system; extracting a target atomic test case corresponding to the lowest structure level in the plurality of structure levels; combining the target atomic test cases to obtain a target test case corresponding to the to-be-tested operating system; and testing the to-be-tested operating system by adopting the target test case to obtain a test result of the to-be-tested operating system. According to the invention, the test efficiency of the operating system can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of testing technology, and in particular to an operating system testing method, device, electronic device and storage medium. Background Art

[0002] The operating system is the first layer of software based on computer hardware and is the bridge between hardware and other software. The operating system controls the operation of other programs, manages system resources, and provides the most basic computing functions, such as managing and configuring memory, determining the priority of system resource supply and demand, etc. It also provides some basic service programs, such as file systems, device drivers, user interfaces, and system service programs. The operating system is so important that testing the operating system is particularly important.

[0003] Currently, most operating system tests are performed by encoding test cases individually and debugging them through a multi-processor virtual platform (QuickEMUlator, QEMU). In this way, the coding operation of the test cases needs to be repeated, resulting in low operating system testing efficiency. Summary of the invention

[0004] In view of this, the present application provides an operating system testing method, device, electronic device and storage medium, the main purpose of which is to solve the technical problem of low testing efficiency during current operating system testing.

[0005] According to a first aspect of the present application, there is provided an operating system testing method, comprising:

[0006] Obtain test information of the operating system to be tested;

[0007] Determining a plurality of structural levels corresponding to the test information in the operating system to be tested;

[0008] Extracting target atomic test cases corresponding to the lowest structural level among the multiple structural levels;

[0009] Combining the target atomic test cases to obtain a target test case corresponding to the operating system to be tested;

[0010] The target test case is used to test the operating system to be tested, and a test result of the operating system to be tested is obtained.

[0011] According to a second aspect of the present application, there is provided an operating system testing device, comprising:

[0012] An acquisition module, used to acquire test information of the operating system to be tested;

[0013] A determination module, configured to determine a plurality of structural levels corresponding to the test information in the operating system to be tested;

[0014] An extraction module, used for extracting target atomic test cases corresponding to the lowest structural level among the multiple structural levels;

[0015] A combination module, used for combining the target atomic test cases to obtain target test cases corresponding to the operating system to be tested;

[0016] The testing module is used to test the operating system to be tested using the target test case to obtain a test result of the operating system to be tested.

[0017] According to the third aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method of the aforementioned first aspect.

[0018] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the method of the aforementioned first aspect.

[0019] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, which implements the method of the aforementioned first aspect when executed by a processor.

[0020] The operating system testing method, device, electronic device and storage medium provided by the present disclosure can determine multiple structural levels related to the test in the operating system to be tested according to the test information after obtaining the test information of the operating system to be tested, and then directly reuse and extract the target atomic test cases corresponding to the lowest structural level among the multiple structural levels, and obtain the target test cases corresponding to the operating system to be tested by combining the target atomic test cases; finally, the target test cases are used to test the operating system to be tested to obtain the test results of the operating system to be tested. The technical solution in the present disclosure does not need to repeatedly write code when generating the target test cases corresponding to the operating system to be tested, and can directly filter the target atomic test cases corresponding to the lowest structural level among the multiple structural levels corresponding to the test information. Finally, the target test cases corresponding to the operating system to be tested can be quickly generated by combining the target atomic test cases, thereby improving the testing efficiency of the operating system.

[0021] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The drawings herein are incorporated into and constitute a part of the specification, showing embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. It should be understood that the drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure. Among them:

[0023] Figure 1 A flowchart of an operating system testing method provided by an embodiment of the present disclosure;

[0024] Figure 2 A flowchart of an operating system testing method provided by another embodiment of the present disclosure;

[0025] Figure 3 A schematic diagram of the structure of an operating system testing device provided by an embodiment of the present disclosure;

[0026] Figure 4 A schematic diagram of the structure of an operating system testing device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0027] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0028] The following describes the operating system testing method, device, electronic device, and storage medium according to the embodiments of the present disclosure with reference to the accompanying drawings.

[0029] In order to solve the above technical problems, the present disclosure provides an operating system testing method, device, electronic device and storage medium. Figure 1 As shown, an embodiment of the present disclosure provides an operating system testing method, including:

[0030] Step 101: Obtain test information of the operating system to be tested.

[0031] Among them, the operating system to be tested is any operating system that needs to execute corresponding system tests. System tests may include security tests, stability tests, functional tests, etc., which are not specifically limited here; test information is information that can reflect test requirements. Test information may include objects to be tested (such as interfaces, modules, processes, functions, etc.), test service types, structural hierarchy information involved in the test, and test input information, etc. The structural hierarchy information is used to characterize multiple structural hierarchies of the test execution process. The test input information may be test execution parameters, port information characterizing specific test ports, etc., which are not specifically limited here.

[0032] Step 102: Determine multiple structural levels corresponding to the test information in the operating system to be tested.

[0033] In a specific application scenario, each operating system has a corresponding system hierarchical structure. For the disclosed embodiment, after obtaining the test information of the operating system to be tested, multiple structural hierarchies involved in the test can be extracted from the system hierarchical structure corresponding to the operating system to be tested based on the test information. There is a superior-subordinate relationship between the multiple structural hierarchies, that is, there is a hierarchical order. Among them, the multiple hierarchical structures may include at least four hierarchies, and the four hierarchies are divided according to the basic system hierarchical structure of the operating system. The four hierarchical levels may include: function functions, test functions, test modules, operating systems in a hierarchical order from low to high, that is, the function functions are the lowest structural hierarchies in the multiple structural hierarchies. In a specific application scenario, the number of levels of the multiple hierarchical structures may change with the refinement and update of the operating system. For example, with the fine division of the system hierarchical structure of the operating system, the multiple hierarchical structures may include more than four (such as five or six, etc.) levels, which are not specifically limited here. In the following embodiment steps of the present disclosure, multiple hierarchical structures including functional functions, test functions, test modules, and operating systems in a hierarchical order from low to high are taken as an example to illustrate the technical solution in the present disclosure, but it does not constitute a specific limitation.

[0034] Exemplarily, when the multiple hierarchical structures include four hierarchical structures, when the test information indicates that it is necessary to perform a file system opening function test on the operating system to be tested, the multiple structural levels involved in the test may include, in order from low to high, the following: the lowest structural level - the function function corresponding to the file opening mode (such as read-only opening, write-only opening, readable and writable opening, etc.), the third structural level - the test function (file opening function), the second structural level - the test module (file system module), and the first structural level (i.e., the highest structural level) - the operating system (the operating system to be tested).

[0035] Step 103: extract the target atomic test case corresponding to the lowest structural level among the multiple structural levels.

[0036] For the embodiments of the present disclosure, after determining multiple structural levels corresponding to the test information and the hierarchical order between the multiple structural levels, the lowest structural level with the lowest corresponding hierarchical order can be determined in the multiple structural levels based on the hierarchical order. Then, the target atomic test case corresponding to the lowest structural level can be extracted from the atomic test case library based on fuzzy matching. Among them, multiple atomic test cases can be pre-stored in the atomic test case library, and the multiple atomic test cases can support the reuse of multiple operating systems, and an editable function is also provided for each atomic test case, which can realize the update and exception repair of the atomic test case, which is specifically reflected in the judgment of variable parameters (interface parameters can be added) and abnormal return values.

[0037] Step 104: Combine target atomic test cases to obtain target test cases corresponding to the operating system to be tested.

[0038] In a specific application scenario, each of the multiple structural levels may contain at least one hierarchical object. For example, the multiple structural levels correspond to four levels, that is, the four levels include: function function, test function, test module, operating system in a hierarchical order from low to high. For example, at least one function function may be included in the lowest structural level, at least one test function may be included in the third structural level, and at least one test module may be included in the second hierarchical structure. Among them, the third structural level is the upper level structure of the lowest structural level, and the second structural level is the upper level structure of the third structural level. For the embodiment of the present disclosure, as a possible implementation method, the target atomic test case corresponding to at least one hierarchical object in each structural level may be combined first in a hierarchical order from low to high, and then the test case of the upper structural level is determined layer by layer until the target test case corresponding to the operating system to be tested is obtained. Among them, when combining the target atomic test case, as a possible implementation method, an xml file may be configured, and the target atomic test case may be added and combined in the xml file. After completing the test of each module of the operating system, the corresponding test result may be returned and saved in the corresponding xml file.

[0039] For example, as shown in Table 1, the lowest structural level includes the function functions: read-only open, write-only open, readable and writable open, delete text, delete file, delete selected object, and the target atomic test cases corresponding to each function function in read-only open, write-only open, readable and writable open, delete text, delete file, and delete selected object are extracted from the atomic test case library: a, b, c, d, e, f respectively; then, by combining the target atomic test cases containing multiple function functions in the lowest structural level, the test case corresponding to the file opening function in the third structural level is a+b+c, and the test case corresponding to the deletion function in the third structural level is d+e+f; further, by combining the target atomic test cases of multiple test functions (file opening function and deletion function) contained in the third structural level, it can be determined that the test case corresponding to the file system module is a+b+c+d+e+f; if there is no other test module other than the file system module in the second structural level, then in the test case combination of the second structural level, it can be determined that the target test case corresponding to the operating system to be tested in the second structural level is a+b+c+d+e+f.

[0040] Table 1:

[0041]

[0042] Step 105: Use the target test case to test the operating system to be tested, and obtain the test result of the operating system to be tested.

[0043] For the disclosed embodiment, a simulation (Mock) tool can be called to simulate (Mock) access to the operating system to be tested for the generated target test case, and obtain the access result, that is, the test result of the operating system to be tested. Among them, illustratively, the simulation access process can be: when testing the operating system A to be tested based on the target test case, some fake objects can be constructed to simulate the interaction with A, and the behavior of these simulated objects is set according to the target test case and meets the expected objects. Through these simulated objects, it is tested whether A works normally under the corresponding setting conditions, and then the corresponding test results are obtained.

[0044] In summary, according to the operating system testing method provided by the embodiment of the present disclosure, after obtaining the test information of the operating system to be tested, multiple structural levels related to the test can be determined in the operating system to be tested according to the test information, and then the target atomic test cases corresponding to the lowest structural level among the multiple structural levels are directly reused and extracted, and the target test cases corresponding to the operating system to be tested are obtained by combining the target atomic test cases; finally, the operating system to be tested is tested with the target test cases to obtain the test results of the operating system to be tested. The technical solution in the present disclosure does not need to repeatedly write code when generating the target test cases corresponding to the operating system to be tested. The target atomic test cases corresponding to the lowest structural level among the multiple structural levels corresponding to the test information can be directly screened in the atomic test case library. Finally, the target test cases corresponding to the operating system to be tested can be quickly generated by combining the target atomic test cases, thereby improving the testing efficiency of the operating system.

[0045] Further, as a refinement and extension of the above embodiment, in order to fully illustrate the specific implementation process of the method of this embodiment, this embodiment provides the following Figure 2 The specific method shown includes:

[0046] Step 201: Obtain test information of the operating system to be tested.

[0047] For the embodiment of the present disclosure, the specific implementation process can refer to the relevant description in step 101 of the embodiment, which will not be repeated here.

[0048] Step 202: By analyzing the structural level information contained in the test information, multiple structural levels that need to execute the test process are selected from the system level structure corresponding to the operating system to be tested.

[0049] Among them, the multiple structural levels include at least: functional functions, test functions, test modules, and operating systems in order from low to high.

[0050] For the embodiment of the present disclosure, the specific implementation process can refer to the relevant description in step 102 of the embodiment, which will not be repeated here.

[0051] Step 203: extract functional test information corresponding to the functional function from the test information.

[0052] Among them, the functional test information is used to indicate the test function that needs to be implemented when the functional function is executed accordingly, which may include the functional test type, parameter information of the test input, expected output results, etc.

[0053] Step 204: obtain the information feature similarity between the functional test information and the functional description information corresponding to each atomic test case, and determine the atomic test case with the highest corresponding information feature similarity as the target atomic test case corresponding to the lowest structural level among the multiple structural levels.

[0054] Among them, the functional description information is the test function that can be realized when the atomic test case is executed; the atomic test case library is pre-created and verified on a stable operating system, and can contain multiple reusable atomic test cases. By combining the atomic test cases to generate the target test cases corresponding to the operating system to be tested, the accuracy of the target test cases can be guaranteed, and the test errors caused by test case coding errors can be reduced. Accordingly, when creating an atomic test case library, the embodiment steps may include: constructing an atomic test case library, in which multiple atomic test cases corresponding to multiple functional functions of each operating system are stored, and the functional functions at least record function parameters, return values ​​and corresponding functional description information.

[0055] In a specific application scenario, in order to enable the atomic test cases in the atomic test case library to support unified standards, such as the reuse of various operating systems of the Portable Operating System Interface of UNIX (POSIX) standard, when building the atomic test case library, the interface functions of each operating system can be first standardized and encapsulated. For example, the interfaces of most operating systems support the POSIX standard. For those that do not support the POSIX standard or the interface parameters of different operating systems are slightly different, they need to be encapsulated into standard interfaces. The obtained encapsulated function can record test information such as function parameters and return values ​​and save them in a specific format (such as XML format) to facilitate other interface calls. Secondly, in order to facilitate the distinction of encapsulated functions, the encapsulated functions can be numbered with function interfaces. For a certain interface, different parameters have different meanings. Take the file system open (open file) as an example: the ways to open a file are read-only open, write-only open, and readable and writable open. The function + number can be further used as the unique identifier of the interface function. For the above three encapsulated functions, they can be recorded as open_001, open_002, and open_003, and the corresponding description is added in its interface description for the caller to distinguish. Among them, the smallest subset of functions is encapsulated once and available everywhere. For functions reused across modules, the test code can also be reused.

[0056] For the embodiments of the present disclosure, after extracting the functional test information corresponding to the functional function from the test information, the information feature similarity can be calculated based on fuzzy matching, that is, the functional test information and the functional description information of each atomic test case in the atomic test case library. In the obtained information feature similarity calculation results, the atomic test case with the highest corresponding information feature similarity is determined as the target atomic test case corresponding to the lowest structural level among multiple structural levels.

[0057] Step 205 , combining target atomic test cases layer by layer in a hierarchy order from low to high in the multiple structural hierarchies until a target test case corresponding to the operating system to be tested is obtained.

[0058] In a specific application scenario, each of the multiple structural levels may contain at least one hierarchical object. For example, taking the multiple structural levels corresponding to four levels, that is, the four levels include, in order from low to high, functional functions, test functions, test modules, and operating systems, as an example, at least one functional function may be included in the lowest structural level, at least one test function may be included in the third structural level, and at least one test module may be included in the second hierarchical structure. For the embodiments of the present disclosure, as a possible implementation method, the embodiment steps may include: combining the target atomic test case corresponding to at least one functional function in the lowest structural level to obtain a first test case corresponding to the functional function of the previous level test function; combining the first test case corresponding to at least one test function in the third structural level to obtain a second test case corresponding to the test module of the previous level, and the third structural level is the previous level structure of the lowest structural level; combining the second test case corresponding to at least one test module in the second structural level to obtain a target test case corresponding to the operating system of the previous level of the test module, and the second structural level is the previous level structure of the third structural level.

[0059] For example, as shown in Table 1, the lowest structural level includes the function functions: read-only open, write-only open, readable and writable open, delete text, delete file, delete selected object, and the target atomic test cases corresponding to each function function in read-only open, write-only open, readable and writable open, delete text, delete file, and delete selected object are extracted from the atomic test case library: a, b, c, d, e, f respectively; then, by combining the target atomic test cases containing multiple function functions in the lowest structural level, the test case corresponding to the file opening function in the third structural level is a+b+c, and the test case corresponding to the deletion function in the third structural level is d+e+f; further, by combining the target atomic test cases of multiple test functions (file opening function and deletion function) contained in the third structural level, it can be determined that the test case corresponding to the file system module is a+b+c+d+e+f; if there is no other test module other than the file system module in the second structural level, then in the test case combination of the second structural level, it can be determined that the target test case corresponding to the operating system to be tested is a+b+c+d+e+f.

[0060] In a specific application scenario, the implementation steps may also include: analyzing test information, determining the test steps of each structural level in multiple structural levels, wherein the test steps include a first test step of at least one functional function in the lowest structural level, a second test step of at least one test function in the third structural level, and a third test step of at least one test module in the second structural level.

[0061] Correspondingly, for the embodiments of the present disclosure, when combining target atomic test cases to obtain target test cases corresponding to the operating system to be tested, as a possible implementation method, the embodiment steps may include: according to the hierarchical order from low to high in multiple structural levels, and the test steps corresponding to different structural levels under the hierarchical order, the target atomic test cases are combined layer by layer until the target test cases corresponding to the operating system to be tested are obtained.

[0062] In a specific application scenario, when combining target atomic test cases layer by layer according to the hierarchical order from low to high in multiple structural levels and the test steps corresponding to different structural levels under the hierarchical order until the target test case corresponding to the operating system to be operated is obtained, the implementation steps may include: combining the target atomic test cases corresponding to at least one functional function in the lowest structural level according to the order from front to back of the first test step to obtain a first test case corresponding to the test function of the previous level of the functional function; combining the first test case corresponding to at least one test function in the third structural level according to the order from front to back of the second test step to obtain a second test case corresponding to the test module of the previous level of the test function; combining the second test case corresponding to at least one test module in the second structural level according to the order from front to back of the third test step to obtain a target test case corresponding to the test module of the previous level of the operating system.

[0063] For example, as shown in Table 1, the lowest structural level includes the function functions: read-only open, write-only open, readable and writable open, delete text, delete file, delete selected object, and the target atomic test cases corresponding to each function function of read-only open, write-only open, readable and writable open, delete text, delete file, delete selected object are extracted from the atomic test case library, respectively: a, b, c, d, e, f; among them, the first test steps corresponding to the function function under the file open function can be ordered from front to back as: write-only open, readable and writable open, read-only open; the first test steps corresponding to the function function under the delete function can be ordered from front to back as: delete selected object, delete text, delete file, then the multiple function functions in the lowest structural level can be combined in the order of the first test steps from front to back. The target atomic test cases of the energy function can obtain the test case corresponding to the file opening function in the third structural level as b+c+a, and the test case corresponding to the deletion function in the third structural level as f+d+e; the order from front to back of the second test step of the test function can be: deletion function, file opening function, and the target atomic test cases of multiple test functions (file opening function and deletion function) contained in the third structural level can be further combined according to the order from front to back of the second test step, and the test case corresponding to the file system module is determined to be f+d+e+b+c+a; if there are no other test modules except the file system module in the second structural level, then in the test case combination of the second structural level, it can be determined that the target test case corresponding to the operating system to be tested is f+d+e+b+c+a.

[0064] Step 206: Use the target test case to test the operating system to be tested, and obtain the test result of the operating system to be tested.

[0065] For the embodiment of the present disclosure, the specific implementation process can refer to the relevant description of step 105 of the embodiment, which will not be repeated here.

[0066] In summary, according to the operating system testing method provided by the embodiment of the present disclosure, after obtaining the test information of the operating system to be tested, multiple structural levels related to the test can be determined in the operating system to be tested according to the test information, and then based on the hierarchical order, the target atomic test case corresponding to the lowest structural level in the multiple structural levels is directly reused and extracted in the atomic test case library; then, according to the hierarchical order from low to high in the multiple structural levels, the target atomic test case is combined layer by layer until the target test case corresponding to the operating system to be tested is obtained; finally, the target test case is used to test the operating system to be tested, and the test result of the operating system to be tested can be obtained. The technical solution in the present disclosure does not need to be repeatedly written when generating the target test case corresponding to the operating system to be tested. The target atomic test case corresponding to the lowest structural level in the multiple structural levels corresponding to the test information can be directly screened in the atomic test case library. Finally, by combining the target atomic test case, the target test case corresponding to the operating system to be tested can be quickly generated, thereby improving the test efficiency of the operating system. In addition, since the test case does not need to be repeatedly coded, the test error caused by coding errors can be avoided, thereby improving the accuracy of the operating system test.

[0067] Based on the above Figure 1-Figure 2 The specific implementation of the method shown in the embodiment provides an operating system testing device, such as Figure 3 As shown, the device includes: an acquisition module 31, a determination module 32, an extraction module 33, a combination module 34, and a testing module 35.

[0068] An acquisition module 31 is used to acquire test information of the operating system to be tested;

[0069] A determination module 32, which can be used to determine a plurality of structural levels corresponding to the test information in the operating system to be tested;

[0070] An extraction module 33, which can be used to extract target atomic test cases corresponding to the lowest structural level among multiple structural levels;

[0071] A combination module 34 may be used to combine target atomic test cases to obtain target test cases corresponding to the operating system to be tested;

[0072] The testing module 35 can be used to test the operating system to be tested using a target test case to obtain a test result of the operating system to be tested.

[0073] In some embodiments of the present disclosure, the test information includes structural hierarchy information involved in the test of the operating system to be tested, and the determination module 32 can be used to select multiple structural hierarchies that need to execute the test process in the system hierarchy structure corresponding to the operating system to be tested by analyzing the structural hierarchy information contained in the test information.

[0074] In some embodiments of the present disclosure, the lowest structural level among multiple structural levels is the functional function, and the extraction module 33 can be used to extract functional test information corresponding to the functional function in the test information; obtain the information feature similarity between the functional test information and the functional description information corresponding to each atomic test case; and determine the atomic test case with the highest corresponding information feature similarity as the target atomic test case corresponding to the lowest structural level among the multiple structural levels.

[0075] In some embodiments of the present disclosure, multiple structural levels include at least: function functions, test functions, test modules, and operating systems in order from low to high. The combination module 34 can be used to combine the target atomic test cases corresponding to at least one function function in the lowest structural level to obtain a first test case corresponding to the test function of the previous level of the function function; combine the first test case corresponding to at least one test function in the third structural level to obtain a second test case corresponding to the test module of the previous level of the test function, and the third structural level is the previous level structure of the lowest structural level; combine the second test case corresponding to at least one test module in the second structural level to obtain a target test case corresponding to the operating system of the previous level of the test module, and the second structural level is the previous level structure of the third structural level.

[0076] In some embodiments of the present disclosure, Figure 4 As shown, the method further includes: an analysis module 36;

[0077] An analysis module 36, which can be used to analyze the test information and determine the test steps of each of the multiple structural levels, wherein the test steps include a first test step of at least one functional function in the lowest structural level, a second test step of at least one test function in the third structural level, and a third test step of at least one test module in the second structural level;

[0078] Correspondingly, the combination module 34 can be used to combine the target atomic test cases layer by layer according to the hierarchical order from low to high in multiple structural levels and the test steps corresponding to different structural levels under the hierarchical order, until the target test cases corresponding to the operating system to be operated are obtained.

[0079] In some embodiments of the present disclosure, the combination module 34 can be used to combine the target atomic test cases corresponding to at least one functional function in the lowest structural level in the order from front to back of the first test step, to obtain a first test case of the functional function corresponding to the test function of the previous level; combine the first test cases corresponding to at least one test function in the third structural level in the order from front to back of the second test step, to obtain a second test case of the test function corresponding to the previous level test module; combine the second test cases corresponding to at least one test module in the second structural level in the order from front to back of the third test step, to obtain a target test case of the test module corresponding to the previous level operating system.

[0080] In some embodiments of the present disclosure, Figure 4 As shown, the method further includes: constructing module 37;

[0081] The construction module 37 can be used to construct an atomic test case library, which stores atomic test cases corresponding to functional functions of various operating systems. The functional functions at least record function parameters, return values ​​and corresponding functional description information.

[0082] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0083] The various techniques described herein may be implemented in combination with hardware or software, or a combination thereof. Thus, the method and apparatus of the present invention, or some aspects or parts of the method and apparatus of the present invention may be in the form of program codes (i.e., instructions) embedded in a tangible medium, such as a removable hard disk, a USB flash drive, a floppy disk, a CD-ROM, or any other machine-readable storage medium, wherein when the program is loaded into a machine such as a computer and executed by the machine, the machine becomes a device for practicing the present invention.

[0084] In the case where the program code is executed on a programmable computer, the computing device generally includes a processor, a storage medium readable by the processor (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device. The memory is configured to store the program code; the processor is configured to execute the method of the present invention according to the instructions in the program code stored in the memory.

[0085] By way of example and not limitation, readable media include readable storage media and communication media. Readable storage media stores information such as computer readable instructions, data structures, program modules or other data. Communication media generally embody computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and include any information transfer medium. Any combination of the above is also included within the scope of readable media.

[0086] In the description provided herein, algorithms and displays are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the examples of the present invention. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages ​​can be utilized to implement the content of the present invention described herein, and the above description of specific languages ​​is for the purpose of disclosing the preferred embodiment of the present invention.

[0087] In the description provided herein, numerous specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures, and methods are not shown in detail.

[0088] structures and techniques so as not to obscure the understanding of this specification.

[0089] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this method of disclosure should not be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim.

[0090] Those skilled in the art will appreciate that the modules or units or components of the devices in the examples disclosed herein may be arranged in the devices described in the embodiment, or alternatively may be located in one or more devices different from the devices in the examples. The modules in the foregoing examples may be combined into one module or may be divided into multiple submodules.

[0091] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

[0092] Furthermore, those skilled in the art will appreciate that although some embodiments herein include certain features included in other embodiments but not other features, the combination of features from different embodiments is meant to be within the scope of the present invention and to form different embodiments.

[0093] In addition, some of the embodiments are described herein as a combination of methods or method elements that can be implemented by a processor of a computer system or by other devices that perform functions. Therefore, a processor with necessary instructions for implementing a method or method element forms a device for implementing the method or method element. In addition, the elements of the device embodiment herein are examples of devices that are used to implement the functions performed by the elements for the purpose of implementing the invention.

[0094] As used herein, unless otherwise specified, the use of ordinal numbers "first," "second," "third," etc. to describe common objects merely indicates that different instances of similar objects are involved, and is not intended to imply that the objects so described must have a given order in time, space, order, or in any other manner.

[0095] Although the present invention has been described according to a limited number of embodiments, it will be understood by those skilled in the art, with the benefit of the above description, that other embodiments may be envisioned within the scope of the invention thus described. In addition, it should be noted that the language used in this specification is selected primarily for readability and teaching purposes, rather than for explaining or limiting the subject matter of the present invention. Therefore, many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the appended claims. With respect to the scope of the present invention, the disclosure of the present invention is illustrative rather than restrictive, and the scope of the present invention is defined by the appended claims. It should be understood that various forms of processes shown above may be used to reorder, add or delete steps. For example, the steps described in this disclosure may be performed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, and this document is not limited thereto.

[0096] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A method for testing an operating system, It is characterized in that include: Obtain test information of the operating system to be tested; Determining a plurality of structural levels corresponding to the test information in the operating system to be tested; Extracting target atomic test cases corresponding to the lowest structural level among the multiple structural levels; Combining the target atomic test cases to obtain a target test case corresponding to the operating system to be tested; The target test case is used to test the operating system to be tested, and a test result of the operating system to be tested is obtained.

2. The method according to claim 1, It is characterized in that The test information includes structural level information involved in the test of the operating system to be tested, and determining multiple structural levels corresponding to the test information in the operating system to be tested includes: By analyzing the structural level information contained in the test information, a plurality of structural levels on which a test process needs to be executed are selected from the system level structure corresponding to the operating system to be tested.

3. The method according to claim 1, It is characterized in that The lowest structural level among the multiple structural levels is a functional function, and extracting a target atomic test case corresponding to the lowest structural level among the multiple structural levels includes: Extracting functional test information corresponding to the functional function from the test information; Obtaining information feature similarity between the functional test information and functional description information corresponding to each atomic test case; The atomic test case with the highest similarity to the information feature is determined as the target atomic test case corresponding to the lowest structural level among the multiple structural levels.

4. The method according to claim 1, It is characterized in that The multiple structural levels at least include, in descending order, a functional function, a test function, a test module, and an operating system. The combining of the target atomic test cases to obtain a target test case corresponding to the operating system to be tested includes: Combining the target atomic test cases corresponding to at least one functional function in the lowest structural level to obtain a first test case corresponding to the test function of the upper level of the functional function; Combining the first test case corresponding to at least one test function in a third structural level to obtain a second test case corresponding to a test module of a previous level of the test function, wherein the third structural level is a level structure above the lowest structural level; The second test cases corresponding to at least one test module in the second structural level are combined to obtain a target test case of the upper-level operating system corresponding to the test module, and the second structural level is the upper-level structure of the third structural level.

5. The method according to claim 4, It is characterized in that The method further comprises: Analyze the test information to determine the test steps of each of the multiple structural levels, wherein the test steps include a first test step of at least one functional function in the lowest structural level, a second test step of at least one test function in the third structural level, and a third test step of at least one test module in the second structural level; The combining the target atomic test cases to obtain the target test cases corresponding to the operating system to be tested includes: According to the hierarchical order from low to high in the multiple structural hierarchies and the test steps corresponding to different structural hierarchies under the hierarchical order, the target atomic test cases are combined layer by layer until the target test cases corresponding to the operating system to be operated are obtained.

6. The method according to claim 5, It is characterized in that The step of combining the target atomic test cases layer by layer according to the hierarchical order from low to high in the multiple structural hierarchies and the test steps corresponding to different structural hierarchies under the hierarchical order until obtaining the target test cases corresponding to the operating system to be operated includes: According to the first test steps from front to back, the target atomic test cases corresponding to at least one functional function in the lowest structural level are combined to obtain a first test case corresponding to the test function of the upper level of the functional function; According to the order of the second test steps from front to back, the first test cases corresponding to at least one test function in the third structural level are combined to obtain a second test case corresponding to the test module of the upper level of the test function; According to the order of the third test steps from front to back, the second test cases corresponding to at least one test module in the second structural level are combined to obtain a target test case of the upper-level operating system corresponding to the test module.

7. The method according to any one of claims 1 to 6, It is characterized in that The method further comprises: An atomic test case library is constructed, in which atomic test cases corresponding to functional functions of various operating systems are stored, and the functional functions at least record function parameters, return values ​​and corresponding functional description information.

8. An operating system testing device, It is characterized in that include: An acquisition module, used to acquire test information of the operating system to be tested; A determination module, configured to determine a plurality of structural levels corresponding to the test information in the operating system to be tested; An extraction module, used for extracting target atomic test cases corresponding to the lowest structural level among the multiple structural levels; A combination module, used for combining the target atomic test cases to obtain target test cases corresponding to the operating system to be tested; The testing module is used to test the operating system to be tested using the target test case to obtain a test result of the operating system to be tested.

9. An electronic device, include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium storing computer instructions, in, The computer instructions are used to cause the computer to execute the method according to any one of claims 1-7.