Test case set generation method and device, computer device and storage medium
By decoupling and randomly combining the business components of the software under test to generate test case sets, the problem of incomplete testing due to traditional API-level granular construction is solved, and the completeness and ease of use of test case sets are achieved.
Patent Information
- Application Number
- CN202211149764.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-21
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2042-09-21
AI Technical Summary
The traditional approach of constructing test case sets at the API level cannot achieve complete testing, cannot reflect real business scenarios, leads to resource waste and high maintenance costs, and is difficult to cover all business logic, resulting in incomplete test case sets.
The target business in the software under test is decoupled using a pre-defined decoupling method. This is achieved by encapsulating the functional interfaces of the business components and generating a test case sequence using randomly combined business logic commands, thus forming a test case set.
It achieves completeness of test case sets, is easy to manage, extend and reuse, can truly reflect real business scenarios, reduces maintenance costs and resource waste, and improves testing efficiency.
Smart Images

Figure CN115422080B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of software testing technology, and in particular to a method, apparatus, computer device, and storage medium for generating test case sets. Background Technology
[0002] The construction and improvement of test case sets are the primary key factors in ensuring the completeness of unit tests; current testing frameworks construct test case sets based on the API (Application Programming Interface) dimension. However, the traditional approach of constructing test case sets at the API level has the problem of failing to achieve complete testing. Summary of the Invention
[0003] Therefore, it is necessary to provide a method, apparatus, computer equipment, and storage medium for generating test case sets that can perform complete testing, in order to address the above-mentioned technical problems.
[0004] Firstly, this application provides a method for generating a test case set, the method comprising:
[0005] A pre-defined decoupling method is adopted to decouple each target business in the software under test, resulting in several business logic commands. The pre-defined decoupling method includes encapsulating the functional interfaces of the business components of the target business. The functional interfaces include common application programming interfaces related to the target functions.
[0006] By randomly combining various business logic commands, several test case sequences are obtained;
[0007] Based on the sequence of test cases, a set of test cases for the software under test is determined.
[0008] In one embodiment, the method further includes:
[0009] Based on the business process, identify the target business processes in the software under test;
[0010] Based on business logic, the target functions are determined.
[0011] In one embodiment, a preset decoupling method is used to decouple each target service in the software under test to obtain several business logic commands, including:
[0012] Obtain the functional hierarchy involved in the execution of the target function of the business component;
[0013] Encapsulate functional interfaces belonging to the same functional level to obtain several business logic commands.
[0014] In one embodiment, the preset decoupling method includes encapsulating the functional interfaces of the business components of the target business using function templates; the test case set also includes test logic commands; the method further includes:
[0015] Test functions are encapsulated using function templates to obtain test logic commands; among them, test functions include functions used to characterize the test logic for the software under test.
[0016] In one embodiment, the function template includes: a function prototype for encapsulating functional interfaces and test functions to obtain corresponding encapsulated data, and a function prototype for compiling the encapsulated data into a corresponding library file.
[0017] In one embodiment, a function template is used to encapsulate the functional interfaces of the business components of the target business, including:
[0018] The business code of the functional interface is encapsulated using appropriate preprocessing rules. The preprocessing rules are determined based on the code type of the business code and the software architecture level to which the business code belongs. The preprocessing rules include the definition of the compilation status of the function template during the business code encapsulation process.
[0019] In one embodiment, the code types include driver code and firmware code; the software architecture layers include a real-time operating system (RTOS) layer and a kernel layer.
[0020] The preprocessing rules include driver code for the kernel layer, kernel layer code that interacts with the real-time operating system (RTOS) layer, and firmware code for the RTOS layer, which are encapsulated using function templates whose compilation state is defined as independent dynamic libraries.
[0021] In one embodiment, the code type further includes a first dynamic library code and a second dynamic library code; the code modifiability attribute of the first dynamic library code is set to non-modifiability; the code modifiability attribute of the second dynamic library code is set to modifiability; the software architecture layer further includes a hardware abstraction layer (HAL).
[0022] The preprocessing rules also include encapsulating the first dynamic library code for the Hardware Abstraction Layer (HAL) using function templates defined as independent dynamic libraries in the compilation state.
[0023] The preprocessing rules also include encapsulating the second dynamic library code for the Hardware Abstraction Layer (HAL) using function templates defined as non-independent dynamic libraries in the compilation state; wherein, the function templates defined as non-independent dynamic libraries in the compilation state and the second dynamic library code belong to the same dynamic library file.
[0024] In one embodiment, the step of obtaining a sequence of test cases by randomly combining various business logic commands includes:
[0025] Identify the target logic command among the various business logic commands; where the target logic command is unrelated to the business execution flow of the target business.
[0026] A random algorithm is used to recombine the target logic commands.
[0027] In one embodiment, the step of recombining the target logic commands using a random algorithm includes:
[0028] Based on the random seed of the current round of the random algorithm, the target logic commands are combined to generate the test case sequence for the current round, and the random seed of the current round is saved.
[0029] In one embodiment, the test case sequence is a test case file that carries the test cases in a text file; the test cases contain several timing logic commands; the timing logic commands include encapsulated commands for adjusting the execution timing and number of test cases.
[0030] Secondly, this application also provides a test case set generation apparatus, the apparatus comprising:
[0031] The business decoupling module is used to decouple each target business in the software under test using a preset decoupling method to obtain several business logic commands. The preset decoupling method includes encapsulating the functional interfaces of the business components of the target business. The functional interfaces include common application programming interfaces related to the target functions.
[0032] The random combination module is used to generate a sequence of test cases by randomly combining various business logic commands.
[0033] The set determination module is used to determine the set of test cases for the software under test based on the sequence of test cases.
[0034] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described method.
[0035] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.
[0036] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described method.
[0037] The aforementioned test case set generation method, apparatus, computer equipment, and storage medium decouple each target service in the software under test through a preset decoupling method. This preset decoupling method includes encapsulating the functional interfaces of the business components of the target services. These functional interfaces include common application programming interfaces related to the target functions, thereby shielding the differences between various services. By randomly combining various business logic commands, several test case sequences are obtained, and a test case set for the software under test is determined, achieving a complete test case set that is easy to improve. The test case set in this embodiment can truly reflect the real-world scenarios of the business and is easy to manage, easy to expand, and highly reusable. Attached Figure Description
[0038] Figure 1 This is an application environment diagram of the test case set generation method in one embodiment;
[0039] Figure 2 This is a flowchart illustrating a test case set generation method in one embodiment;
[0040] Figure 3 This is a flowchart illustrating the steps for obtaining business logic commands in one embodiment;
[0041] Figure 4 This is a flowchart illustrating the steps for obtaining a test case sequence in one embodiment;
[0042] Figure 5 This is a schematic diagram illustrating the construction of a multimedia software test case set in one embodiment;
[0043] Figure 6 This is a structural block diagram of a test case set generation device in one embodiment;
[0044] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0045] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0046] Currently, the JUnit testing framework for AOSP (Android Open Source Project) Java, the GTest testing framework for AOSP C++, and the KUnit testing framework for the Kernel all construct test case sets based on the API dimension.
[0047] Traditional methods are based on various public APIs (Public Application Programming Interfaces) of a business application. They perform functional or performance testing for specific scenarios by setting input parameters and comparing output parameters and return values. These testing frameworks provide support for various assertions, such as the ASSERT_* and EXPECT_* series, reporting whether the test cases have passed based on whether the test results meet expectations. This testing framework constructs each test case using the TEST macro, typically requiring coverage of a specific API's functionality in a 1:3 ratio. All these test cases form a complete test case set. The methods for constructing test case sets are mainly general testing methodologies, such as equivalence partitioning, boundary value analysis, scenario-based testing, decision tables, cause-effect graphs, error guessing, and orthogonal array testing, all of which construct test case sets at the API level.
[0048] Traditional test case set construction based on API granularity has at least the following problems: ① The API granularity is too fine. Test cases constructed at this level cannot reflect real business scenarios. Actual business is not an isolated set of APIs, but a collection of interconnected APIs, which cannot be reflected by test case construction for a single API. ② Test cases constructed according to general testing methodologies often lack actual business value, resulting in wasted resources. ③ Due to the significant differences between different actual business scenarios, constructing test case sets based on APIs cannot achieve good business decoupling. After business adjustments, test cases need to be modified (code modification), resulting in high workload and maintenance costs, poor scalability, and the inability to complete test case sets without modifying code. ④ Test case sets are difficult to perfect. Combining APIs with general testing methodologies can basically cover all API test scenarios, but cannot cover all business logic. This gap means that even after the API passes the test and the actual business goes live, there will still be some omissions (i.e., the test case set is not complete). This incompleteness cannot be solved at the single API granularity.
[0049] This application's embodiments consider the construction and coverage of test case sets from the perspective of the entire business flow. It proposes to decouple the logical differences between test cases and business processes, and to improve the test case set through a randomization algorithm, making the test case set easy to construct, easy to expand, and able to achieve the purpose of complete testing.
[0050] The test case set generation method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, the software under test 102 is processed by the test framework 104 to obtain the corresponding test case set 106.
[0051] The software under test 102 can refer to the software that needs to be tested. Exemplarily, this software can be any software program run by an operating system, processor, electronic device, server, etc. It should be noted that, in this embodiment, the operating system can be an Android operating system, an RTOS (Real-Time Operating System), a UNIX operating system, a Linux operating system, a DOS operating system, a Windows operating system, a Mac operating system, etc. Optionally, the processor can include one or more processing units, which can be separate or integrated. Exemplarily, the electronic device can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can be smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. Portable wearable devices can be smartwatches, smart bracelets, head-mounted devices, etc. Furthermore, the server can be implemented using a standalone server or a server cluster composed of multiple servers.
[0052] Furthermore, the software under test can be implemented using software in the corresponding field; in some examples, the software under test can refer to multimedia software, and in addition, the software under test can also refer to in-vehicle software, UI (User Interface) software, 5G (5th Generation Mobile Communication Technology) core network software, etc.; it should be noted that the software under test in the embodiments of this application can be extended to other fields, not limited to the field of multimedia software, such as the field of in-vehicle software, the field of UI software development, the field of 5G core network software testing, etc.
[0053] Test framework 104 can refer to a Test Framework, specifically a framework applied in software testing; where a framework is a set of cooperating classes that constitute a reusable design for a particular type of software, and the test framework specifies the architecture in the test application. In this embodiment, the test framework can be an MMT (MultiMedia Test Framework). It should be noted that the test framework in this embodiment can be extended to other fields, and this application is not limited in this regard.
[0054] Test case set 106 can refer to a set of test cases, that is, a collection of test cases. A test case is a description of a testing task for a specific software product, reflecting the test plan, methods, techniques, and strategies. Its content includes test objectives, test environment, input data, test steps, expected results, and test scripts. Simply put, a test case is a set of test inputs, execution conditions, and expected results compiled for a specific goal to verify whether a specific software requirement is met.
[0055] In one embodiment, such as Figure 2 As shown, a method for generating test case sets is provided, which can be applied to... Figure 1 Taking the test framework 104 as an example, the following steps are included:
[0056] Step 202: Using a preset decoupling method, each target service in the software under test is decoupled to obtain several business logic commands; the preset decoupling method includes encapsulating the functional interfaces of the business components of the target services; the functional interfaces include common application programming interfaces related to the target functions.
[0057] In this context, "software under test" refers to the software that needs to be tested. This embodiment uses multimedia software as an example for illustration. Further, based on the business direction (which can also be a business domain; for example, it can also start from the business process), the business (target business) included in the software under test is identified. Optionally, taking multimedia software as an example, based on the multimedia business direction, it is determined that the multimedia software may include services such as Camera, Audio, Video, and Display.
[0058] Specifically, this application proposes a pre-defined decoupling method to decouple each target service in the software under test. The target service can refer to each service in the software under test determined according to the business process. Taking the software under test as multimedia software as an example, each target service can refer to Camera, Audio, Video, and Display. Different services have very different internal processing logics. Before constructing the test case set, this application proposes to preprocess each target service, that is, to decouple the differences in services, so as to facilitate the construction of the subsequent test case set.
[0059] The pre-defined decoupling method in this application embodiment includes encapsulating the functional interfaces of the business components of the target service. These functional interfaces include public application programming interfaces (APIs) related to the target function. Each target service may have multiple public APIs, and each target service may include multiple business components, each of which may have several implemented APIs. Taking multimedia software as an example, the public APIs of the target service Audio may include audio_device_utils_update_device_list / audio_device_utils_compare_device_type, etc.; the public APIs of the target service Camera may include setTorchModeCheck / acquire Flash / releaseFlash, etc.; and the public APIs of the target service Display may include sw_sel_model_top_isa / int_sel_model_top_isa / set_first_frame_flag, etc.
[0060] In some examples, a business component can refer to a module of the target business, i.e., a business module; taking the software under test as multimedia software as an example, the target business Video may include multiple modules (business components) such as AVC (Advanced Video Coding) / HEVC (High Efficiency Video Coding) / AV1 / VP8 / VP9.
[0061] Furthermore, in this embodiment, the functional interface of the business component refers to the public application programming interface (public API) related to the target function, which can be determined based on business logic. That is, the encapsulation of the public API of the target business in this embodiment differs from traditional unit testing (UT) schemes. Instead of encapsulating each API individually, it encapsulates the public APIs related to the target function in the business component from a business logic perspective. In other words, it encapsulates the functions of the native business (non-independent APIs) based on the principle of starting from the business process. Through the encapsulation method proposed in this embodiment, the differences between various businesses and APIs can be shielded.
[0062] For example, the encapsulation of functional interfaces in this application embodiment can be implemented through a testing framework. For instance, encapsulation can be achieved by adding a new layer of code (the developed software program) within the testing framework. It should be noted that encapsulation in this application embodiment can refer to combining abstracted data and behaviors (or functions) to form an organic whole, that is, organically combining data with the source code that operates on the data to form a "class", where both data and functions are members of the class.
[0063] In one embodiment, the method further includes:
[0064] Based on the business process, identify the target business processes in the software under test;
[0065] Based on business logic, the target functions are determined.
[0066] Specifically, the target business processes in the software under test can be identified through business workflows, and the target functions can be determined based on the business logic. These target functions can refer to the functions involved in the business components. Taking multimedia software as an example, the target function may include decoding. Furthermore, the public API (functional interface) for decoding in the AVC business component of the target business Video may include startDecode, decodePicture, flush, drain, stopDecode, etc.
[0067] In the above embodiments, the functional interfaces of the business components of the target business are encapsulated to decouple each target business in the software under test, thereby shielding the business differences of each target business in the software under test and providing the possibility for the completeness of the test case set.
[0068] This application embodiment decouples each target service in the software under test using a preset decoupling method, resulting in several business logic commands. These business logic commands can refer to commands obtained by encapsulating functional interfaces (functions). Optionally, the business logic commands can refer to functions that characterize business processing logic.
[0069] In one embodiment, the preset decoupling method may include encapsulating the functional interfaces of the business components of the target business using function templates.
[0070] Specifically, this application encapsulates functional interfaces (functions) by providing function templates, which can shield the differences between various business processes and APIs. These function templates can refer to custom function prototype templates that do not depend on differences at the business level; that is, they are encapsulated according to the template requirements, thus achieving decoupling by shielding business differences.
[0071] In one embodiment, the function template may include: a function prototype for encapsulating the functional interface to obtain the corresponding encapsulated data, and a function prototype for compiling the encapsulated data into the corresponding library file.
[0072] Specifically, the function prototypes in the function templates of this application embodiment can encapsulate the actual business APIs (corresponding functional interfaces) into new APIs (encapsulated data) and compile them into corresponding library files (compiling the encapsulated data into corresponding library files).
[0073] Furthermore, the function prototype in this embodiment supports commonly used basic parameter types and includes at least one custom structure (e.g., a custom Context structure). This allows the function template to shield the complexity of parameters in actual business APIs (i.e., it shields complex parameter differences; implementing business APIs often involves complex parameters, such as structures and smart pointers), improving the usability of the testing framework and reducing the difficulty of constructing test cases. An example of the function prototype is as follows:
[0074]
[0075] Each of the above function prototypes contains at least one parameter, `VOID*&`, which is a pointer reference to a custom structure. It should be noted that `FuncNoArg` represents a function prototype with no other parameters (a function pointer); `FuncIntegerArg` represents a function prototype that supports a single integer parameter; `FuncFloatArg` represents a function prototype that supports a single floating-point number; `FuncStringArg` represents a function prototype that supports a single string; `Func2Arg` represents a function prototype that supports two parameters; `Func3Arg` represents a function prototype that supports three parameters; and `FuncStringVector` represents a function prototype that supports an array of strings.
[0076] Furthermore, the function template containing the aforementioned function prototypes can be implemented by adding a new layer of code within the testing framework. Further, this new layer can be implemented using an adaptation layer (the developed software program). For example, the adaptation layer within the testing framework can use appropriate construction methods (preprocessing rules) to decouple the target business logic; that is, by providing function templates to encapsulate the functional interfaces of the target business's business components, it can shield the differences between various business processes and APIs. Furthermore, during test execution, the test case text can be parsed first, and then its specific implementation can be found in the library files to execute the test code. It should be noted that the function template (function prototype template) in this embodiment can be considered as the primary method for implementing the adaptation layer.
[0077] In one embodiment, a function template is used to encapsulate the functional interfaces of the business components of the target business, including:
[0078] The business code of the functional interface is encapsulated using appropriate preprocessing rules. The preprocessing rules are determined based on the code type of the business code and the software architecture level to which the business code belongs. The preprocessing rules include the definition of the compilation status of the function template during the business code encapsulation process.
[0079] Specifically, the testing framework in this application embodiment can preprocess each target business before constructing the test case set in order to decouple the differences between businesses; wherein, the preprocessing rules can refer to the preprocessing logic of the target business, for example, the specific construction method.
[0080] In some examples, preprocessing rules can be determined based on the code type of the business code of the functional interface and the software architecture level to which the business code belongs. The business code of the functional interface can refer to the code being tested; that is, the embodiments of this application can complete code testing of the target business. Furthermore, the code type can be used to characterize the service object to which the business code belongs in the target business, such as driver code and firmware (FW) code. The former is a software (operating system) service, and the latter is a hardware service. The software architecture level is used to characterize the architecture layer involved in the business code in the target business. For example, the target business may include code from the operating system (e.g., RTOS) layer -> kernel (e.g., Kernel) layer -> hardware abstraction layer (e.g., HAL, Hardware Abstraction Layer). It should be noted that firmware can be software (or a program) embedded in a hardware device, and can be a program written to erasable programmable read-only memory (EPROM) or electrically erasable programmable read-only memory (EEPROM).
[0081] Meanwhile, this preprocessing rule includes the definition of the compilation status of function templates during the business code encapsulation process, which can then determine whether to directly modify the business code internally. Taking the application of function templates in the Adaptation Layer of the testing framework as an example, this compilation status can indicate whether the Adaptation Layer adopts the form of an independent dynamic library (the Adaptation Layer is compiled into a separate dynamic library) or a non-independent dynamic library during the business code encapsulation process.
[0082] In one embodiment, the code types include driver code and firmware code; the software architecture layers include a real-time operating system (RTOS) layer and a kernel layer.
[0083] The preprocessing rules include driver code for the kernel layer, kernel layer code that interacts with the real-time operating system (RTOS) layer, and firmware code for the RTOS layer, which are encapsulated using function templates whose compilation state is defined as independent dynamic libraries.
[0084] Specifically, in this application embodiment, the code type of the business code may include driver code and firmware code, while the software architecture layer may include the Real-Time Operating System (RTOS) layer and the Kernel layer. Furthermore, the preprocessing rule adopted may refer to the following: when the business code of the functional interface is driver code of the Kernel layer (e.g., TestTarget.ko), when the business code of the functional interface is Kernel layer code interacting with the Real-Time Operating System (RTOS) layer (e.g., Wrapper.ko), and when the business code of the functional interface is firmware code of the Real-Time Operating System (RTOS) layer (e.g., TestTarget.bin), a function template defined as an independent dynamic library is used for encapsulation, without directly modifying the business code internally. For example, taking the application of the function template to the Adaptation Layer in the testing framework, a function template defined as an independent dynamic library can mean compiling the Adaptation Layer into a separate dynamic library.
[0085] In one embodiment, the code type further includes a first dynamic library code and a second dynamic library code; the code modifiability attribute of the first dynamic library code is set to non-modifiability; the code modifiability attribute of the second dynamic library code is set to modifiability; the software architecture layer further includes a hardware abstraction layer (HAL).
[0086] The preprocessing rules also include encapsulating the first dynamic library code for the Hardware Abstraction Layer (HAL) using function templates defined as independent dynamic libraries in the compilation state.
[0087] The preprocessing rules also include encapsulating the second dynamic library code for the Hardware Abstraction Layer (HAL) using function templates defined as non-independent dynamic libraries in the compilation state; wherein, the function templates defined as non-independent dynamic libraries in the compilation state and the second dynamic library code belong to the same dynamic library file.
[0088] Specifically, the code modifiability attributes of the first dynamic library code and the second dynamic library code are different; the code modifiability attribute of the first dynamic library code is non-modifiable, while the code modifiability attribute of the second dynamic library code is modifiable. In some examples, taking the application of function templates in the Adaptation Layer of a test framework as an example, the code type of the business code (e.g., TestTarget.so) can be determined based on the code modifiability attribute and whether it can be compiled into the same library file as the Adaptation Layer.
[0089] Furthermore, when the business code of the functional interface is the first dynamic library code of the Hardware Abstraction Layer (HAL), a function template defined as an independent dynamic library is used for encapsulation, without directly modifying the business code internally.
[0090] Furthermore, when the business code of the functional interface is the second dynamic library code of the Hardware Abstraction Layer (HAL), a function template defined as a non-independent dynamic library is used for encapsulation. This function template and the second dynamic library code belong to the same dynamic library file. In other words, the business code is directly modified internally and compiled into the same library file. In some examples, taking the application of the function template to the Adaptation Layer in the test framework as an example, this means that the Adaptation Layer and the code being tested are compiled together.
[0091] It should be noted that TestTarget.ko is the kernel layer code, which can be understood as driver code; Wrapper.ko is the kernel layer code that interacts with the RTOS layer code; TestTarget.bin is the RTOS layer code, i.e., firmware code; and TestTarget.so is the HAL layer target library file to be tested.
[0092] In summary, this application's embodiments decouple the target business logic based on a custom function template. It does not rely on differences in business logic and code layers, and encapsulates the logic according to the function template requirements, thus achieving decoupling that masks differences between business logic and code. This application's embodiments achieve true decoupling, covering not only business differences in the software under test but also code differences (e.g., differences between RTOS code, kernel code, and firmware code), resulting in easy management, easy expansion, easy improvement of use case sets, and strong reusability.
[0093] Step 204: By randomly combining various business logic commands, a sequence of test cases is obtained.
[0094] Specifically, after obtaining each business logic command, the encapsulated business logic commands are placed in a data set, and this data set is randomly combined. After random combination, a complete set of random function sequences can be obtained. Each sequence in this set can reflect the actual business logic of the target business operation. That is, the test case sequence in this application embodiment can refer to the sequence obtained after randomly combining each business processing logic command.
[0095] Furthermore, the random combination of business logic commands in this embodiment can refer to randomly shuffling and combining the various business logic commands, thereby triggering more test scenarios. Optionally, randomly combining the various business logic commands can refer to generating test cases using a randomization method, such as using a random algorithm.
[0096] Step 206: Determine the test case set for the software under test based on the sequence of test cases.
[0097] Specifically, when different test case sequences are obtained, the set of test case sequences can be identified as a test case set; in the embodiments of this application, each test case in the test case set is generated by randomization, and the test case set can truly reflect the real business scenario, and is easy to expand and highly reusable.
[0098] Using the test case set in this application embodiment to test the software under test can play a positive role in code coverage statistics. Code coverage obtained by running test cases that conform to real business logic is more meaningful. In addition, this application embodiment can realize coverage statistics between different processes.
[0099] In one embodiment, the test case set further includes test logic commands; the method also includes:
[0100] Test functions are encapsulated using function templates to obtain test logic commands; among them, test functions include functions used to characterize the test logic for the software under test.
[0101] Specifically, the test case set in this application embodiment also includes test logic commands, which are used to characterize the test logic for the software under test. Based on the encapsulation of business logic, this application embodiment can implement function encapsulation to ensure test logic; for example, test functions may include, but are not limited to, creating a test instance, unregistering a test instance, starting decoding, and unregistering decoding.
[0102] Furthermore, test functions can be encapsulated using function templates. In one embodiment, the function template includes: a function prototype for encapsulating the test function to obtain corresponding encapsulated data, and a function prototype for compiling the encapsulated data into a corresponding library file. Specifically, the function template for encapsulating the test function can be implemented using the function template for encapsulating functional interfaces in this application embodiment, or it can be implemented by applying the function template to the Adaptation Layer in the test framework, which will not be elaborated here.
[0103] It should be noted that, in this embodiment, the test logic commands formed by encapsulating the test functions that guarantee the test logic are not randomly combined objects. That is, of the two types of functions encapsulated in this embodiment (test functions and functional interfaces), the test functions are not affected by subsequent changes in business logic and do not require expansion; therefore, they are not randomly combined objects. However, the functions representing business processing logic formed by encapsulating functional interfaces (business logic commands) are less affected by business changes (the logic to be processed has already been integrated internally, with a coarser granularity than UT, and is much less affected), and are therefore objects that need to be randomly combined.
[0104] This application improves the test case set of the software under test, making the test case set more complete. The embodiments of this application can be applied to software under test that is large, logically complex, and involves multiple concurrent tasks. By improving the test case set, the problem convergence cycle can be accelerated, the software iteration delivery cycle can be shortened, the testing efficiency of developers can be improved, and the test results can be made more reliable.
[0105] In one embodiment, such as Figure 3 As shown, the steps of decoupling each target service in the software under test using a preset decoupling method to obtain several business logic commands may include:
[0106] Step 302: Obtain the functional levels involved in the execution of the target function of the business component;
[0107] Step 304: Encapsulate the functional interfaces belonging to the same functional level to obtain several business logic commands.
[0108] Specifically, the encapsulation of functional interfaces of business components in this application refers to breaking down the process from a business logic perspective, thereby encapsulating the corresponding public APIs. For example, the execution process of a business component for a target function can be broken down to obtain the functional hierarchy involved in the execution of that target function. Taking the software under test as multimedia software and the target function as decoding as an example, the process is broken down, such as the decoding process corresponding to the Decode function, without further encapsulating other details; these processing logics are handled internally.
[0109] The functional layers in this application embodiment can refer to the functional layers involved in the operation of the target function by the business component. Taking multimedia software as an example, the Decoder of the business component AVC in the target business Video may involve functional layers including the components layer, UL UMD, and BL UMD layers. Based on this application, each layer can be further encapsulated, and then linked together from the decoding process (it also supports independent testing of the code of a single layer). The encapsulation method of other business components (business modules) is the same. Furthermore, the specific implementation method for encapsulating functional interfaces belonging to the same functional layer can be implemented by using the function template for encapsulating functional interfaces in this application embodiment, or by applying the function template to the Adaptation Layer in the test framework, which will not be elaborated here.
[0110] This application's embodiments encapsulate functional interfaces belonging to the same functional level, which avoids the problems of coarse granularity and poor flexibility caused by independently encapsulating the entire decoding process; this application is conducive to constructing randomized test cases for more comprehensive testing, and can realize coverage statistics between different processes.
[0111] The above analysis of the various business components (modules) of the software under test reveals the main business processing logic. Function encapsulation based on a function model is then used to adapt the business modules. This not only masks the business differences between the target businesses of the software under test but also the logical differences between the various business components (modules), enabling the completeness of the test case set and achieving ease of management, expansion, improvement, and reusability.
[0112] In one embodiment, such as Figure 4 As shown, the steps to obtain a sequence of test cases by randomly combining various business logic commands include:
[0113] Step 402: Identify the target logic command among the various business logic commands; wherein, the target logic command is unrelated to the business execution flow of the target business.
[0114] Step 404: Use a random algorithm to recombine the target logic commands.
[0115] Specifically, target logic commands can be determined among various business logic commands based on their relevance to the business execution process of the target business. These target logic commands can refer to non-process-oriented commands, i.e., commands not used to ensure the legitimacy of the business execution process. By randomly combining target logic commands, more test scenarios can be triggered without affecting the overall test logic.
[0116] It should be noted that the encapsulated business logic commands can include two categories: one is commands that ensure the legitimacy of the business execution process, which are not suitable for random shuffling and combination; the other is non-process-oriented commands (i.e. target logic commands), which can be randomly shuffled and combined.
[0117] Furthermore, in this application embodiment, a random algorithm is used to recombine each target logic command. In some examples, a random algorithm is called to recombine the target logic commands in the data set. If there are duplicates, they are not included in the target set. After multiple rounds of randomization, a complete set of random function sequences can be obtained. Each sequence in this set can reflect the actual business logic of the software under test.
[0118] In summary, this application uses a random algorithm to construct more comprehensive test cases. By randomly combining the encapsulated APIs, a test case set is obtained, and then the test is executed.
[0119] In one embodiment, the step of recombining the target logic commands using a random algorithm includes:
[0120] Based on the random seed of the current round of the random algorithm, the target logic commands are combined to generate the test case sequence for the current round, and the random seed of the current round is saved.
[0121] Specifically, a random seed can be obtained for each round using a random algorithm, and the target logic commands can be combined according to the random seed. This random seed can be used to generate different random numbers each time the random algorithm generates them, thereby shuffling the encapsulated commands and recombinating them based on the random numbers.
[0122] Furthermore, by saving the random seed for each randomization, the needs of reproducing test case sets can be met, ensuring that the results of each randomization are the same.
[0123] In one embodiment, the test case sequence is a test case file that carries the test cases in a text file; the test cases contain several timing logic commands; the timing logic commands include encapsulated commands for adjusting the execution timing and number of test cases.
[0124] Specifically, the test case sequence can be a test case file, using text to carry individual test cases. For example, each text file corresponds to a test case sequence (or a test case set), and each test case sequence (or test case set) contains multiple test cases. That is, in this application, the test case set can use a text file as the carrier of the test cases. Compared to using GTest to write test code, the test cases in this application are easier to manage, easier to extend, easier to improve, and have stronger reusability.
[0125] Furthermore, in addition to encapsulating the business code API according to a custom function prototype, this application embodiment also provides custom preset commands (for adjusting timing logic), that is, test cases contain several timing logic commands; optionally, each test case contains multiple timing logics, and each timing logic consists of encapsulated commands. For example, the custom preset commands for adjusting timing logic may include, but are not limited to, VOID WaitSignalA(); / VOID SendSignalA (UINT value); / VOID WaitMs(UINT value), etc.
[0126] In some examples, timing logic commands may include encapsulated commands for adjusting the execution timing and number of test cases. This application's embodiments not only test code functionality but also consider timing logic; by incorporating multiple timing logic sequences within test cases, it allows for the addition and execution of test cases without modifying the code itself, simply by writing and modifying test case files.
[0127] It should be noted that the embodiments of this application also provide a corresponding assertion mechanism. This assertion mechanism can adopt an assertion mechanism similar to GTest, thereby enabling test cases to correctly reflect test results during execution. In some examples, the assertion mechanism can use Assert for conditional judgment, allowing test cases to include checks on function return values.
[0128] In summary, this application analyzes the various business components of the software under test, identifies the main business processing logic, and encapsulates it using the provided function prototype template. This not only masks the logical differences between various business modules but also the differences between RTOS, Kernel, and FW code, truly achieving ease of management, easy expansion, easy improvement of the test case set, and strong reusability. By calling a randomization algorithm, the encapsulated business processing logic is recombined to obtain different test case sequences. The set of these sequences constitutes the test case set, which truly reflects the real-world business scenarios and is easy to expand and highly reusable.
[0129] To further illustrate the scheme of this application, a specific example is provided below, taking the software under test as multimedia software (MultiMedia) and the test framework as a multimedia testing framework (MMT) as an example, such as... Figure 5 As shown, the process of constructing a test case set for multimedia software (MultiMedia) may include:
[0130] Multimedia software's target functions can include Camera, Audio, Video, and Display. Different functions have significantly different internal processing logics. Before constructing a test case set, preprocessing can be performed to decouple these differences, facilitating the subsequent construction of the test case set.
[0131] For the preprocessing logic of the target business, please refer to... Figure 5 It is understood that this can be achieved through the Adaptation Layer in the Model Testing (MMT) framework. In this embodiment, the function template (function prototype template) can be used as the primary method for implementing the Adaptation Layer. Furthermore, the Adaptation Layer can have multiple construction methods (Adapt Types), such as Type A / Type B / Type C / Type D:
[0132] Type A / Type B: For driver code (TestTarget.ko), Wrapper.ko, and FW code (TestTarget.bin).
[0133] Type C / Type D: For dynamic library files (TestTarget.so)
[0134] In Type A, Type B, and Type C, the adaptation layer is compiled into a separate dynamic library. In Type D, the adaptation layer is compiled together with the code being tested. The essential difference between Type C and Type D lies in whether the business logic code is directly modified internally, and whether they are compiled into the same library file. Type C compiles into a separate library file without directly modifying the business logic code. Type D directly modifies the business logic code internally and compiles it together with the business logic code into the same library file.
[0135] For example, Type A could refer to encapsulating the driver code (TestTarget.ko) in the target business's public API, with the Adaptation layer itself being a separate dynamic library in this process. Type B could refer to encapsulating the code (Wrapper.ko / TestTarget.bin) in the target business's public API, with the Adaptation layer itself being a separate dynamic library in this process. Type C could refer to encapsulating the dynamic library file (TestTarget.so) in the target business's public API, with the Adaptation layer itself being a separate dynamic library in this process. Type D could refer to encapsulating the dynamic library file (TestTarget.so) in the target business's public API, with the Adaptation layer being compiled together with the code being tested (TestTarget.so) in this process.
[0136] By adding an Adaptation Layer, true decoupling can be achieved, covering not only the differences in multimedia services but also the differences in RTOS code, kernel code, and firewall code. The main task of the Adaptation Layer is to encapsulate the public API of the target service. Specifically, it breaks down the process from a business logic perspective, for example, the decoding process corresponds to DecodeFunction, without encapsulating other details. These processing logics are handled internally.
[0137] In addition to encapsulating business logic, function encapsulation can also be performed to ensure test logic, such as creating test instances, deregistering test instances, starting decoding, and deregistering decoding. For the encapsulation work performed by the Adaptation Layer, the function template (function prototype template) in this embodiment can serve as the primary method for implementing the Adaptation Layer. This not only shields the complexity of actual business API parameters but also enhances the usability of the testing framework.
[0138] Of the two types of functions encapsulated above, one type, ensuring test logic, is not the target of the randomization algorithm. The other type, representing business processing logic, is the target of the randomization algorithm. The specific working logic of the randomization algorithm can include: placing the encapsulated business logic commands into a data set, calling a random algorithm to recombine these data sets, excluding duplicates, and after multiple rounds of randomization, obtaining a complete set of random function sequences. Each sequence in this set reflects the actual business logic of the multimedia service operation; the set of these sequences constitutes the test case set. It should be noted that... Figure 5 In this context, "User" can refer to a user.
[0139] In summary, this application improves the test case set for the software under test, making the test case set more complete. Improving the test case set can accelerate the problem convergence cycle, shorten the software iteration delivery cycle, improve the testing efficiency of developers, and ensure the reliability of test results.
[0140] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0141] Based on the same inventive concept, this application also provides a test case set apparatus for implementing the test case set method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more test case set apparatus embodiments provided below can be found in the limitations of the test case set method described above, and will not be repeated here.
[0142] In one embodiment, such as Figure 6 As shown, a test case set apparatus is provided, comprising:
[0143] The business decoupling module 610 is used to decouple each target business in the software under test using a preset decoupling method to obtain several business logic commands. The preset decoupling method includes encapsulating the functional interfaces of the business components of the target business. The functional interfaces include common application programming interfaces related to the target functions.
[0144] The random combination module 620 is used to obtain a sequence of test cases by randomly combining various business logic commands;
[0145] The set determination module 630 is used to determine the set of test cases for the software under test based on the sequence of test cases.
[0146] In one embodiment, the device further includes:
[0147] The target business identification module is used to identify each target business in the software under test based on the business process.
[0148] The target function determination module is used to determine the target function based on business logic.
[0149] In one embodiment, the service decoupling module 610 includes:
[0150] The function level acquisition module is used to acquire the function level involved in the execution of the target function of the business component;
[0151] The interface encapsulation module is used to encapsulate functional interfaces belonging to the same functional level to obtain several business logic commands.
[0152] In one embodiment, the preset decoupling method includes encapsulating the functional interfaces of the business components of the target business using function templates; the test case set also includes test logic commands; the apparatus further includes:
[0153] The test function encapsulation module is used to encapsulate test functions using function templates to obtain test logic commands; wherein, the test functions include functions used to characterize the test logic for the software under test.
[0154] In one embodiment, the function template includes: a function prototype for encapsulating functional interfaces and test functions to obtain corresponding encapsulated data, and a function prototype for compiling the encapsulated data into a corresponding library file.
[0155] In one embodiment, the business decoupling module 610 is used to encapsulate the business code of the functional interface using corresponding preprocessing rules; the preprocessing rules are determined based on the code type to which the business code belongs and the software architecture level to which the business code belongs; the preprocessing rules include the definition of the compilation status of the function template during the business code encapsulation process.
[0156] In one embodiment, the code types include driver code and firmware code; the software architecture layers include a real-time operating system (RTOS) layer and a kernel layer.
[0157] The preprocessing rules include driver code for the kernel layer, kernel layer code that interacts with the real-time operating system (RTOS) layer, and firmware code for the RTOS layer, which are encapsulated using function templates whose compilation state is defined as independent dynamic libraries.
[0158] In one embodiment, the code type further includes a first dynamic library code and a second dynamic library code; the code modifiability attribute of the first dynamic library code is set to non-modifiability; the code modifiability attribute of the second dynamic library code is set to modifiability; the software architecture layer further includes a hardware abstraction layer (HAL).
[0159] The preprocessing rules also include encapsulating the first dynamic library code for the Hardware Abstraction Layer (HAL) using function templates defined as independent dynamic libraries in the compilation state.
[0160] The preprocessing rules also include encapsulating the second dynamic library code for the Hardware Abstraction Layer (HAL) using function templates defined as non-independent dynamic libraries in the compilation state; wherein, the function templates defined as non-independent dynamic libraries in the compilation state and the second dynamic library code belong to the same dynamic library file.
[0161] In one embodiment, the random combination module 620 includes:
[0162] The target command determination module is used to determine the target logic command among various business logic commands; the target logic command is unrelated to the business execution process of the target business.
[0163] The target command combination module is used to recombine the target logical commands using a random algorithm.
[0164] In one embodiment, the target command combination module is used to combine each target logic command according to the current round random seed of the random algorithm to generate a test case sequence for the current round, and save the current round random seed.
[0165] In one embodiment, the test case sequence is a test case file that carries the test cases in a text file; the test cases contain several timing logic commands; the timing logic commands include encapsulated commands for adjusting the execution timing and number of test cases.
[0166] Each module in the aforementioned test case set generation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0167] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a test case set generation method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0168] Those skilled in the art will understand that Figure 7The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0169] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the test case set method described above.
[0170] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the test case set method described above.
[0171] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the test case set method described above.
[0172] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0173] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0174] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for generating test case sets, characterized in that, The method includes: A pre-defined decoupling method is used to decouple each target service in the software under test, resulting in several business logic commands. The pre-defined decoupling method includes encapsulating the functional interfaces of the business components of the target services. The functional interfaces include common application programming interfaces related to the target functions. By randomly combining the aforementioned business logic commands, several test case sequences are obtained; Based on the sequence of test cases, a set of test cases for the software under test is determined; The step of decoupling each target service in the software under test using a preset decoupling method to obtain several business logic commands includes: Obtain the functional levels involved in the business component running the target function; The functional interfaces belonging to the same functional level are encapsulated to obtain several business logic commands; The preset decoupling method includes encapsulating the functional interfaces of the business components of the target business using function templates; the test case set also includes test logic commands; the method further includes: The test function is encapsulated using the function template to obtain the test logic command; wherein, the test function includes a function for characterizing the test logic for the software under test; The encapsulation of the functional interfaces of the business components of the target business using function templates includes: The business code of the functional interface is encapsulated using corresponding preprocessing rules; the preprocessing rules are determined based on the code type of the business code and the software architecture level to which the business code belongs; the preprocessing rules include the definition of the compilation status of the function template during the encapsulation process of the business code; The code types include driver code and firmware code; the software architecture layers include the real-time operating system (RTOS) layer and the kernel layer. The preprocessing rules include the driver code for the kernel layer, the kernel layer code that interacts with the real-time operating system (RTOS) layer, and the firmware code for the RTOS layer, which are encapsulated using function templates whose compilation status is defined as independent dynamic libraries; The code type also includes a first dynamic library code and a second dynamic library code; the code modifiability attribute of the first dynamic library code is set to non-modifiability; the code modifiability attribute of the second dynamic library code is set to modifiability; the software architecture layer also includes a Hardware Abstraction Layer (HAL). The preprocessing rules also include encapsulating the first dynamic library code of the Hardware Abstraction Layer (HAL) using the function template defined as an independent dynamic library in the compilation state. The preprocessing rules also include encapsulating the second dynamic library code of the Hardware Abstraction Layer (HAL) using the function template defined as a non-independent dynamic library in the compilation state; wherein the function template defined as a non-independent dynamic library in the compilation state and the second dynamic library code belong to the same dynamic library file.
2. The method according to claim 1, characterized in that, The method further includes: Based on the business process, each of the target businesses in the software under test is identified; Based on business logic, the target function is determined.
3. The method according to claim 1 or 2, characterized in that, The function template includes: a function prototype for encapsulating the functional interface and the test function to obtain the corresponding encapsulated data, and a function prototype for compiling the encapsulated data into a corresponding library file.
4. The method according to claim 1, characterized in that, The step of obtaining a sequence of test cases by randomly combining the various business logic commands includes: Identify the target logic command among the various business logic commands; wherein the target logic command is unrelated to the business execution flow of the target business. A random algorithm is used to recombine the target logic commands.
5. The method according to claim 4, characterized in that, The step of recombining the target logic commands using a random algorithm includes: Based on the current round random seed of the random algorithm, the target logic commands are combined to generate the test case sequence for this round, and the current round random seed is saved.
6. The method according to claim 1, 4, or 5, characterized in that, The test case sequence is a test case file that carries test cases in a text file; the test case contains several timing logic commands; the timing logic commands include encapsulated commands for adjusting the execution timing and number of test cases.
7. A test case set generation device, characterized in that, The device includes: A business decoupling module is used to decouple each target business in the software under test using a preset decoupling method to obtain several business logic commands. The preset decoupling method includes encapsulating the functional interfaces of the business components of the target business. The functional interfaces include common application programming interfaces related to the target function. The business decoupling module includes: a functional level acquisition module, used to acquire the functional levels involved in the business components running the target function; and an interface encapsulation module, used to encapsulate the functional interfaces belonging to the same functional level to obtain several business logic commands. The preset decoupling method includes encapsulating the functional interfaces of the business components of the target business using function templates; the test case set also includes test logic commands; the device further includes: a test function encapsulation module, used to encapsulate test functions using the function templates to obtain the test logic commands; wherein, the test functions include functions used to characterize the test logic for the software under test; The business decoupling module is used to encapsulate the business code of the functional interface using corresponding preprocessing rules; the preprocessing rules are determined based on the code type to which the business code belongs and the software architecture level to which the business code belongs; the preprocessing rules include the definition of the compilation status of the function template during the encapsulation process of the business code; The code types include driver code and firmware code; the software architecture layers include the real-time operating system (RTOS) layer and the kernel layer. The preprocessing rules include the driver code for the kernel layer, the kernel layer code that interacts with the real-time operating system (RTOS) layer, and the firmware code for the RTOS layer, which are encapsulated using function templates whose compilation status is defined as independent dynamic libraries; The code type also includes a first dynamic library code and a second dynamic library code; the code modifiability attribute of the first dynamic library code is set to non-modifiability; the code modifiability attribute of the second dynamic library code is set to modifiability; the software architecture layer also includes a Hardware Abstraction Layer (HAL). The preprocessing rules also include encapsulating the first dynamic library code of the Hardware Abstraction Layer (HAL) using the function template defined as an independent dynamic library in the compilation state. The preprocessing rules also include encapsulating the second dynamic library code of the Hardware Abstraction Layer (HAL) using the function template defined as a non-independent dynamic library in the compilation state; wherein the function template defined as a non-independent dynamic library in the compilation state and the second dynamic library code belong to the same dynamic library file; The random combination module is used to obtain a sequence of test cases by randomly combining the aforementioned business logic commands; The set determination module is used to determine the set of test cases for the software under test based on the sequence of test cases.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Command management method, system and device and computer readable storage medium
CN110187986A
Random test case generation method and device, electronic equipment and storage medium
CN112256572A
Cross-platform security service software construction method, device and equipment and storage medium
CN112394917A
