Test case generation method and device, test method and electronic equipment
By detecting sub-requirement changes in the vehicle cockpit display function test requirements, updating the preset parameters in the database group, and generating test cases, the problem of low test case generation efficiency in the existing technology is solved, and a more efficient testing process is achieved.
Patent Information
- Application Number
- CN202411228780.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2025-01-24
AI Technical Summary
In the prior art, when conducting automated testing of vehicle cockpit display functions, the generation efficiency of test cases is low and requires a lot of manpower investment, especially when design logic optimization, system iteration and upgrade, and problem repair.
By detecting changes in sub-requirements in test requirements, determine the pre-associated display content of each changed sub-requirement, update the preset parameters in the corresponding database group, and generate test cases based on these parameters and the basic use case model.
It improves the test efficiency of the cockpit display function, reduces the difficulty of database maintenance, and ensures the accuracy and automation generation of test cases.
Smart Images

Figure CN119357045A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of testing technology, and in particular to a method and device for generating a test case, a testing method and electronic equipment. Background Art
[0002] With the continuous development of automobile technology, the functions supported by vehicles are becoming increasingly complex and diverse. In order to ensure the stability and reliability of the functions supported by the vehicle when it is actually running, a large number of automated tests are usually required for vehicle functions during the vehicle system development process and before the product leaves the factory.
[0003] Before the existing technology performs automated testing on functions such as vehicle cockpit display, testers usually need to spend a lot of effort to manually write test cases, resulting in low overall test efficiency. Especially when optimizing the design logic, iteratively upgrading the system, and fixing problems of the cockpit display function, it is necessary to rely on a lot of manpower input to repeatedly modify the massive manually written test cases to adapt to different test requirements, making it difficult to effectively improve the test efficiency of the vehicle cockpit display function. Summary of the invention
[0004] The problem solved by the present invention is how to effectively improve the test efficiency of the cockpit display function.
[0005] To solve the above problems, the present invention provides a method for generating a test case, comprising:
[0006] When it is detected that a sub-requirement in the acquired current test requirement has changed, the display content pre-associated with each sub-requirement after the change is determined to obtain the target display content;
[0007] updating at least part of the preset parameters in at least one database group corresponding to the target display content according to the changed sub-demand, wherein each of the database groups includes a display database and a trigger database, the display database includes at least one group of associated display content and environmental parameters; the trigger database includes at least one trigger parameter corresponding to each of the display contents, and the preset parameters include the display content, the environmental parameters and the trigger parameters;
[0008] Test cases are generated respectively based on the preset parameters in the database group corresponding to each display logic type and the pre-built basic use case model; wherein the display logic type corresponds one-to-one to the database group, and the basic use case model is built based on the parameter index corresponding to the preset parameters.
[0009] Optionally, before generating test cases based on the preset parameters in the database group corresponding to each display logic type and the pre-built basic use case model, the method further includes:
[0010] For each of the display logic types, obtaining at least one preset basic display logic corresponding to the display logic type;
[0011] For each of the basic display logics, the corresponding parameter index is matched for the basic display logic to obtain a basic use case corresponding to the basic display logic; wherein the parameter index corresponds to at least part of the preset parameters corresponding to the display logic type;
[0012] The basic use case model corresponding to the display logic type is obtained based on all the basic use cases.
[0013] Optionally, each of the basic display logics includes an operation template and a reference display template; the display content, the trigger parameter, and the environment parameter are each of at least one type; the parameter index includes a parameter type; and matching the basic display logic with the corresponding parameter index to obtain a basic use case corresponding to the basic display logic includes:
[0014] Extracting at least one parameter type corresponding to the environment parameter and at least one parameter type corresponding to the trigger parameter according to the operation template corresponding to the basic display logic, to obtain an environment parameter type and a trigger parameter type;
[0015] Extracting at least one parameter type corresponding to the display content according to the reference display template corresponding to the basic display logic to obtain a display content type;
[0016] The operation template is filled with the environmental parameter type and the trigger parameter type, and the reference display template is filled with the display content type, so as to obtain the basic use case corresponding to the basic display logic.
[0017] Optionally, the trigger database further includes a display content identifier corresponding to each of the trigger parameters, and the display content identifier is used to indicate the display content corresponding to the trigger parameter; and the test cases are generated based on the preset parameters in the database group corresponding to each display logic type and the pre-built basic use case model, respectively, including:
[0018] For each of the display logic types, a set of input variables is matched for each of the trigger parameters corresponding to the display logic type from the preset parameters corresponding to the display logic type using the display content identifier; wherein each set of input variables includes a trigger parameter, the display content corresponding to the trigger parameter, and the environment parameter corresponding to the display content;
[0019] The group of input variables is input into the basic use case model corresponding to the display logic type to obtain the test case.
[0020] Optionally, the input variables further include a display area and a requirement adaptation state corresponding to the display content; and the step of inputting the group of input variables into the basic use case model corresponding to the display logic type to obtain the test case includes:
[0021] When the requirement adaptation state in the input variable is a preset state, obtaining an adaptation area pre-associated with each basic use case in the corresponding basic use case model;
[0022] The group of input variables is input into at least one target basic case to generate at least one test case; wherein the target basic case includes the basic case corresponding to the adaptation area matching the display area in the group of input variables.
[0023] Optionally, before determining the display content pre-associated with each changed sub-requirement when detecting that a sub-requirement in the acquired current test requirement has changed, the method further includes:
[0024] Acquire a preset cockpit display function database; wherein the cockpit display function database includes the display content, the environmental parameters, and the display logic type pre-associated with each sub-requirement, and the display logic type includes at least one of instrument screen classical Chinese display, instrument screen image and sound display, and central control screen interactive display;
[0025] The cockpit display function database is divided into at least one display database based on the display logic type, and the trigger database corresponding to each display database is constructed to obtain the database group corresponding to each display logic type; wherein the trigger parameter in the trigger database is determined based on the display content.
[0026] In the present invention, each sub-requirement corresponds to a pre-associated display content. When a sub-requirement in the current test requirement changes, the display content corresponding to each changed sub-requirement is determined to obtain the target display content, which is conducive to providing an accurate reference basis for the update of the preset parameters in the subsequent database group. On this basis, the display database of the present invention includes at least one group of pre-associated display content and environmental parameters, and the trigger database includes at least one trigger parameter corresponding to each display content, which is equivalent to establishing an association between the preset parameters with the display content as a link. Therefore, when the sub-requirement in the test requirement changes, at least part of the preset parameters in at least one database corresponding to the target display content can be updated, which is conducive to reducing the difficulty of database maintenance and thus improving the test efficiency of the cockpit display function. In addition, in the present invention, the display logic type corresponds to the database group one by one, and based on the preset parameters in the database group corresponding to each display logic type and the pre-built basic use case model, test cases are generated respectively, which is conducive to ensuring the adaptability of the basic use case model and the preset parameters and improving the accuracy of the test case. Among them, the basic use case model is constructed based on the parameter index corresponding to the preset parameter, which is conducive to reflecting the common characteristics of the preset parameters corresponding to the same display logic type. In this way, in actual application, you only need to match the corresponding preset parameters based on the parameter index to achieve automatic generation of test cases corresponding to different display logic types, effectively improving the testing efficiency of the cockpit display function.
[0027] The present invention also provides a testing method, comprising:
[0028] Get the execution information corresponding to each preset test case;
[0029] A test result corresponding to each of the test cases is obtained based on the execution information; wherein the test case is obtained according to the test case generation method as described above.
[0030] The advantages of the test method provided by the present invention and the test case generation method compared with the prior art are basically the same, and will not be repeated here.
[0031] The present invention also provides a test case generation device, comprising:
[0032] A detection module, which is used to determine the display content pre-associated with each changed sub-requirement when detecting that a sub-requirement in the current test requirement that has been acquired has changed, and obtain the target display content;
[0033] An updating module, used to update at least part of the preset parameters in at least one database group corresponding to the target display content according to the changed sub-requirement, wherein each of the database groups includes a display database and a trigger database, and the display database includes at least one group of associated display content and environmental parameters; the trigger database includes at least one trigger parameter corresponding to each of the display contents, and the preset parameters include the display content, the environmental parameters and the trigger parameters; a generating module, used to generate test cases based on the preset parameters in the database group corresponding to each display logic type and a pre-built basic use case model; wherein the display logic type corresponds one-to-one to the database group, and the basic use case model is built based on the parameter index corresponding to the preset parameter.
[0034] The advantages of the test case generation device provided by the present invention and the test case generation method compared with the prior art are basically the same, and will not be repeated here.
[0035] The present invention also provides an electronic device, comprising a memory and a processor;
[0036] The memory is used to store computer programs;
[0037] The processor is used to implement the test case generation method as described above, or the testing method as described above, when executing the computer program.
[0038] The advantages of the electronic device provided by the present invention and the test case generation method or the test method compared with the prior art are basically the same and will not be repeated here.
[0039] The present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the test case generation method as described above, or the testing method as described above, is implemented.
[0040] The advantages of the computer-readable storage medium provided by the present invention and the test case generation method or the testing method compared with the prior art are basically the same and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 A schematic diagram of a flow chart corresponding to a method for generating a test case according to an embodiment of the present invention;
[0042] Figure 2 A schematic diagram of a flow chart corresponding to a testing method according to an embodiment of the present invention;
[0043] Figure 3 A schematic diagram of the structure corresponding to a device for generating a test case according to an embodiment of the present invention;
[0044] Figure 4 It is a schematic structural diagram corresponding to the electronic device of the embodiment of the present invention. DETAILED DESCRIPTION
[0045] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. Although certain embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be interpreted as being limited to the embodiments described herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments of the present invention are only for exemplary purposes and are not intended to limit the scope of protection of the present invention.
[0046] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.
[0047] The term "including" and its variations used in this document are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments"; the term "optionally" means "optional embodiments". Relevant definitions of other terms will be given in the following description. It should be noted that the concepts of "first", "second", etc. mentioned in the present invention are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0048] It should be noted that the modifications of "one" and "plurality" mentioned in the present invention are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0049] In view of the problems existing in the above-mentioned related technologies, this embodiment provides a method and device for generating a test case, a testing method and an electronic device.
[0050] like Figure 1 As shown, a method for generating a test case provided by an embodiment of the present invention includes:
[0051] S11: When it is detected that a sub-requirement in the acquired current test requirement changes, the display content pre-associated with each changed sub-requirement is determined to obtain target display content.
[0052] Specifically, the current test requirements referred to in this embodiment generally include multiple sub-requirements for testing various display functions supported by the vehicle cockpit, and each sub-requirement can be pre-associated with at least one display content. For the current test requirements before updating (such as the initial test requirements), one or more display contents corresponding to each sub-requirement in the initial test requirements can be obtained in combination with the preset design information of the cockpit display system. For example, for the engine stall fault alarm function, the corresponding display content may include classical Chinese display (such as the fault code or text prompt corresponding to the engine stall), and / or, light display (such as the warning light corresponding to the engine fault), and / or, image display (such as the fault icon corresponding to the engine stall), etc. Correspondingly, assuming that the sub-requirement of the engine stall fault alarm function in the current test requirement has changed (such as the trigger signal change or the notification classical Chinese change), the above display content can be used as the target display content.
[0053] In this embodiment, each sub-requirement corresponds to pre-associated display content. When one or more sub-requirements in the current test requirement change, the target display content can be obtained based on the display content pre-associated with the changed sub-requirement, which can provide a reference basis for updating the preset parameters in the subsequent database group, which is conducive to reducing the difficulty of database maintenance and thus improving testing efficiency.
[0054] S12: Update at least part of the preset parameters in at least one database group corresponding to the target display content according to the changed sub-demand, wherein each database group includes a display database and a trigger database, the display database includes at least one group of associated display content and environmental parameters; the trigger database includes at least one trigger parameter corresponding to each display content, and the preset parameters include display content, environmental parameters and trigger parameters.
[0055] Specifically, the display content referred to in this embodiment may include the display content corresponding to at least one display subject in the vehicle cockpit. For example, the classical Chinese or images displayed on the display screen (such as the instrument screen and the central control screen), the lights emitted by the lighting equipment, the sounds played by the playback device, etc. The environmental parameters referred to in this embodiment may include the operating environment required to realize the display function corresponding to the display content. For example, the environmental parameters may include vehicle configuration requirements, vehicle operation mode, user mode, etc. The trigger parameters referred to in this embodiment may represent the parameters that can trigger the display subject to present the display content under the corresponding environmental parameters, and may include a trigger signal and a trigger value corresponding to the trigger signal, etc. In this embodiment, when the corresponding display content is associated with each sub-requirement in advance, the environmental parameters and trigger parameters corresponding to each display content may also be determined at the same time, thereby obtaining the preset parameters in the database group. For example, for the sub-requirement corresponding to the test welcome function in the initial test requirement, the functional description corresponding to the welcome function can be obtained from the design information of the cockpit display system, such as: when the vehicle mode is detected to be the standby mode and the door state is the open state, the central control screen needs to play the preset welcome animation, or display the preset welcome classical Chinese. Among them, the vehicle mode is standby mode, which can correspond to environmental parameters, the door state is open, which can correspond to trigger parameters, and the central control screen displays a welcome animation or welcome text, which can correspond to display content. Among them, the preset parameters include display content, environmental parameters and trigger parameters, which cover all key parameters for testing the cockpit display function, which is conducive to providing an accurate and reliable data basis for the subsequent generation of test cases and improving the reliability of test cases.
[0056] In one embodiment, during the development of a vehicle system or when a test item is changed (such as when a test vehicle model is changed), due to differences in design logic or vehicle configuration, the sub-requirements in the test requirements usually need to change accordingly. In this embodiment, each database group includes a display database and a trigger database, the display database includes at least one group of associated display content and environmental parameters, and the trigger database includes at least one trigger parameter corresponding to each display content. This is equivalent to containing at least one group of preset parameters associated based on the display content in each database group. In this way, in this embodiment, when a sub-requirement change in the current test requirement is detected (such as when a text corresponding to at least one sub-requirement in the current test requirement document is detected to be different from the text corresponding to the sub-requirement in the initial test requirement document), the display content pre-associated with each changed sub-requirement can be determined to obtain the target display content (the display content pre-associated with each changed sub-requirement is used as the target display content), and then at least part of the preset parameters in at least one database corresponding to the target display content are updated, such as: the target display content in the database group, and / or, the environmental parameters corresponding to the target display content, and / or, the trigger parameters corresponding to the target display content are updated. For example, taking the change of the trigger parameters in the sub-requirement corresponding to the above-mentioned engine stall fault alarm function as an example, the display content A pre-associated with the sub-requirement can be used as the target display content, and the trigger parameters corresponding to the display content A in the database group containing the display content A can be updated based on the changed sub-requirement (such as replacing the original trigger parameters with the trigger parameters corresponding to the changed sub-requirement).
[0057] In one embodiment, for the vehicle cockpit display function, different trigger parameters may correspond to the same display content, and in this embodiment, the trigger database includes at least one trigger parameter corresponding to each display content in the display database, which is conducive to compatibility with scenarios where multiple different trigger parameters correspond to the same display content. For example, for the display content "door is not closed" in the display database, the trigger parameters pre-associated with the display content can be stored in the trigger database, and the trigger parameters corresponding to the display content in the trigger database can include one or more of "left front door is open", "right front door is open", "left rear door is open" or "right rear door is open".
[0058] It should be understood that the preset parameters in each database group in this embodiment include display content, environmental parameters and trigger parameters, which cover the key parameters for testing the cockpit display function. For example, the test case generated based on the database group of this embodiment can be used to describe that under certain environmental parameters (such as meeting the vehicle configuration requirements), when the trigger parameter (such as the preset trigger signal as the trigger value) is detected, the corresponding display content can be presented in the cockpit, which is conducive to providing an accurate and reliable data basis for the subsequent generation of test cases and improving the reliability of the test cases. On this basis, the trigger database in this embodiment includes at least one trigger parameter corresponding to each display content in the display database. Compared with the method of storing all display content, environmental parameters and trigger parameters in the same database, this embodiment reduces the data storage pressure while also facilitating independent maintenance for the characteristics of each type of data. For example, assuming that in the actual test process, the cockpit display function test of multiple models is involved, there are usually only some differences between different models in the trigger parameters corresponding to the display content. For this scenario, different models can share the same display database, and only need to independently maintain the trigger database corresponding to each model to meet the test case generation requirements of multiple models. In addition, for the scenario where the same display content corresponds to multiple trigger parameters, compared to the method of storing different preset parameters mixedly in the same database, the present embodiment independently stores at least one trigger parameter corresponding to each display content in the trigger database, which is beneficial to avoid a large amount of redundant homogeneous information in the database (such as for multiple groups of preset parameters in the database, the trigger parameters contained are different, but the display content and environmental parameters are the same). When the preset parameters are updated, it can also effectively reduce the workload required to maintain the database.
[0059] S13: Generate test cases based on preset parameters in the database group corresponding to each display logic type and a pre-built basic use case model; wherein the display logic type corresponds to the database group one by one, and the basic use case model is built based on the parameter index corresponding to the preset parameters.
[0060] Specifically, in this embodiment, the display logic type corresponds to the database group one by one, and the display logic type can be set in advance based on preset parameters. For example, before building the database group, the display content can be classified, and the display content supporting the same display logic can be stored in a database group, thereby obtaining a database group corresponding to each display logic type. Optionally, in this embodiment, the display logic can be classified based on the information type corresponding to the display content, such as the display logic type can include classical Chinese display (such as text and numbers, etc.), image display (such as static icons and dynamic images), sound display and light display, etc.
[0061] In one embodiment, a display logic type corresponds to a basic use case model, and the corresponding basic use case model can be constructed based on the parameter index corresponding to the preset parameter in the database group corresponding to the display logic type (such as the reference position or parameter type of the preset parameter, etc.). For example, the basic short display logic, constant display logic, and timeout display logic can be combined with the parameter index corresponding to the preset parameter in the database group to construct the basic use case model corresponding to the central control screen interactive display type. Assuming that the display logic type includes the central control screen interactive type, in the corresponding database group, the display content includes the page image corresponding to the application icon after it is started, the environmental parameters include the mode code corresponding to the vehicle mode, and the trigger parameter includes the trigger value corresponding to the capacitance value of the touch area. Then, the basic use case model corresponding to the display logic type can be constructed by combining the display logic supported by the display logic type and the parameter index corresponding to the preset parameter. Taking the display logic type supporting short display logic as an example, its logical language expression can be: when the vehicle mode is X1, after setting the capacitance value of the touch area to X2, the page image after the application icon is started should be X3. Among them, X1 represents the parameter index of the mode code corresponding to the vehicle mode, X2 represents the parameter index of the trigger value corresponding to the capacitance value of the touch area, and X3 represents the parameter index of the list image corresponding to the display list after the application icon is started. Therefore, in actual use, at least one set of preset parameters for driving the basic use case model can be matched from the database group based on the parameter index, and then at least one test case can be obtained. It should be understood that the logical language expression of the basic use case model can be converted into an automatically executable software program based on existing programming tools, thereby obtaining a test case that can be automatically executed by the test platform.
[0062] In this embodiment, each sub-requirement corresponds to a pre-associated display content. When a sub-requirement in the current test requirement changes, the display content corresponding to each changed sub-requirement is determined to obtain the target display content, which is conducive to providing an accurate reference basis for the update of the preset parameters in the subsequent database group. On this basis, the display database of this embodiment includes at least one group of pre-associated display content and environmental parameters, and the trigger database includes at least one trigger parameter corresponding to each display content, which is equivalent to establishing an association between the preset parameters with the display content as a link. Therefore, when the sub-requirement in the test requirement changes, at least part of the preset parameters in at least one database corresponding to the target display content can be updated, which is conducive to reducing the difficulty of database maintenance and thus improving the test efficiency of the cockpit display function. In addition, in this embodiment, the display logic type corresponds to the database group one by one. Based on the preset parameters in the database group corresponding to each display logic type and the pre-built basic use case model, test cases are generated respectively, which is conducive to ensuring the adaptability of the basic use case model and the preset parameters and improving the accuracy of the test case. Among them, the basic use case model is constructed based on the parameter index corresponding to the preset parameter, which is conducive to reflecting the common characteristics of the preset parameters corresponding to the same display logic type. In this way, in actual application, you only need to match the corresponding preset parameters based on the parameter index to achieve automatic generation of test cases corresponding to different display logic types, effectively improving the testing efficiency of the cockpit display function.
[0063] Optionally, before generating test cases respectively based on preset parameters in the database group corresponding to each display logic type and the pre-built basic use case model, the method further includes:
[0064] For each display logic type, obtaining at least one preset basic display logic corresponding to the display logic type;
[0065] For each basic display logic, a corresponding parameter index is matched to the basic display logic to obtain a basic use case corresponding to the basic display logic; wherein the parameter index corresponds to at least part of the preset parameters corresponding to the display logic type;
[0066] Based on all basic use cases, a basic use case model corresponding to the display logic type is obtained.
[0067] Specifically, each display logic type in the present embodiment corresponds to at least one preset basic display logic, and each basic display logic may correspond to a common characteristic of each preset parameter in the display logic type. For example, assuming that the display logic type is divided according to the information type of the display content, the display logic type may include a classical Chinese display type, an image display type, and an audio-visual display type. For the classical Chinese display type, its basic display logic may include: short display logic, regular display logic, and timeout display logic. It should be understood that the display content, environmental parameters, and trigger parameters for different basic display logics may be different. For example, assuming that the display logic type includes a classical Chinese display type, its basic display logic may include a short display logic and a timeout display logic. For the short display logic, it is usually only necessary to match the vehicle configuration requirements, vehicle mode, user mode, and other types in the environmental parameters corresponding to the display logic type, the trigger signal and trigger value, and other types in the trigger parameters, and the parameter index corresponding to the display classical Chinese and other types in the display content. For the timeout display logic, it may be necessary to obtain the parameter index corresponding to the timeout time in the trigger parameter on the basis of obtaining the parameter index required for the short display logic. After matching the parameter index corresponding to at least part of the preset parameters corresponding to the display logic type for the basic display logic, the basic use case corresponding to the basic display logic can be obtained according to the basic display logic and the parameter index. For example, the display logic type may include a classical Chinese display type, and the language description of the corresponding short display logic may be:
[0068] (1) Set the vehicle mode to normal mode and the user mode to the preset user mode;
[0069] (2) setting the preset trigger signal to the preset trigger value, and setting the preset trigger signal to the preset default value after 500ms;
[0070] (3) The displayed text is the preset displayed text corresponding to the preset trigger signal.
[0071] On this basis, preset parameters that match the specific content of the short display logic can be obtained from the database group corresponding to the classical Chinese display type. For example, in this embodiment, the data in the display database and the trigger database can exist in the form of a table, and each column in the table corresponds to the same preset parameter. Then, the corresponding preset parameters can be matched for the short display logic according to the actual meaning corresponding to each column parameter. Then, the parameter index corresponding to the preset parameter is combined with the short display logic to obtain the basic display use case. For example, based on similarity matching, parameters can be matched for short display logic: assuming that the second column of parameters in the display database is used to represent the user mode in the environmental parameters (such as user mode 1, user mode 2, etc.), its parameter index can be set to A2; the third column of parameters is used to represent the display language in the display content (such as radar failure, rearview camera failure, etc.), and its parameter index can be set to A3; the third column of parameters in the trigger database is used to represent the trigger signal in the trigger parameter (such as door status signal, communication status signal, etc.), and its parameter index can be set to B3; the fourth column of parameters in the trigger database is used to represent the trigger value of the trigger signal in the trigger parameter, and its parameter index can be set to B4; the fifth column of parameters in the trigger database is used to represent the default value of the trigger signal in the trigger parameter, and its parameter index can be set to B5. On this basis, the above parameter index can be used to replace the features with the same meaning in the short display logic, and then the basic use case corresponding to the short display logic can be obtained. The language description corresponding to the basic use case can be expressed as:
[0072] (1) Set the vehicle mode to normal mode and the user mode to A2 (i.e., the preset user mode);
[0073] (2) Set B3 (i.e., preset trigger signal) to B4 (i.e., preset trigger value), and after 500ms, set B3 (i.e., preset trigger signal) to B5 (i.e., preset default value);
[0074] (3) The displayed text is A3 (i.e., the preset display text) corresponding to B3 (i.e., the preset trigger signal).
[0075] In this way, by performing the above operation for each preset basic display logic, the basic use case corresponding to each basic display logic can be obtained, and by combining all the basic use cases corresponding to a display logic type, the basic use case model corresponding to the display logic type can be obtained.
[0076] In this embodiment, each display logic type corresponds to at least one preset basic display logic, and a basic display logic can correspond to a basic display test, which is equivalent to decomposing multiple complex test requirements corresponding to the same display logic type into multiple simple basic test requirements, which is conducive to improving the compatibility of basic use cases with preset parameters corresponding to display logic types. On this basis, the preset parameters involved in different basic display logics may be different. In this embodiment, the basic display logic matches the parameter index corresponding to at least part of the preset parameters corresponding to the display logic type to establish the association between the basic display logic and the required preset parameters, which is conducive to providing accurate data support for the generation of test cases. At the same time, in this embodiment, the basic use case is constructed based on the parameter index corresponding to the preset parameter, so that the basic use case can have good versatility when facing the preset parameters corresponding to the display logic type. It is equivalent to abstracting at least one common characteristic of the display logic corresponding to multiple display contents in a display logic type into a corresponding at least one basic use case, and then combining each basic use case belonging to the same display logic type to obtain the basic use case model corresponding to each display logic type. On the one hand, it is helpful to reduce the data volume and save computing power. On the other hand, when generating test cases based on preset parameters and basic use case models in the future, it can quickly and accurately match the basic use case model with the corresponding preset parameters, thereby ensuring the efficiency, reliability and accuracy of the cockpit display function test.
[0077] Optionally, each basic display logic includes an operation template and a reference display template; the parameter index includes a parameter type; the types of display content, trigger parameters and environment parameters are at least one; the basic display logic is matched with the corresponding parameter index to obtain a basic use case corresponding to the basic display logic, including:
[0078] Extracting at least one parameter type corresponding to the environment parameter and at least one parameter type corresponding to the trigger parameter according to the operation template corresponding to the basic display logic, and obtaining the environment parameter type and the trigger parameter type;
[0079] Extracting at least one parameter type corresponding to the display content according to the reference display template corresponding to the basic display logic to obtain the display content type;
[0080] The operation template is filled with the environment parameter type and the trigger parameter type, and the reference display template is filled with the display content type to obtain a basic use case corresponding to the basic display logic.
[0081] Specifically, in this embodiment, the types corresponding to the display parameters, environmental parameters and trigger parameters are at least one. Taking the front camera fault notification as an example, the corresponding environmental parameters may include vehicle mode, and / or user mode, etc.; the trigger parameters may include the front camera status, and / or the current temperature of the front camera, etc.; the display content may include notification text, and / or fault indicator light, etc. It should be understood that in this embodiment, the parameter index of the preset parameter may include the parameter type corresponding to the preset parameter, wherein the preset parameter may correspond to the actual parameter value, and the parameter type may correspond to the parameter name of the preset parameter. The basic display logic referred to in this embodiment includes an operation template and a reference display template. The operation template may represent the necessary operations required when testing a display function supported by the cockpit display system. Correspondingly, the reference display template may represent the expected display content after operating according to the above operation template. In this way, it is equivalent to simulating the user operation (i.e., the corresponding operation template) when actually using the vehicle, and the corresponding user perception content (i.e., the reference display template), which is conducive to accurately reflecting the performance of the cockpit display system during actual operation.
[0082] In this embodiment, at least one parameter type corresponding to the environment parameter and at least one parameter type corresponding to the trigger parameter can be extracted from the database group corresponding to the corresponding display logic type according to the operation template corresponding to the basic display logic, so as to obtain the environment parameter type and the trigger parameter type. Taking the extraction of the parameter type corresponding to the preset parameter from the display database according to the operation template as an example, in this embodiment, the display database can be constructed in the form of a table as shown in Table 1, and the trigger database can be constructed in the form of a table as shown in Table 2.
[0083] Table 1 shows the database
[0084]
[0085] Table 2 Trigger database
[0086]
[0087] Assume that the operation template includes: check whether the vehicle configuration meets (); set the vehicle operation mode to (), set the user-defined mode to (); set the preset trigger signal () to the preset trigger value (), and wait for the preset time (). Among them, () in the operation template is the content that needs to be filled with the corresponding parameter type.
[0088] On this basis, the parameter types corresponding to the preset parameters can be extracted from Table 1 and Table 2 respectively to fill the above operation template. For example, the parameter names involved in the operation template can be identified in advance by constructing regular expressions, pattern matching, or using large language models, and then the parameter types with the highest similarity can be selected from Table 1 and Table 2. Based on the parameter names involved in the above operation template, configuration requirements, vehicle mode and user mode can be extracted from Table 1 as environmental parameter types; trigger signals, trigger values and timeouts can be extracted from Table 2 as trigger parameter types, and then filled into the corresponding positions in the operation template. The filled operation template can be expressed as: check whether the vehicle configuration meets (configuration requirements); the vehicle operation mode is set to (vehicle mode), and the user-defined mode is set to (user mode); set the preset trigger signal (trigger signal) to the preset trigger value (trigger value), and wait for the preset time (timeout). Similarly, at least one display content type can be extracted to fill the reference display template, and then the basic use case corresponding to the basic display logic can be obtained.
[0089] In this embodiment, extracting the environmental parameter type and the trigger parameter type based on the operation template, and extracting the display content type based on the reference display template, is conducive to making full use of the characteristics of different types of parameters, ensuring the accuracy of extracting key information, and improving the reliability of the basic use case. On this basis, filling the operation template with the environmental parameter type and the trigger parameter type is conducive to accurately simulating the operations that the user needs to perform before triggering the corresponding display function; and filling the reference display template with the display content type is also conducive to accurately simulating the user's perceived experience (i.e., display content) brought to the user by the cockpit display system after performing specific operations when the user actually uses the vehicle, which is conducive to ensuring that the test cases generated corresponding to each subsequent basic use case can accurately, reliably and completely implement the test of the vehicle cockpit display function.
[0090] Optionally, the trigger database further includes a display content identifier corresponding to each trigger parameter, where the display content identifier is used to indicate the display content corresponding to the trigger parameter; based on preset parameters in the database group corresponding to each display logic type and a pre-built basic use case model, test cases are generated respectively, including:
[0091] For each display logic type, a set of input variables is matched for each trigger parameter corresponding to the display logic type from the preset parameters corresponding to the display logic type using the display content identifier; wherein each set of input variables includes a trigger parameter, display content corresponding to the trigger parameter, and environment parameters corresponding to the display content;
[0092] The group of input variables is input into the basic use case model corresponding to the display logic type to obtain a test case.
[0093] Specifically, in this embodiment, the trigger database also includes a display content identifier corresponding to each trigger parameter, and the display content identifier is used to indicate the display content corresponding to the trigger parameter. For example, assuming that the display database is as shown in Table 1 above, each row in Table 1 represents a group of interrelated display content and environmental parameters, and a unique display content identifier (such as a display number) can be set in advance for the display content in each group of parameters to indicate the corresponding display content. In this way, the trigger database does not need to store the detailed display content corresponding to each trigger parameter. It only needs to determine the specific display content associated with the trigger parameter based on the display content identifier, which is conducive to further reducing the data volume and improving the convenience of data maintenance.
[0094] Preferably, the display database may also include a display content identifier corresponding to each display content, which is conducive to rapid positioning. The display database corresponding to the above Table 1 may be optimized to the form of Table 3, and the trigger database corresponding to the above Table 2 may be optimized to the form of Table 4:
[0095] Table 3 shows the database
[0096]
[0097] Table 4 Trigger database
[0098]
[0099] In one embodiment, a basic use case model is equivalent to a collection of basic use cases corresponding to each common feature between each display content (i.e., each basic display logic supported) in a database group corresponding to a display logic type, and each basic use case is a common use case corresponding to each display content in the database group corresponding to the display logic type. Since each display content corresponds to at least one trigger parameter, for a database group, the corresponding display content and environmental parameters can be matched based on the display content identifier for each trigger parameter in the trigger database. That is, each row of trigger parameters in Table 4 above can be matched with a corresponding set of pre-associated display content and environmental parameters from Table 3 based on its corresponding display content identifier to obtain a set of input variables. For example, for the first row of trigger parameters in Table 4, the corresponding display content identifier is 1, then the corresponding display content (i.e., the first row of data in Table 3) is matched from Table 3 based on the display content identifier, and a set of input variables can be obtained by integrating the two.
[0100] Optionally, the input variables may be expressed in a tabular form as shown in Table 5 below:
[0101] Table 5 A set of input variables
[0102]
[0103] In one embodiment, the display content identifier can be used to quickly match a set of corresponding input variables for the trigger parameters from the display database and the trigger database. Each set of input variables includes a trigger parameter, the display content corresponding to the trigger parameter, and the environmental parameters corresponding to the display content, which covers the key parameters for driving each basic use case. Each set of input variables can correspond to each basic use case corresponding to the driving display logic type, and form a test case. In other words, assuming that the number of rows of the trigger parameters in Table 4 is N1, and the basic use case model corresponding to the display logic type contains N2 basic use cases, then theoretically N1×N2 test cases can be generated in the end.
[0104] In this embodiment, the display content identifier serves as a relationship link between the display content and the corresponding trigger parameter, and can quickly match a set of corresponding input variables for each trigger parameter, which is beneficial to improving the efficiency of test case generation while further reducing the data volume. At the same time, since the same display content may correspond to different trigger parameters, this embodiment uses each trigger parameter as the basis, and uses the display content identifier to match a set of corresponding input variables. While improving the comprehensiveness of the test case, it is also beneficial to avoid parameter omissions or parameter management confusion. On this basis, each set of input variables includes a trigger parameter, the display content corresponding to the trigger parameter, and the environmental parameters corresponding to the display content, which closely correspond to the trigger parameter type, display content type, and environmental parameter type that constitute each basic case, reducing the difficulty of generating test cases and ensuring the reliability of subsequent test case generation.
[0105] Optionally, the input variables also include a display area and a requirement adaptation state corresponding to the display content; the group of input variables is input into a basic use case model corresponding to the display logic type to obtain a test case, including:
[0106] When the requirement adaptation state in the input variable is a preset state, obtaining the adaptation area pre-associated with each basic use case in the corresponding basic use case model;
[0107] The group of input variables is input into at least one target basic case to generate at least one test case; wherein the target basic case includes a basic case corresponding to an adaptation area that matches a display area in the group of input variables.
[0108] Specifically, in this embodiment, the display content includes at least one parameter type, and the display area can represent the common display area corresponding to each parameter type. For example, the display area may include an instrument screen or a central control screen. Optionally, the display area may also represent a display area corresponding to any parameter type (such as a classical Chinese display area or an image display area). Furthermore, even for the same display screen, its different display areas often have different display functions, and the corresponding basic display logic may also have certain differences. For example, the display area of the instrument screen may include at least area A, area B, and area C. Among them, the display content in area A is generally a permanent display that requires interactive operation to disappear; the display content in area B is usually a short display that can disappear on its own after a period of time; the display content in area C can change with the vehicle operation information.
[0109] In this embodiment, the demand adaptation status corresponding to the display content can be set in advance according to the current test requirements, and the demand adaptation status can reflect whether the test vehicle or cockpit display system version corresponding to the current test requirements is adapted to the corresponding display content. For example: the demand adaptation status can include normal status and abnormal status. When the demand adaptation status is normal, it means that the display content is suitable for the current test requirements; when the demand adaptation status is abnormal, it means that the display content is not suitable for the current test requirements. In this embodiment, the preset state can be a normal state, which is conducive to avoiding meaningless consumption of computing power. In this way, when the corresponding form of the display database is in tabular form, the display database can be further optimized to the form of Table 6 below, and the corresponding set of input variables can be further optimized to the form of Table 7 below:
[0110] Table 6 shows the database
[0111]
[0112] Table 7 A set of input variables
[0113]
[0114]
[0115] In one embodiment, each basic use case can be pre-associated with a corresponding adaptation area. When constructing basic use cases based on basic display logic, the basic use cases corresponding to different display areas can be classified and set in advance, and each basic use case can be associated with its adapted display area (i.e., adaptation area). For example, assuming that the display logic type includes a classical Chinese display type, the corresponding basic use case model may include the following basic use cases: basic use case 1-A area, basic use case 2-A area, basic use case 3-A area, basic use case 4-B area, basic use case 5-B area, basic use case 6-C area, basic use case 7-C area, basic use case 8-C area. In the actual process of generating test cases, when the demand adaptation state in the input variables is the preset state, the adaptation area pre-associated with each basic use case in the corresponding basic use case model can be obtained, and the basic use case whose adaptation area matches the display area in the group of input variables can be used as the target basic use case, and the group of input variables can be input into the target basic use case.
[0116] Preferably, after determining the adaptation area corresponding to each basic use case, the basic use case can be divided into multiple basic use case groups based on the adaptation area, and the corresponding adaptation area is associated with each basic use case group. In this way, in actual use, it is only necessary to determine the target basic use case group to be adapted, and then the group of input variables can be input into each basic use case in the target basic use case group, further improving the efficiency of test case generation.
[0117] Now, taking Table 7 as an example of a set of input variables, the method of generating test cases is further introduced:
[0118] (1) Obtain the demand adaptation state in Table 7, and determine that the demand adaptation state of the group of input variables is a normal state, which is consistent with the preset state;
[0119] (2) obtaining the adaptation area pre-associated with each basic use case in the basic use case model of the display logic type corresponding to the group of input variables;
[0120] (3) Input this group of input variables into each basic use case whose adaptation area is area A to obtain the corresponding test case.
[0121] Assume that there is only one basic use case whose adaptation area is area A. The operation template of this basic use case is: check whether the configuration of the vehicle meets (configuration requirements); set the vehicle operation mode to (vehicle mode) and the user-defined mode to (user mode); set the preset trigger signal (trigger signal) to the preset trigger value (trigger value) and wait for the preset time (timeout time). The reference display template is: the content displayed in area A should be (classical Chinese display) and (accompanied by lights).
[0122] Then, based on the parameter types in the basic use case, the corresponding preset parameters can be matched from the group of input variables, and the parameter types in the basic use case can be replaced to obtain the test case. Correspondingly, the language description corresponding to the test case can be: check whether the vehicle configuration meets (configuration 1); set the vehicle operation mode to (mode 1), and set the user-defined mode to (mode A); set the preset trigger signal (signal 1) to the preset trigger value (3), and wait for the preset time (1000ms). The content displayed in area A should be (front view camera failure) and (light 1).
[0123] In this embodiment, the demand adaptation state can reflect whether the cockpit display system corresponding to the current test demand is adapted to the corresponding display content. When the demand adaptation state is the preset state, it can be considered that the basic conditions for generating test cases are met. On the one hand, it is beneficial to avoid generating test cases that are difficult to execute, resulting in a waste of computing power; on the other hand, when the current test demand changes, the adaptability of the current test demand and the display content may also change. At this time, only the demand adaptation state needs to be updated to quickly adapt to the new test demand. Especially in scenarios where the test content needs to be repeatedly changed, such as system iteration optimization and problem repair, it is more conducive to avoiding frequent major changes to the database group, thereby effectively reducing the maintenance workload of the database group. On this basis, each basic use case is pre-associated with the adaptation area, which is equivalent to further refining and classifying the basic display logic adapted to different display areas in the same display logic type. On this basis, based on the display area matching target basic use cases, and inputting the input variables into the corresponding target basic use cases, the corresponding test cases can be generated, further improving the adaptability of the test cases and the cockpit display function, which is conducive to ensuring the accuracy of the test results.
[0124] Optionally, when it is detected that a sub-requirement in the acquired current test requirement changes, before determining the display content pre-associated with each changed sub-requirement, the method further includes:
[0125] Obtaining a preset cockpit display function database; wherein the cockpit display function database includes display content, environmental parameters, and display logic types pre-associated with each sub-requirement, and the display logic type includes at least one of instrument screen classical Chinese display, instrument screen image and sound display, and central control screen interactive display;
[0126] The cockpit display function database is divided into at least one display database based on the display logic type, and a trigger database corresponding to each display database is constructed to obtain a database group corresponding to each display logic type; wherein the trigger parameters in the trigger database are determined based on the display content.
[0127] Specifically, in the testing phase after the functional design of the vehicle cockpit display system, it is usually necessary to sort out the corresponding test requirements based on the functions supported by the vehicle cockpit display system. The preset cockpit display function database referred to in this embodiment can be constructed based on multiple sub-databases. For example, the product design document, display theoretical effect document, display logic design document, etc. of the vehicle cockpit system, extract the parameters required for testing each function in the above sub-databases, and associate each parameter with the sub-requirements corresponding to the relevant functions to form a cockpit display function database. In this embodiment, the cockpit display function database includes the display content, environmental parameters and sub-requirements pre-associated with each sub-requirement, covering the key parameters for testing the function, which is conducive to providing a data basis for the subsequent construction of the display database. Preferably, the cockpit display function database in this embodiment can also include the test environment requirements associated with each display content (such as the required test platform) and special requirements such as notification priority, which is conducive to providing more comprehensive information for the generation of subsequent test cases.
[0128] In one embodiment, each group of parameters corresponding to each sub-requirement in the cockpit display function database can be analyzed to classify the display logic supported by multiple groups of parameters into different display logic types. For example, classification can be performed for different display subjects involved in the display content (such as instrument screen, central control screen), classification can be performed for specific parameter types of the display content (such as classical Chinese display, image display, sound display, light display light), classification can be performed based on the type of environmental parameters (such as whether there is an interactive operation), etc. In this embodiment, classification is performed for different display subjects, parameter types corresponding to different display contents, and types of environmental parameters. The display logic type can include at least one of the classical Chinese display of the instrument screen, the image and sound display of the instrument screen, and the interactive display of the central control screen. A variety of classification methods are flexibly combined to improve the reliability of classification.
[0129] Optionally, the display logic type in this embodiment may also include a general display type. The basic use case model corresponding to the display logic type may include basic use cases corresponding to mode switching display test, external signal display test, timeout mechanism display test, etc., and may support general display tests of classical Chinese, icons, etc. between different screens, thereby further improving the rationality of classification.
[0130] In one embodiment, after obtaining the cockpit display function database, the cockpit display function database can be divided into at least one display database based on the display logic type (e.g., at least one group of parameters with the same display logic type is integrated into one display database). On this basis, at least one trigger parameter corresponding to the display content in each group of parameters can be obtained, and then a trigger database corresponding to each display database can be obtained. For example, the product design document and communication database of the vehicle cockpit system can be obtained, and the corresponding trigger signal, as well as the trigger value and default value corresponding to the trigger signal, etc. can be matched for each display content.
[0131] In this embodiment, the cockpit display function database includes the display content, environmental parameters and display logic types pre-associated with each sub-requirement, providing comprehensive data support for the construction of the subsequent display content database. On this basis, the cockpit display function database is divided into at least one display database based on the display logic type, which is conducive to the classification management of different types of data. At the same time, by matching at least one trigger parameter for each display content to build a trigger database corresponding to each display database, it is conducive to ensuring the reliability of the trigger parameter, and then obtaining the database group corresponding to each display logic type, providing a reliable data basis for the automatic generation of subsequent test cases.
[0132] like Figure 2 As shown, this embodiment also provides a testing method, including:
[0133] S21: Obtain execution information corresponding to each preset test case;
[0134] S22: Obtaining a test result corresponding to each test case based on the execution information; wherein the test case is obtained according to the test case generation method as described above.
[0135] Specifically, the execution information referred to in this embodiment may represent the operation information obtained by the test platform during the process of testing the vehicle cockpit display system based on the test case. The execution information corresponding to each test case may be obtained based on the acquisition device, for example, the operation status of the light may be obtained based on the shooting device, and the specific display image or display text may be obtained based on the image recognition or text recognition device.
[0136] Preferably, before executing the test case, the calibration position corresponding to the above-mentioned acquisition device can also be determined based on the display area of the display content. The calibration position can be used to constrain the scope of obtaining execution information (such as the shooting range of the shooting device) to obtain more accurate execution information. When the test requirements change, if the display area changes, the calibration position can be adjusted in advance according to the display area corresponding to the display content in the test case. This is conducive to achieving compatibility with different test requirements.
[0137] In this embodiment, the test result of each test case can be obtained based on the execution information. For example, assuming that the execution information includes the acquired captured image, the text in the image can be extracted based on the text recognition device and used as the execution text. When the execution text is consistent with the display text corresponding to the reference display content in the test case, the test can be considered successful, otherwise a prompt message indicating that the test failed can be generated. On this basis, the test case in this embodiment is obtained based on the test case generation method as described above. While ensuring the reliability of the test results, whether it is facing the batch testing needs of the product or the decentralized testing needs in the product design iteration process, it does not need to rely on a large amount of manpower investment, which is conducive to effectively improving the test efficiency.
[0138] like Figure 3 As shown, a test case generation device 300 provided in an embodiment of the present invention includes:
[0139] A detection module 310, which is used to determine the display content pre-associated with each changed sub-requirement when detecting that a sub-requirement in the acquired current test requirement has changed, and obtain the target display content;
[0140] An updating module 320, which is used to update at least part of the preset parameters in at least one database group corresponding to the target display content according to the changed sub-demand, wherein each of the database groups includes a display database and a trigger database, the display database includes at least one group of associated display content and environmental parameters; the trigger database includes at least one trigger parameter corresponding to each of the display contents, and the preset parameters include the display content, the environmental parameters and the trigger parameters;
[0141] A generation module 330 is used to generate test cases based on the preset parameters in the database group corresponding to each display logic type and a pre-built basic use case model; wherein the display logic type corresponds one-to-one to the database group, and the basic use case model is constructed based on the parameter index corresponding to the preset parameters.
[0142] The technical effects that can be produced by the test case generation device and the test case generation method provided in this embodiment are basically the same, and will not be repeated here.
[0143] like Figure 4 As shown, an electronic device 400 provided by an embodiment of the present invention includes a memory 410 and a processor 420; the memory 410 is used to store a computer program; the processor 420 is used to implement the test case generation method as described above, or the test method as described above, when executing the computer program.
[0144] In other words, an electronic device 400 includes a memory 410 and a processor 420 coupled to the memory 410; the memory 410 is configured to store a computer program; and the processor 420 is configured to perform the following operations when executing the computer program:
[0145] When it is detected that a sub-requirement in the acquired current test requirement has changed, the display content pre-associated with each sub-requirement after the change is determined to obtain the target display content;
[0146] updating at least part of the preset parameters in at least one database group corresponding to the target display content according to the changed sub-demand, wherein each of the database groups includes a display database and a trigger database, the display database includes at least one group of associated display content and environmental parameters; the trigger database includes at least one trigger parameter corresponding to each of the display contents, and the preset parameters include the display content, the environmental parameters and the trigger parameters;
[0147] Test cases are generated respectively based on the preset parameters in the database group corresponding to each display logic type and the pre-built basic use case model; wherein the display logic type corresponds one-to-one to the database group, and the basic use case model is built based on the parameter index corresponding to the preset parameters.
[0148] The electronic device and the test case generation method provided in this embodiment can produce substantially the same technical effects, which will not be described in detail herein.
[0149] An electronic device 400 that can be used as a server or client of the present invention will now be described, which is an example of a hardware device that can be applied to various aspects of the present invention. The electronic device 400 is intended to represent various forms of digital electronic computer equipment, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device 400 can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples, and are not intended to limit the implementation of the present invention described and / or required herein.
[0150] The electronic device 400 includes a computing unit, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) or a computer program loaded from a storage unit into a random access memory (RAM). In the RAM, various programs and data required for the operation of the device can also be stored. The computing unit, ROM, and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.
[0151] An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the test case generation method described above, or the testing method described above, is implemented.
[0152] In other words, a non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor performs the following operations:
[0153] When it is detected that a sub-requirement in the acquired current test requirement has changed, the display content pre-associated with each sub-requirement after the change is determined to obtain the target display content;
[0154] updating at least part of the preset parameters in at least one database group corresponding to the target display content according to the changed sub-demand, wherein each of the database groups includes a display database and a trigger database, the display database includes at least one group of associated display content and environmental parameters; the trigger database includes at least one trigger parameter corresponding to each of the display contents, and the preset parameters include the display content, the environmental parameters and the trigger parameters;
[0155] Test cases are generated respectively based on the preset parameters in the database group corresponding to each display logic type and the pre-built basic use case model; wherein the display logic type corresponds one-to-one to the database group, and the basic use case model is built based on the parameter index corresponding to the preset parameters.
[0156] The computer-readable storage medium and the test case generation method provided in this embodiment can produce substantially the same technical effects, which will not be described in detail herein.
[0157] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc. In the present application, the unit described as a separate component may or may not be physically separated, and the component displayed as a unit may or may not be a physical unit, that is, it may be located in one place, or it may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment of the present invention. In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0158] Although the present invention is disclosed as above, the protection scope of the present invention is not limited thereto. Those skilled in the art may make various changes and modifications without departing from the spirit and scope of the present invention, and these changes and modifications will fall within the protection scope of the present invention.
Claims
1. A method for generating a test case, characterized in that: include: When it is detected that a sub-requirement in the acquired current test requirement has changed, the display content pre-associated with each sub-requirement after the change is determined to obtain the target display content; updating at least part of the preset parameters in at least one database group corresponding to the target display content according to the changed sub-demand, wherein each of the database groups includes a display database and a trigger database, the display database includes at least one group of associated display content and environmental parameters; the trigger database includes at least one trigger parameter corresponding to each of the display contents, and the preset parameters include the display content, the environmental parameters and the trigger parameters; Test cases are generated respectively based on the preset parameters in the database group corresponding to each display logic type and the pre-built basic use case model; wherein the display logic type corresponds one-to-one to the database group, and the basic use case model is built based on the parameter index corresponding to the preset parameters.
2. The method for generating a test case according to claim 1, characterized in that: Before generating test cases based on the preset parameters in the database group corresponding to each display logic type and the pre-built basic use case model, the method further includes: For each of the display logic types, obtaining at least one preset basic display logic corresponding to the display logic type; For each of the basic display logics, the corresponding parameter index is matched for the basic display logic to obtain a basic use case corresponding to the basic display logic; wherein the parameter index corresponds to at least part of the preset parameters corresponding to the display logic type; The basic use case model corresponding to the display logic type is obtained based on all the basic use cases.
3. The method for generating a test case according to claim 2, characterized in that: Each of the basic display logics includes an operation template and a reference display template; the display content, the trigger parameter and the environmental parameter are each of at least one type; the parameter index includes a parameter type; The matching of the parameter index corresponding to the basic display logic to obtain the basic use case corresponding to the basic display logic includes: Extracting at least one parameter type corresponding to the environment parameter and at least one parameter type corresponding to the trigger parameter according to the operation template corresponding to the basic display logic, to obtain an environment parameter type and a trigger parameter type; Extracting at least one parameter type corresponding to the display content according to the reference display template corresponding to the basic display logic to obtain a display content type; The operation template is filled with the environmental parameter type and the trigger parameter type, and the reference display template is filled with the display content type, so as to obtain the basic use case corresponding to the basic display logic.
4. The method for generating a test case according to claim 1, characterized in that: The trigger database further includes a display content identifier corresponding to each of the trigger parameters, and the display content identifier is used to indicate the display content corresponding to the trigger parameter; and the test cases are generated based on the preset parameters in the database group corresponding to each display logic type and the pre-built basic use case model, respectively, including: For each of the display logic types, a set of input variables is matched for each of the trigger parameters corresponding to the display logic type from the preset parameters corresponding to the display logic type using the display content identifier; wherein each set of input variables includes a trigger parameter, the display content corresponding to the trigger parameter, and the environment parameter corresponding to the display content; The group of input variables is input into the basic use case model corresponding to the display logic type to obtain the test case.
5. The method for generating a test case according to claim 4, characterized in that: The input variables also include a display area and a demand adaptation state corresponding to the display content; the step of inputting the group of input variables into the basic use case model corresponding to the display logic type to obtain the test case includes: When the requirement adaptation state in the input variable is a preset state, obtaining an adaptation area pre-associated with each basic use case in the corresponding basic use case model; The group of input variables is input into at least one target basic case to generate at least one test case; wherein the target basic case includes the basic case corresponding to the adaptation area matching the display area in the group of input variables.
6. The method for generating a test case according to any one of claims 1 to 5, characterized in that: Before determining the display content pre-associated with each changed sub-requirement when detecting that a sub-requirement in the acquired current test requirement has changed, the method further includes: Acquire a preset cockpit display function database; wherein the cockpit display function database includes the display content, the environmental parameters, and the display logic type pre-associated with each sub-requirement, and the display logic type includes at least one of instrument screen classical Chinese display, instrument screen image and sound display, and central control screen interactive display; The cockpit display function database is divided into at least one display database based on the display logic type, and the trigger database corresponding to each display database is constructed to obtain the database group corresponding to each display logic type; wherein the trigger parameter in the trigger database is determined based on the display content.
7. A testing method, characterized in that: include: Get the execution information corresponding to each preset test case; A test result corresponding to each of the test cases is obtained based on the execution information; wherein the test case is obtained according to the test case generation method according to any one of claims 1 to 6.
8. A test case generation device, characterized in that: include: A detection module, which is used to determine the display content pre-associated with each changed sub-requirement when detecting that a sub-requirement in the current test requirement that has been acquired has changed, and obtain the target display content; An updating module, which is used to update at least part of the preset parameters in at least one database group corresponding to the target display content according to the changed sub-demand, wherein each of the database groups includes a display database and a trigger database, the display database includes at least one group of associated display content and environmental parameters; the trigger database includes at least one trigger parameter corresponding to each of the display contents, and the preset parameters include the display content, the environmental parameters and the trigger parameters; A generation module, which is used to generate test cases based on the preset parameters in the database group corresponding to each display logic type and a pre-built basic use case model; wherein the display logic type corresponds one-to-one to the database group, and the basic use case model is constructed based on the parameter index corresponding to the preset parameters.
9. An electronic device, characterized in that: including memory and processor; The memory is used to store computer programs; The processor is used to implement the test case generation method according to any one of claims 1 to 6, or the test method according to claim 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the test case generation method according to any one of claims 1 to 6, or the test method according to claim 7 is implemented.