WO2017084462A1 - Method and system for generating automatic test case in automobile controller - Google Patents

Method and system for generating automatic test case in automobile controller Download PDF

Info

Publication number
WO2017084462A1
WO2017084462A1 PCT/CN2016/102400 CN2016102400W WO2017084462A1 WO 2017084462 A1 WO2017084462 A1 WO 2017084462A1 CN 2016102400 W CN2016102400 W CN 2016102400W WO 2017084462 A1 WO2017084462 A1 WO 2017084462A1
Authority
WO
WIPO (PCT)
Prior art keywords
name
test case
signal
replaced
mapping
Prior art date
Application number
PCT/CN2016/102400
Other languages
French (fr)
Chinese (zh)
Inventor
黄颍华
王可峰
魏跃远
代康伟
余军
Original Assignee
北京新能源汽车股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京新能源汽车股份有限公司 filed Critical 北京新能源汽车股份有限公司
Publication of WO2017084462A1 publication Critical patent/WO2017084462A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software

Definitions

  • the invention relates to the field of intelligent devices, and in particular relates to a method and a system for generating automatic test cases in an automobile controller.
  • test cases in the device that test the specific functional design of the application in the car controller.
  • a specific function design of an application requires writing a corresponding test case for testing. That is to say, in the network development and hardware development of the new platform, the existing test cases designed for the specific functions of the automotive controller application are difficult to use directly, thus resulting in poor reusability of the test cases.
  • the present invention aims to solve at least one of the technical problems in the related art to some extent. Accordingly, it is an object of the present invention to provide a method for generating an automatic test case in an automotive controller that can improve the legibility of the test case and enable the test case to be reused.
  • a second object of the present invention is to provide a generation system for an automatic test case in an automobile controller.
  • An embodiment of the first aspect of the present invention provides a method for generating an automatic test case in an automotive controller, comprising the steps of: generating an initial test case, wherein the initial test case includes a signal name and an assignment corresponding to the signal name a replacement rule between the transmission signal and the measurement signal, wherein the replacement rule includes a logical relationship consisting of the signal name, the assignment name, the mapping name, the relationship between the mapping names, and the assignment map name And replacing the initial test case according to the replacement rule to generate a final test case.
  • the method for generating an automatic test case in an automobile controller replaces an initial test case according to a replacement rule between a transmission signal and a measurement signal to generate a final test case, thereby improving readability of the test case. And can make the test case reuse.
  • the method for generating an automatic test case in the automobile controller according to the above embodiment of the present invention may further have the following additional technical features:
  • the replacing operation of the initial test case according to the replacement rule to generate a final test case specifically includes: determining a signal name to be replaced, and indexing the initial test case Determining a replacement signal name; determining whether the number of mapping names corresponding to the signal name to be replaced is equal to 1; if yes, replacing the signal name to be replaced in the initial test case with the mapping name, and The assignment name is replaced with the corresponding assignment map name to generate the final test case; if not, determining the relationship between the plurality of map names corresponding to the signal name to be replaced;
  • the plurality of mappings are named as a relationship, and each of the to-be-replaced signal names in the initial test case is replaced with a set of all mapping names, and the assignment name is replaced with the corresponding assignment mapping name to generate a a final test case; if the plurality of mappings are named as a relationship, generating a derivative file of the initial test case having the same number of the mapping names, and generating the derivative text
  • the signal is a language word used in the initial test case for expressing a signal, the assignment being named a particular one of the signal names in all of the initial test cases.
  • the relationship between the mapping names corresponding to the plurality of to-be-replaced signal names is all or equal, and the plurality of the to-be-replaced signal names are arranged and combined exhaustively. derivative.
  • the combination of exhaustive and exhaustive ideas is simple, and the programming and debugging are convenient.
  • the initial test case corresponds to the name and/or serial number of the final test case.
  • An embodiment of the second aspect of the present invention provides a system for generating an automatic test case in an automotive controller, comprising: a generating module for generating an initial test case, wherein the initial test case includes a signal name and the signal name Corresponding assignment name, an acquisition module, configured to acquire a replacement rule between the transmission signal and the measurement signal, where the replacement rule includes a relationship between the signal name, the assignment name, a mapping name, and a mapping name, and A logical relationship formed by the assignment map name; a replacement module, configured to perform a replacement operation on the initial test case according to the replacement rule to generate a final test case.
  • the automatic test case generation system in the automobile controller of the embodiment of the invention replaces the initial test case by the replacement module to generate a final test case, improves the readability of the test case, and enables the test case to be reused.
  • the generation system of the automatic test case in the automobile controller according to the above embodiment of the present invention may further have the following additional technical features:
  • the replacement module includes: an indexing module, configured to determine a signal name to be replaced, And determining, in the initial test case, the to-be-replaced signal name; the determining module, configured to determine whether the number of mapping names corresponding to the to-be-replaced signal name is equal to 1, and determining that the to-be-replaced signal name corresponds to a correlation between the plurality of mapping names; a processing module, configured to replace, when the number of mapping names corresponding to the signal name to be replaced is equal to 1, replace the signal name to be replaced in the initial test case The mapping name is replaced, and the assignment name is replaced with the corresponding assignment map name to generate the final test case.
  • the processing module is further configured to: when the number of mapping names corresponding to the signal name to be replaced is greater than 1, and the plurality of mappings are named Each test signal name to be replaced in the test case is replaced with a set of all map names, and the assignment name is replaced with the corresponding assignment map name to generate the final test case; and the signal name to be replaced corresponds to When the number of mapping names is greater than 1, and the plurality of mappings are named as a relationship, a derivative file of the initial test case having the same number of the mapping names is generated, and the The replacement signal name is replaced with the map name, and the assignment name is replaced with the corresponding assignment map name to obtain the final test case.
  • the signal is a language word used in the test case for expressing a signal
  • the assignment name refers to a specific one of the signal names involved in all of the test cases. The assignment name.
  • the relationship between the mapping names corresponding to the plurality of to-be-replaced signal names is all or equal, and the plurality of the to-be-replaced signal names are arranged and combined exhaustively. derivative.
  • the combination of exhaustive and exhaustive ideas is simple, and the programming and debugging are convenient.
  • the initial test case corresponds to the name and/or serial number of the final test case.
  • FIG. 1 is a flow chart of a method of generating an automatic test case in an automotive controller in accordance with one embodiment of the present invention
  • FIG. 2 is a flow diagram of a method of performing a replacement operation on an initial test case to generate a final test case in accordance with a replacement rule, in accordance with one embodiment of the present invention
  • FIG. 3 is a structural block diagram of a generation system of an automatic test case in an automobile controller according to an embodiment of the present invention
  • FIG. 4 is a block diagram showing the structure of a generation system for an automatic test case in an automobile controller according to an embodiment of the present invention.
  • FIG. 1 is a flow chart of a method of generating an automated test case in an automotive controller in accordance with one embodiment of the present invention.
  • the method for generating an automatic test case in the vehicle controller includes the following steps:
  • the initial test case includes a signal name and an assignment name corresponding to the signal name.
  • the transmission signal refers to all signals including the signal name in the initial test case
  • the measurement signal refers to all signals including the signal name in the test case applicable to a certain function test of the new software, wherein, the transmission signal There is a correspondence between the signal and the measurement signal.
  • the replacement rule includes a logical relationship consisting of a signal name, an assignment name, a mapping name, a relationship between mapping names, and an assignment map name.
  • the replacement rule can be expressed in a table, for example, it can be represented by Table 1:
  • the signal name is the language used to express the signal name used in the initial test case, that is, the Chinese name 1 in Table 1, which may be an accelerator pedal, a key, an engine failure, or the like.
  • Assignment name is a specific signal name In all the initial test cases involved in the assignment name, the assignment name can have any number, that is, the assignment value 1, assignment 2, assignment 3 in Table 1, three assignment names, can be oil fierce Step on, ON file, level 3 failure.
  • the mapping name must be a name recognizable by the test software.
  • One signal name can correspond to multiple mapping names. There are four mapping names in Table 1, namely, mapping name 1, mapping name 2, mapping name 3, and mapping name 4.
  • mapping names has or is expressed in two ways, and its role is to make multiple mapping names simultaneously Have the role of a certain signal name, or use the joint action of multiple mapping names to equal the role of the signal name.
  • the assignment map name must be a name that can be recognized by the initial test case. It can be a specific value, or a relational expression, or a curve, or even a complex function, that is, the map value shown in Table 1. 1. Map value 2, ..., map value 7.
  • the initial test case corresponds to the name and/or serial number of the final test case.
  • the replacement operation of the initial test case according to the replacement rule to generate the final test case includes the following steps:
  • S201 Determine a signal name to be replaced, and index the signal name to be replaced in the initial test case.
  • the signal name to be replaced may be the Chinese name 1 in Table 1.
  • mapping name 1 mapping value 1
  • mapping name 1 mapping value 2
  • mappings are named AND, replace each signal name to be replaced in the initial test case with a set of all mapping names, and replace the assignment name with the corresponding assignment mapping name to generate a final test case. .
  • mapping name 2 mapping value 4
  • mapping Name 3 mapping value 6
  • mapping name 4 mapping value 7 of the four sets
  • mappings are named as a relationship
  • generate a derivative file of the initial test case with the same number of mapping names replace the signal name to be replaced in the derived file with the mapping name, and replace the assignment name with the corresponding one. Assign a map name to get the final test case.
  • the relationship between the mapping names corresponding to the plurality of signal names to be replaced in the initial test case is all OR, the plurality of signal names to be replaced are arranged and combined exhaustively. Derived by the exhaustive method of permutation and combination, the idea is simple, and the programming and debugging are convenient.
  • the method for generating an automatic test case in an automobile controller replaces an initial test case according to a replacement rule between a transmission signal and a measurement signal to generate a final test case, thereby improving readability of the test case. And can make test cases reuse.
  • FIG. 3 is a block diagram showing the structure of a generation system of an automatic test case in an automobile controller according to an embodiment of the present invention.
  • the automatic test case generation system in the vehicle controller includes a generation module 10, an acquisition module 20, and a replacement module 30.
  • the generating module 10 is configured to generate an initial test case, where the initial test case includes a signal name and an assignment name corresponding to the signal name.
  • the obtaining module 20 is configured to obtain a replacement rule between the sending signal and the measurement signal, where the replacement rule includes a logical relationship consisting of a signal name, an assignment name, a mapping name, a relationship between the mapping names, and an assignment mapping name.
  • the replacement module 30 is configured to perform an alternate operation on the initial test case according to the replacement rule to generate a final test case.
  • the signal name is the language used to express the signal used in the test case, and the assignment name refers to the assignment name involved in a particular signal name in all test cases.
  • the initial test case corresponds to the name and/or serial number of the final test case.
  • the replacement module 30 includes an indexing module 31, a judging module 32, and a processing module 33.
  • the indexing module 31 is configured to determine a signal name to be replaced, and index the signal name to be replaced in the initial test case;
  • the determining module 32 is configured to determine whether the number of mapping names corresponding to the signal name to be replaced is equal to 1, and determine Replacing the relationship between the multiple mapping names corresponding to the signal name; when the number of the mapping names corresponding to the signal names to be replaced is equal to 1, the processing module 33 replaces the signal name to be replaced in the initial test case with the mapping name. Replace the assignment name with the corresponding assignment map name to generate the final test case.
  • the processing module 33 is further configured to: when the number of mapping names corresponding to the signal name to be replaced is greater than 1, and the relationship between the plurality of mapping names is AND, each of the initial test cases is to be replaced.
  • the signal name is replaced with a set of all mapping names, and the assignment name is replaced with the corresponding assignment map name to generate a final test case; and the number of mapping names corresponding to the signal name to be replaced is greater than 1, and multiple mapping names
  • the relationship is OR, the same number of initial names as the map name is generated. Start the test case's derived file, replace the signal name to be replaced in the derived file with the map name, and replace the assignment name with the corresponding assignment map name to get the final test case.
  • the plurality of signal names to be replaced are exhaustively derived. Derived by the exhaustive method of permutation and combination, the idea is simple, and the programming and debugging are convenient.
  • the generation system of the automatic test case in the automobile controller of the embodiment of the present invention is the same as the specific implementation method of the automatic test case in the automobile controller of the first aspect of the present invention, in order to reduce redundancy. I will not repeat them here.
  • the automatic test case generation system in the automobile controller of the embodiment of the invention replaces the initial test case by the replacement module to generate a final test case, improves the readability of the test case, and enables the test case to be reused.
  • first and second are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated.
  • features defining “first” or “second” may include at least one of the features, either explicitly or implicitly.
  • the meaning of "a plurality” is at least two, such as two, three, etc., unless specifically defined otherwise.
  • the terms “installation”, “connected”, “connected”, “fixed” and the like shall be understood broadly, and may be either a fixed connection or a detachable connection, unless explicitly stated and defined otherwise. , or integrated; can be mechanical or electrical connection; can be directly connected, or indirectly connected through an intermediate medium, can be the internal communication of two elements or the interaction of two elements, unless otherwise specified Limited.
  • the specific meanings of the above terms in the present invention can be understood on a case-by-case basis.
  • the first feature "on” or “under” the second feature may be a direct contact of the first and second features, or the first and second features may be indirectly through an intermediate medium, unless otherwise explicitly stated and defined. contact.
  • the first feature "above”, “above” and “above” the second feature may be that the first feature is directly above or above the second feature, or merely that the first feature level is higher than the second feature.
  • the first feature “below”, “below” and “below” the second feature may be that the first feature is directly below or obliquely below the second feature, or merely that the first feature level is less than the second feature.

Abstract

A method and system for generating an automatic test case in an automobile controller. The method comprises: generating an initial test case (S101), wherein the initial test case includes a signal name and an assignment name corresponding to the signal name; acquiring a replacement rule between a sending signal and a measurement signal (S102), wherein the replacement rule includes a logical relationship formed by a correlation between the signal name, the assignment name, a mapping name, and an assign mapping name; and performing a replacement operation on the initial test case according to the replacement rule to generate a final test case (S103). The method for generating an automatic test case in an automobile controller can improve the readability of the test case and enable the test case to be reused.

Description

汽车控制器中自动测试用例的生成方法和系统Method and system for generating automatic test cases in automobile controller 技术领域Technical field
本发明涉智能设备领域,具体涉及一种汽车控制器中自动测试用例的生成方法和系统。The invention relates to the field of intelligent devices, and in particular relates to a method and a system for generating automatic test cases in an automobile controller.
背景技术Background technique
随着汽车的不断普及,汽车的功能越来越多,汽车中的各种软件也越来越复杂,因此为了保证汽车的可靠性,对汽车中的控制系统进行测试是必不可少的汽车控制器中的测试用例,能够测试汽车控制器中应用程序的特定功能设计。一般情况下,应用程序的某一特定功能设计需要编写相应的测试用例进行测试。也就是说,在进行全新平台的网络开发以及硬件开发时,针对汽车控制器应用程序的特定功能设计的已有测试用例,很难直接使用,因此导致测试用例的可重复使用性较差。With the continuous popularization of automobiles, the functions of automobiles are increasing, and various softwares in automobiles are becoming more and more complicated. Therefore, in order to ensure the reliability of automobiles, it is essential to test the control system in automobiles. Test cases in the device that test the specific functional design of the application in the car controller. In general, a specific function design of an application requires writing a corresponding test case for testing. That is to say, in the network development and hardware development of the new platform, the existing test cases designed for the specific functions of the automotive controller application are difficult to use directly, thus resulting in poor reusability of the test cases.
另外,即使当全新平台的功能设计与之前的相似时,虽然无需更改自动测试用例的主体部分,但由于测试用例的信号名称、信号数量、赋值等会发生变化,从而导致必须重写相应部分的表达。并且在编写的自动测试用例时,一般需要填写网络接口或者硬线接口上的名称,而且测试用例中的信号名大都是英文名称,每个人的命名习惯又不相同,使得所编写的测试用例可读性非常差。从而导致了开发人员在解读测试用例表达的测试思路时,很难与具体的某个功能设计对应起来,使得开发人员无法检验测试人员的测试设计。In addition, even when the functional design of the new platform is similar to the previous one, although it is not necessary to change the main part of the automatic test case, the signal name, the number of signals, the assignment, etc. of the test case will change, resulting in the need to rewrite the corresponding part. expression. And when writing automatic test cases, it is generally necessary to fill in the name on the network interface or hard-wired interface, and the signal names in the test cases are mostly English names, and each person's naming habits are different, so that the test cases can be written. The reading is very poor. As a result, developers can hardly correlate with a specific functional design when interpreting the test ideas expressed by test cases, making it impossible for developers to verify the test design of testers.
发明内容Summary of the invention
本发明旨在至少在一定程度上解决相关技术中的技术问题之一。为此,本发明的一个目的在于提出一种汽车控制器中自动测试用例的生成方法,该方法能够提高测试用例的易读性,且能够使测试用例重复使用。The present invention aims to solve at least one of the technical problems in the related art to some extent. Accordingly, it is an object of the present invention to provide a method for generating an automatic test case in an automotive controller that can improve the legibility of the test case and enable the test case to be reused.
本发明的第二个目的在于提出一种汽车控制器中自动测试用例的生成系统。A second object of the present invention is to provide a generation system for an automatic test case in an automobile controller.
本发明第一方面的实施例提出了一种汽车控制器中自动测试用例的生成方法,包括以下步骤:生成初始测试用例,其中,所述初始测试用例包括信号名及所述信号名对应的赋值名;获取发送信号和测量信号之间的替换规则,其中,所述替换规则包括由所述信号名、所述赋值名、映射名、映射名之间的相互关系和赋值映射名所组成的逻辑关系;根据所述替换规则对所述初始测试用例进行替换操作以生成最终的测试用例。An embodiment of the first aspect of the present invention provides a method for generating an automatic test case in an automotive controller, comprising the steps of: generating an initial test case, wherein the initial test case includes a signal name and an assignment corresponding to the signal name a replacement rule between the transmission signal and the measurement signal, wherein the replacement rule includes a logical relationship consisting of the signal name, the assignment name, the mapping name, the relationship between the mapping names, and the assignment map name And replacing the initial test case according to the replacement rule to generate a final test case.
本发明实施例的汽车控制器中自动测试用例的生成方法,根据发送信号和测量信号之间的替换规则对初始测试用例进行替换操作,生成最终的测试用例,提高了测试用例的可读性,且能够使测试用例的重复使用。 The method for generating an automatic test case in an automobile controller according to an embodiment of the present invention replaces an initial test case according to a replacement rule between a transmission signal and a measurement signal to generate a final test case, thereby improving readability of the test case. And can make the test case reuse.
另外,根据本发明上述实施例的汽车控制器中自动测试用例的生成方法还可以具有如下附加的技术特征:In addition, the method for generating an automatic test case in the automobile controller according to the above embodiment of the present invention may further have the following additional technical features:
根据本发明的一个实施例,所述根据所述替换规则对所述初始测试用例进行替换操作以生成最终的测试用例,具体包括:确定待替换信号名,并在所述初始测试用例中索引所述待替换信号名;判断所述待替换信号名对应的映射名的个数是否等于1;若是,则将所述初始测试用例中所述待替换信号名替换为所述映射名,并将所述赋值名替换为对应的所述赋值映射名,以生成所述最终的测试用例;若否,则判断所述待替换信号名对应的多个所述映射名之间的相互关系;若所述多个映射名为与的关系,则将所述初始测试用例中每个待替换信号名替换为所有映射名的集合,并将所述赋值名替换为对应的所述赋值映射名,以生成所述最终的测试用例;若所述多个映射名为或的关系,则生成与所述映射名数量相同的所述初始测试用例的衍生文件,并将所述衍生文件中的待替换信号名替换为所述映射名,并将赋值名替换为对应的所述赋值映射名,以得到所述最终的测试用例。According to an embodiment of the present invention, the replacing operation of the initial test case according to the replacement rule to generate a final test case specifically includes: determining a signal name to be replaced, and indexing the initial test case Determining a replacement signal name; determining whether the number of mapping names corresponding to the signal name to be replaced is equal to 1; if yes, replacing the signal name to be replaced in the initial test case with the mapping name, and The assignment name is replaced with the corresponding assignment map name to generate the final test case; if not, determining the relationship between the plurality of map names corresponding to the signal name to be replaced; The plurality of mappings are named as a relationship, and each of the to-be-replaced signal names in the initial test case is replaced with a set of all mapping names, and the assignment name is replaced with the corresponding assignment mapping name to generate a a final test case; if the plurality of mappings are named as a relationship, generating a derivative file of the initial test case having the same number of the mapping names, and generating the derivative text The signal name to be replaced in the piece is replaced with the map name, and the assignment name is replaced with the corresponding assignment map name to obtain the final test case.
根据本发明的一个实施例,所述信号名为所述初始测试用例中使用过的用于表达信号的语言文字,所述赋值名为某一个特定所述信号名在所有所述初始测试用例中所涉及的赋值名。According to an embodiment of the invention, the signal is a language word used in the initial test case for expressing a signal, the assignment being named a particular one of the signal names in all of the initial test cases. The assignment name involved.
根据本发明的一个实施例,所述初始测试用例中多个所述待替换信号名所对应的映射名之间的相互关系均为或时,对多个所述待替换信号名进行排列组合穷举衍生。排列组合穷举衍生思路简单,程序编写和调试方便。According to an embodiment of the present invention, in the initial test case, the relationship between the mapping names corresponding to the plurality of to-be-replaced signal names is all or equal, and the plurality of the to-be-replaced signal names are arranged and combined exhaustively. derivative. The combination of exhaustive and exhaustive ideas is simple, and the programming and debugging are convenient.
根据本发明的一个实施例,所述初始测试用例与所述最终的测试用例的名称和/或序号相对应。According to an embodiment of the invention, the initial test case corresponds to the name and/or serial number of the final test case.
本发明第二方面的实施例提出了一种汽车控制器中自动测试用例的生成系统,包括:生成模块,用于生成初始测试用例,其中,所述初始测试用例包括信号名及所述信号名对应的赋值名;获取模块,用于获取发送信号和测量信号之间的替换规则,其中,所述替换规则包括由所述信号名、所述赋值名、映射名、映射名之间相互关系和赋值映射名所组成的逻辑关系;替换模块,用于根据所述替换规则对所述初始测试用例进行替换操作以生成最终的测试用例。An embodiment of the second aspect of the present invention provides a system for generating an automatic test case in an automotive controller, comprising: a generating module for generating an initial test case, wherein the initial test case includes a signal name and the signal name Corresponding assignment name, an acquisition module, configured to acquire a replacement rule between the transmission signal and the measurement signal, where the replacement rule includes a relationship between the signal name, the assignment name, a mapping name, and a mapping name, and A logical relationship formed by the assignment map name; a replacement module, configured to perform a replacement operation on the initial test case according to the replacement rule to generate a final test case.
本发明实施例的汽车控制器中自动测试用例的生成系统,通过替换模块对初始测试用例进行替换操作,生成最终的测试用例,提高了测试用例的可读性,且能够使测试用例重复使用。The automatic test case generation system in the automobile controller of the embodiment of the invention replaces the initial test case by the replacement module to generate a final test case, improves the readability of the test case, and enables the test case to be reused.
另外,根据本发明上述实施例的汽车控制器中自动测试用例的生成系统还可以具有如下附加的技术特征:In addition, the generation system of the automatic test case in the automobile controller according to the above embodiment of the present invention may further have the following additional technical features:
根据本发明的一个实施例,所述替换模块包括:索引模块,用于确定待替换信号名, 并在所述初始测试用例中索引所述待替换信号名;判断模块,用于判断所述待替换信号名对应的映射名中的个数是否等于1,以及判断所述待替换信号名对应的多个所述映射名之间的相互关系;处理模块,用于当所述待替换信号名对应的映射名中的个数等于1时,将所述初始测试用例中所述待替换信号名替换为所述映射名,并将所述赋值名替换为对应的所述赋值映射名,以生成所述最终的测试用例。According to an embodiment of the present invention, the replacement module includes: an indexing module, configured to determine a signal name to be replaced, And determining, in the initial test case, the to-be-replaced signal name; the determining module, configured to determine whether the number of mapping names corresponding to the to-be-replaced signal name is equal to 1, and determining that the to-be-replaced signal name corresponds to a correlation between the plurality of mapping names; a processing module, configured to replace, when the number of mapping names corresponding to the signal name to be replaced is equal to 1, replace the signal name to be replaced in the initial test case The mapping name is replaced, and the assignment name is replaced with the corresponding assignment map name to generate the final test case.
根据本发明的一个实施例,所述处理模块还用于:所述待替换信号名对应的映射名中的个数大于1,且所述多个映射名为与的关系时,将所述初始测试用例中每个待替换信号名替换为所有映射名的集合,并将所述赋值名替换为对应的所述赋值映射名,以生成所述最终的测试用例;以及所述待替换信号名对应的映射名中的个数大于1,且所述多个映射名为或的关系时,生成与所述映射名数量相同的所述初始测试用例的衍生文件,并将所述衍生文件中的待替换信号名替换为所述映射名,并将赋值名替换为对应的所述赋值映射名,以得到所述最终的测试用例。According to an embodiment of the present invention, the processing module is further configured to: when the number of mapping names corresponding to the signal name to be replaced is greater than 1, and the plurality of mappings are named Each test signal name to be replaced in the test case is replaced with a set of all map names, and the assignment name is replaced with the corresponding assignment map name to generate the final test case; and the signal name to be replaced corresponds to When the number of mapping names is greater than 1, and the plurality of mappings are named as a relationship, a derivative file of the initial test case having the same number of the mapping names is generated, and the The replacement signal name is replaced with the map name, and the assignment name is replaced with the corresponding assignment map name to obtain the final test case.
根据本发明的一个实施例,所述信号名为所述测试用例中使用过的用于表达信号的语言文字,所述赋值名指某一个特定所述信号名在所有所述测试用例中所涉及的赋值名。According to an embodiment of the invention, the signal is a language word used in the test case for expressing a signal, and the assignment name refers to a specific one of the signal names involved in all of the test cases. The assignment name.
根据本发明的一个实施例,所述初始测试用例中多个所述待替换信号名所对应的映射名之间的相互关系均为或时,对多个所述待替换信号名进行排列组合穷举衍生。排列组合穷举衍生思路简单,程序编写和调试方便。According to an embodiment of the present invention, in the initial test case, the relationship between the mapping names corresponding to the plurality of to-be-replaced signal names is all or equal, and the plurality of the to-be-replaced signal names are arranged and combined exhaustively. derivative. The combination of exhaustive and exhaustive ideas is simple, and the programming and debugging are convenient.
根据本发明的一个实施例,所述初始测试用例与所述最终的测试用例的名称和/或序号相对应。According to an embodiment of the invention, the initial test case corresponds to the name and/or serial number of the final test case.
附图说明DRAWINGS
本发明的上述和/或附加的方面和优点从结合下面附图对实施例的描述中将变得明显和容易理解,其中:The above and/or additional aspects and advantages of the present invention will become apparent and readily understood from
图1是根据本发明一个实施例的汽车控制器中自动测试用例的生成方法的流程图;1 is a flow chart of a method of generating an automatic test case in an automotive controller in accordance with one embodiment of the present invention;
图2是根据本发明一个实施例的根据替换规则对初始测试用例进行替换操作以生成最终的测试用例的方法的流程图;2 is a flow diagram of a method of performing a replacement operation on an initial test case to generate a final test case in accordance with a replacement rule, in accordance with one embodiment of the present invention;
图3是根据本发明一个实施例的汽车控制器中自动测试用例的生成系统的结构框图;3 is a structural block diagram of a generation system of an automatic test case in an automobile controller according to an embodiment of the present invention;
图4是根据本发明一个具体实施例的汽车控制器中自动测试用例的生成系统的结构框图。4 is a block diagram showing the structure of a generation system for an automatic test case in an automobile controller according to an embodiment of the present invention.
具体实施方式detailed description
下面详细描述本发明的实施例,所述实施例的示例在附图中示出,其中自始至终相同 或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,旨在用于解释本发明,而不能理解为对本发明的限制。Embodiments of the invention are described in detail below, examples of which are illustrated in the accompanying drawings in which the same Or similar reference numerals indicate the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the drawings are intended to be illustrative of the invention and are not to be construed as limiting.
下面参考附图描述本发明实施例的汽车控制器中自动测试用例的生成方法和系统。A method and system for generating an automatic test case in an automotive controller according to an embodiment of the present invention will be described below with reference to the accompanying drawings.
图1是根据本发明一个实施例的汽车控制器中自动测试用例的生成方法的流程图。1 is a flow chart of a method of generating an automated test case in an automotive controller in accordance with one embodiment of the present invention.
如图1所示,该汽车控制器中自动测试用例的生成方法包括以下步骤:As shown in FIG. 1, the method for generating an automatic test case in the vehicle controller includes the following steps:
S101,生成初始测试用例。S101. Generate an initial test case.
其中,初始测试用例包括信号名及信号名对应的赋值名。The initial test case includes a signal name and an assignment name corresponding to the signal name.
具体地,在编写初始测试用例时,可以直接使用易读的语言文字书写信号名及其赋值名,书写方式可以是“信号名=赋值名”,如油门踏板=猛踩、钥匙=ON档、发动机故障=3级故障、蓄电池电压=12V等,书写简单方便,且易读。Specifically, when writing the initial test case, the signal name and its assignment name can be directly written in an easy-to-read language, and the writing mode can be “signal name=assignment name”, such as accelerator pedal=slam, key=ON file, Engine failure = level 3 fault, battery voltage = 12V, etc., writing is simple and convenient, and easy to read.
S102,获取发送信号和测量信号之间的替换规则。S102. Acquire an replacement rule between the transmission signal and the measurement signal.
在本发明的实施例中,发送信号是指初始测试用例中的所有包含信号名的信号,测量信号是指可用于新软件某功能测试的测试用例中的所有包含信号名的信号,其中,发送信号和测量信号之间存在对应关系。替换规则包括由信号名、赋值名、映射名、映射名之间的相互关系和赋值映射名所组成的逻辑关系。该替换规则可以表格表示,例如可以用表1表示:In the embodiment of the present invention, the transmission signal refers to all signals including the signal name in the initial test case, and the measurement signal refers to all signals including the signal name in the test case applicable to a certain function test of the new software, wherein, the transmission signal There is a correspondence between the signal and the measurement signal. The replacement rule includes a logical relationship consisting of a signal name, an assignment name, a mapping name, a relationship between mapping names, and an assignment map name. The replacement rule can be expressed in a table, for example, it can be represented by Table 1:
表1Table 1
Figure PCTCN2016102400-appb-000001
Figure PCTCN2016102400-appb-000001
如表1所示,信号名为初始测试用例中使用过的用于表达信号名的语言文字,即表1中的中文名1,可以是油门踏板、钥匙、发动机故障等。赋值名为某一个特定信号名在所有初始测试用例中所涉及的赋值名,赋值名可以有任意多个,即表1中的赋值1、赋值2、赋值3三种赋值名,可以是油猛踩、ON档、3级故障。映射名必须是测试软件可识别的名称,一个信号名可以对应多个映射名,表1中有4个映射名,即映射名1、映射名2、映射名3、映射名4。映射名之间的相互关系有或和与两种表达,其作用是可使多个映射名同时 具备某一个信号名的作用,或者用多个映射名的联合作用来等价信号名的作用。赋值映射名必须是初始测试用例可识别的名称,可以是具体的数值,或是关系表达式,也可以是某条曲线,甚至也可以是某个复杂函数,即表1中示出的映射值1、映射值2、…、映射值7。As shown in Table 1, the signal name is the language used to express the signal name used in the initial test case, that is, the Chinese name 1 in Table 1, which may be an accelerator pedal, a key, an engine failure, or the like. Assignment name is a specific signal name In all the initial test cases involved in the assignment name, the assignment name can have any number, that is, the assignment value 1, assignment 2, assignment 3 in Table 1, three assignment names, can be oil fierce Step on, ON file, level 3 failure. The mapping name must be a name recognizable by the test software. One signal name can correspond to multiple mapping names. There are four mapping names in Table 1, namely, mapping name 1, mapping name 2, mapping name 3, and mapping name 4. The relationship between mapping names has or is expressed in two ways, and its role is to make multiple mapping names simultaneously Have the role of a certain signal name, or use the joint action of multiple mapping names to equal the role of the signal name. The assignment map name must be a name that can be recognized by the initial test case. It can be a specific value, or a relational expression, or a curve, or even a complex function, that is, the map value shown in Table 1. 1. Map value 2, ..., map value 7.
S103,根据替换规则对初始测试用例进行替换操作以生成最终的测试用例。S103. Perform an replacement operation on the initial test case according to the replacement rule to generate a final test case.
其中,初始测试用例与最终的测试用例的名称和/或序号相对应。Wherein, the initial test case corresponds to the name and/or serial number of the final test case.
具体地,如图2所示,根据替换规则对初始测试用例进行替换操作以生成最终的测试用例包括以下步骤:Specifically, as shown in FIG. 2, the replacement operation of the initial test case according to the replacement rule to generate the final test case includes the following steps:
S201,确定待替换信号名,并在初始测试用例中索引待替换信号名。S201: Determine a signal name to be replaced, and index the signal name to be replaced in the initial test case.
其中,待替换信号名可以是表1中的中文名1。The signal name to be replaced may be the Chinese name 1 in Table 1.
S202,判断待替换信号名对应的映射名的个数是否等于1。S202. Determine whether the number of mapping names corresponding to the signal name to be replaced is equal to 1.
S203,若是,则将初始测试用例中待替换信号名替换为映射名,并将赋值名替换为对应的赋值映射名,以生成最终的测试用例。S203. If yes, replace the signal name to be replaced in the initial test case with a mapping name, and replace the assignment name with a corresponding assignment mapping name to generate a final test case.
具体地,若映射名中的个数等于1,如表1所示,映射名中只有映射名1,则可以将中文名1替换为映射名1,将赋值名替换为对应的赋值映射名,即“中文名1=赋值1、中文名1=赋值2、中文名1=赋值3”将替换为:映射名1=映射值1、映射名1=映射值2、映射名1=映射值3。替换完成后结束,生成的最终的测试用例包含替换后的映射名及其对应的映射赋值名。Specifically, if the number of mapping names is equal to 1, as shown in Table 1, if only the mapping name is in the mapping name, the Chinese name 1 can be replaced with the mapping name 1, and the assignment name can be replaced with the corresponding assignment mapping name. That is, "Chinese name 1 = assignment 1, Chinese name 1 = assignment 2, Chinese name 1 = assignment 3" will be replaced by: mapping name 1 = mapping value 1, mapping name 1 = mapping value 2, mapping name 1 = mapping value 3 . After the replacement is completed, the generated final test case contains the replaced mapping name and its corresponding mapping assignment name.
S204,若否,则判断待替换信号名对应的多个映射名之间的相互关系。S204. If no, determine a mutual relationship between the plurality of mapping names corresponding to the signal name to be replaced.
S205,若多个映射名为与的关系,则将初始测试用例中每个待替换信号名替换为所有映射名的集合,并将赋值名替换为对应的赋值映射名,以生成最终的测试用例。S205. If multiple mappings are named AND, replace each signal name to be replaced in the initial test case with a set of all mapping names, and replace the assignment name with the corresponding assignment mapping name to generate a final test case. .
举例说明,如表1所示,若多个映射名之间的相互关系为与,则中文名1=赋值1将替换为:映射名1=映射值1、映射名2=映射值4、映射名3=映射值6、映射名4=映射值7这4个的集合;中文名1=赋值2将替换为:映射名1=映射值2、映射名2=映射值5、映射名3=赋值2、映射名4=赋值2这4个的集合;中文名1=赋值3将替换为,映射名1=映射值3、映射名2=赋值3、映射名3=赋值3、映射名4=赋值3这4个的集合。For example, as shown in Table 1, if the relationship between multiple mapping names is AND, the Chinese name 1 = assignment 1 will be replaced by: mapping name 1 = mapping value 1, mapping name 2 = mapping value 4, mapping Name 3 = mapping value 6, mapping name 4 = mapping value 7 of the four sets; Chinese name 1 = assignment 2 will be replaced by: mapping name 1 = mapping value 2, mapping name 2 = mapping value 5, mapping name 3 = Assignment 2, mapping name 4 = assignment 2 of the four sets; Chinese name 1 = assignment 3 will be replaced by, mapping name 1 = mapping value 3, mapping name 2 = assignment 3, mapping name 3 = assignment 3, mapping name 4 = Assign 3 to the collection of 4 of these.
S206,若多个映射名为或的关系,则生成与映射名数量相同的初始测试用例的衍生文件,并将衍生文件中的待替换信号名替换为映射名,并将赋值名替换为对应的赋值映射名,以得到最终的测试用例。S206. If multiple mappings are named as a relationship, generate a derivative file of the initial test case with the same number of mapping names, replace the signal name to be replaced in the derived file with the mapping name, and replace the assignment name with the corresponding one. Assign a map name to get the final test case.
举例说明,如表1所示,若多个映射名之间的相互关系为或,则会分别生成如下4个衍生测试用例:For example, as shown in Table 1, if the relationship between multiple mapping names is OR, the following four derivative test cases are generated:
第一个衍生用例,中文名1=赋值1替换为:映射名1=映射值1,中文名1=赋值2替换为:映射名1=映射值2,中文名1=赋值3替换为:映射名1=映射值3。 The first derivative use, Chinese name 1 = assignment 1 is replaced by: map name 1 = map value 1, Chinese name 1 = assignment 2 replaced with: map name 1 = map value 2, Chinese name 1 = assignment 3 replaced with: map Name 1 = mapped value 3.
第二个衍射用例,中文名1=赋值1替换为:映射名2=映射值4,中文名1=赋值2替换为:映射名2=映射值5,中文名1=赋值3替换为:映射名2=赋值3。The second diffraction use case, Chinese name 1 = assignment 1 is replaced by: map name 2 = map value 4, Chinese name 1 = assignment 2 replaced with: map name 2 = map value 5, Chinese name 1 = assignment 3 replaced with: map Name 2 = assignment 3.
第三个衍射用例,中文名1=赋值1替换为:映射名3=映射值6,中文名1=赋值2替换为:映射名3=赋值2,中文名1=赋值3替换为:映射名3=赋值3。The third diffraction use case, Chinese name 1 = assignment 1 is replaced by: map name 3 = map value 6, Chinese name 1 = assignment 2 replaced with: map name 3 = assignment 2, Chinese name 1 = assignment 3 replaced with: map name 3 = Assignment 3.
第四个衍射用例,中文名1=赋值1替换为:映射名4=映射值7,中文名1=赋值2替换为:映射名4=赋值2,中文名1=赋值3替换为:映射名4=赋值3。The fourth diffraction use case, Chinese name 1 = assignment 1 is replaced by: map name 4 = map value 7, Chinese name 1 = assignment 2 replaced with: map name 4 = assignment 2, Chinese name 1 = assignment 3 replaced with: map name 4= Assignment 3.
在本发明的实施例中,若初始测试用例中多个待替换信号名所对应的映射名之间的相互关系均为或时,对多个待替换信号名进行排列组合穷举衍生。采用排列组合穷举方法进行衍生,思路简单,且程序编写和调试方便。In the embodiment of the present invention, if the relationship between the mapping names corresponding to the plurality of signal names to be replaced in the initial test case is all OR, the plurality of signal names to be replaced are arranged and combined exhaustively. Derived by the exhaustive method of permutation and combination, the idea is simple, and the programming and debugging are convenient.
本发明实施例的汽车控制器中自动测试用例的生成方法,根据发送信号和测量信号之间的替换规则对初始测试用例进行替换操作,生成最终的测试用例,提高了测试用例的可读性,且能够使测试用例重复使用。The method for generating an automatic test case in an automobile controller according to an embodiment of the present invention replaces an initial test case according to a replacement rule between a transmission signal and a measurement signal to generate a final test case, thereby improving readability of the test case. And can make test cases reuse.
图3是根据本发明一个实施例的汽车控制器中自动测试用例的生成系统的结构框图。3 is a block diagram showing the structure of a generation system of an automatic test case in an automobile controller according to an embodiment of the present invention.
如图3所示,该汽车控制器中自动测试用例的生成系统包括:生成模块10、获取模块20和替换模块30。As shown in FIG. 3, the automatic test case generation system in the vehicle controller includes a generation module 10, an acquisition module 20, and a replacement module 30.
具体地,生成模块10用于生成初始测试用例,其中,初始测试用例包括信号名及信号名对应的赋值名。获取模块20用于获取发送信号和测量信号之间的替换规则,其中,替换规则包括由信号名、赋值名、映射名、映射名之间相互关系和赋值映射名所组成的逻辑关系。替换模块30用于根据替换规则对初始测试用例进行替换操作以生成最终的测试用例。Specifically, the generating module 10 is configured to generate an initial test case, where the initial test case includes a signal name and an assignment name corresponding to the signal name. The obtaining module 20 is configured to obtain a replacement rule between the sending signal and the measurement signal, where the replacement rule includes a logical relationship consisting of a signal name, an assignment name, a mapping name, a relationship between the mapping names, and an assignment mapping name. The replacement module 30 is configured to perform an alternate operation on the initial test case according to the replacement rule to generate a final test case.
其中,信号名为测试用例中使用过的用于表达信号的语言文字,赋值名指某一个特定信号名在所有测试用例中所涉及的赋值名。初始测试用例与最终的测试用例的名称和/或序号相对应。The signal name is the language used to express the signal used in the test case, and the assignment name refers to the assignment name involved in a particular signal name in all test cases. The initial test case corresponds to the name and/or serial number of the final test case.
在本发明的实施例中,替换模块30包括索引模块31、判断模块32和处理模块33。其中,索引模块31用于确定待替换信号名,并在初始测试用例中索引待替换信号名;判断模块32用于判断待替换信号名对应的映射名中的个数是否等于1,以及判断待替换信号名对应的多个映射名之间的相互关系;处理模块33用于待替换信号名对应的映射名中的个数等于1时,将初始测试用例中待替换信号名替换为映射名,并将赋值名替换为对应的赋值映射名,以生成最终的测试用例。In an embodiment of the invention, the replacement module 30 includes an indexing module 31, a judging module 32, and a processing module 33. The indexing module 31 is configured to determine a signal name to be replaced, and index the signal name to be replaced in the initial test case; the determining module 32 is configured to determine whether the number of mapping names corresponding to the signal name to be replaced is equal to 1, and determine Replacing the relationship between the multiple mapping names corresponding to the signal name; when the number of the mapping names corresponding to the signal names to be replaced is equal to 1, the processing module 33 replaces the signal name to be replaced in the initial test case with the mapping name. Replace the assignment name with the corresponding assignment map name to generate the final test case.
在本发明的实施例中,处理模块33还用于:待替换信号名对应的映射名中的个数大于1,且多个映射名为与的关系时,将初始测试用例中每个待替换信号名替换为所有映射名的集合,并将赋值名替换为对应的赋值映射名,以生成最终的测试用例;以及待替换信号名对应的映射名中的个数大于1,且多个映射名为或的关系时,生成与映射名数量相同的初 始测试用例的衍生文件,并将衍生文件中的待替换信号名替换为映射名,并将赋值名替换为对应的赋值映射名,以得到最终的测试用例。In the embodiment of the present invention, the processing module 33 is further configured to: when the number of mapping names corresponding to the signal name to be replaced is greater than 1, and the relationship between the plurality of mapping names is AND, each of the initial test cases is to be replaced. The signal name is replaced with a set of all mapping names, and the assignment name is replaced with the corresponding assignment map name to generate a final test case; and the number of mapping names corresponding to the signal name to be replaced is greater than 1, and multiple mapping names When the relationship is OR, the same number of initial names as the map name is generated. Start the test case's derived file, replace the signal name to be replaced in the derived file with the map name, and replace the assignment name with the corresponding assignment map name to get the final test case.
优选地,若初始测试用例中多个待替换信号名所对应的映射名之间的相互关系均为或时,对多个待替换信号名进行排列组合穷举衍生。采用排列组合穷举方法进行衍生,思路简单,且程序编写和调试方便。Preferably, if the relationship between the mapping names corresponding to the plurality of signal names to be replaced in the initial test case is or, the plurality of signal names to be replaced are exhaustively derived. Derived by the exhaustive method of permutation and combination, the idea is simple, and the programming and debugging are convenient.
需要说明的是,本发明实施例的汽车控制器中自动测试用例的生成系统与本发明第一方面实施例的汽车控制器中自动测试用例的生成方法的具体实施方式相同,为减少冗余,此处不做赘述。It should be noted that the generation system of the automatic test case in the automobile controller of the embodiment of the present invention is the same as the specific implementation method of the automatic test case in the automobile controller of the first aspect of the present invention, in order to reduce redundancy. I will not repeat them here.
本发明实施例的汽车控制器中自动测试用例的生成系统,通过替换模块对初始测试用例进行替换操作,生成最终的测试用例,提高了测试用例的可读性,且能够使测试用例重复使用。The automatic test case generation system in the automobile controller of the embodiment of the invention replaces the initial test case by the replacement module to generate a final test case, improves the readability of the test case, and enables the test case to be reused.
在本发明的描述中,需要理解的是,术语“中心”、“纵向”、“横向”、“长度”、“宽度”、“厚度”、“上”、“下”、“前”、“后”、“左”、“右”、“竖直”、“水平”、“顶”、“底”“内”、“外”、“顺时针”、“逆时针”、“轴向”、“径向”、“周向”等指示的方位或位置关系为基于附图所示的方位或位置关系,仅是为了便于描述本发明和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本发明的限制。In the description of the present invention, it is to be understood that the terms "center", "longitudinal", "transverse", "length", "width", "thickness", "upper", "lower", "front", " After, "Left", "Right", "Vertical", "Horizontal", "Top", "Bottom", "Inside", "Outside", "Clockwise", "Counterclockwise", "Axial", The orientation or positional relationship of the "radial", "circumferential" and the like is based on the orientation or positional relationship shown in the drawings, and is merely for convenience of description of the present invention and simplified description, and does not indicate or imply the indicated device or component. It must be constructed and operated in a particular orientation, and is not to be construed as limiting the invention.
此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。在本发明的描述中,“多个”的含义是至少两个,例如两个,三个等,除非另有明确具体的限定。Moreover, the terms "first" and "second" are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, features defining "first" or "second" may include at least one of the features, either explicitly or implicitly. In the description of the present invention, the meaning of "a plurality" is at least two, such as two, three, etc., unless specifically defined otherwise.
在本发明中,除非另有明确的规定和限定,术语“安装”、“相连”、“连接”、“固定”等术语应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或成一体;可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通或两个元件的相互作用关系,除非另有明确的限定。对于本领域的普通技术人员而言,可以根据具体情况理解上述术语在本发明中的具体含义。In the present invention, the terms "installation", "connected", "connected", "fixed" and the like shall be understood broadly, and may be either a fixed connection or a detachable connection, unless explicitly stated and defined otherwise. , or integrated; can be mechanical or electrical connection; can be directly connected, or indirectly connected through an intermediate medium, can be the internal communication of two elements or the interaction of two elements, unless otherwise specified Limited. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood on a case-by-case basis.
在本发明中,除非另有明确的规定和限定,第一特征在第二特征“上”或“下”可以是第一和第二特征直接接触,或第一和第二特征通过中间媒介间接接触。而且,第一特征在第二特征“之上”、“上方”和“上面”可是第一特征在第二特征正上方或斜上方,或仅仅表示第一特征水平高度高于第二特征。第一特征在第二特征“之下”、“下方”和“下面”可以是第一特征在第二特征正下方或斜下方,或仅仅表示第一特征水平高度小于第二特征。 In the present invention, the first feature "on" or "under" the second feature may be a direct contact of the first and second features, or the first and second features may be indirectly through an intermediate medium, unless otherwise explicitly stated and defined. contact. Moreover, the first feature "above", "above" and "above" the second feature may be that the first feature is directly above or above the second feature, or merely that the first feature level is higher than the second feature. The first feature "below", "below" and "below" the second feature may be that the first feature is directly below or obliquely below the second feature, or merely that the first feature level is less than the second feature.
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。In the description of the present specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" and the like means a specific feature described in connection with the embodiment or example. A structure, material or feature is included in at least one embodiment or example of the invention. In the present specification, the schematic representation of the above terms is not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. In addition, various embodiments or examples described in the specification, as well as features of various embodiments or examples, may be combined and combined.
尽管上面已经示出和描述了本发明的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本发明的限制,本领域的普通技术人员在本发明的范围内可以对上述实施例进行变化、修改、替换和变型。 Although the embodiments of the present invention have been shown and described, it is understood that the above-described embodiments are illustrative and are not to be construed as limiting the scope of the invention. The embodiments are subject to variations, modifications, substitutions and variations.

Claims (11)

  1. 一种汽车控制器中自动测试用例的生成方法,其特征在于,包括以下步骤:A method for generating an automatic test case in an automobile controller, comprising the steps of:
    生成初始测试用例,其中,所述初始测试用例包括信号名及所述信号名对应的赋值名;Generating an initial test case, wherein the initial test case includes a signal name and an assignment name corresponding to the signal name;
    获取发送信号和测量信号之间的替换规则,其中,所述替换规则包括由所述信号名、所述赋值名、映射名、映射名之间的相互关系和赋值映射名所组成的逻辑关系;Obtaining a replacement rule between the transmission signal and the measurement signal, wherein the replacement rule includes a logical relationship consisting of the signal name, the assignment name, the mapping name, the relationship between the mapping names, and the assignment map name;
    根据所述替换规则对所述初始测试用例进行替换操作以生成最终的测试用例。The initial test case is replaced in accordance with the replacement rule to generate a final test case.
  2. 如权利要求1所述的汽车控制器中自动测试用例的生成方法,其特征在于,所述根据所述替换规则对所述初始测试用例进行替换操作以生成最终的测试用例,具体包括:The method for generating an automatic test case in an automobile controller according to claim 1, wherein the replacing the initial test case according to the replacement rule to generate a final test case comprises:
    确定待替换信号名,并在所述初始测试用例中索引所述待替换信号名;Determining a signal name to be replaced, and indexing the signal name to be replaced in the initial test case;
    判断所述待替换信号名对应的映射名的个数是否等于1;Determining whether the number of mapping names corresponding to the signal name to be replaced is equal to 1;
    若是,则将所述初始测试用例中所述待替换信号名替换为所述映射名,并将所述赋值名替换为对应的所述赋值映射名,以生成所述最终的测试用例;If yes, replacing the to-be-replaced signal name in the initial test case with the mapping name, and replacing the assignment name with the corresponding assignment mapping name to generate the final test case;
    若否,则判断所述待替换信号名对应的多个所述映射名之间的相互关系;If not, determining a mutual relationship between the plurality of mapping names corresponding to the signal name to be replaced;
    若所述多个映射名为与的关系,则将所述初始测试用例中每个待替换信号名替换为所有映射名的集合,并将所述赋值名替换为对应的所述赋值映射名,以生成所述最终的测试用例;If the plurality of mappings are named as AND, replace each signal name to be replaced in the initial test case with a set of all mapping names, and replace the assignment name with the corresponding assignment mapping name. To generate the final test case;
    若所述多个映射名为或的关系,则生成与所述映射名数量相同的所述初始测试用例的衍生文件,并将所述衍生文件中的待替换信号名替换为所述映射名,并将赋值名替换为对应的所述赋值映射名,以得到所述最终的测试用例。If the plurality of mappings are named as a relationship, generating a derivative file of the initial test case with the same number of the mapping names, and replacing the to-be-replaced signal name in the derived file with the mapping name, The assignment name is replaced with the corresponding assignment map name to obtain the final test case.
  3. 如权利要求1所述的汽车控制器中自动测试用例的生成方法,其特征在于,所述信号名为所述初始测试用例中使用过的用于表达信号的语言文字,所述赋值名为某一个特定所述信号名在所有所述初始测试用例中所涉及的赋值名。The method for generating an automatic test case in an automotive controller according to claim 1, wherein the signal is a language word used to express a signal used in the initial test case, and the assignment is named The assignment name of a particular said signal name in all of said initial test cases.
  4. 如权利要求2所述的汽车控制器中自动测试用例的生成方法,其特征在于,所述初始测试用例中多个所述待替换信号名所对应的映射名之间的相互关系均为或时,对多个所述待替换信号名进行排列组合穷举衍生。The method for generating an automatic test case in an automobile controller according to claim 2, wherein in the initial test case, a relationship between a plurality of map names corresponding to the signal names to be replaced is a tempo, A plurality of the signal names to be replaced are arranged and combined exhaustively.
  5. 如权利要求1所述的汽车控制器中自动测试用例的生成方法,其特征在于,所述初始测试用例与所述最终的测试用例的名称和/或序号相对应。A method of generating an automatic test case in an automotive controller according to claim 1, wherein said initial test case corresponds to a name and/or a serial number of said final test case.
  6. 一种汽车控制器中自动测试用例的生成系统,其特征在于,包括:A system for generating an automatic test case in an automobile controller, comprising:
    生成模块,用于生成初始测试用例,其中,所述初始测试用例包括信号名及所述信号名对应的赋值名;Generating a module, configured to generate an initial test case, where the initial test case includes a signal name and an assignment name corresponding to the signal name;
    获取模块,用于获取发送信号和测量信号之间的替换规则,其中,所述替换规则包括 由所述信号名、所述赋值名、映射名、映射名之间相互关系和赋值映射名所组成的逻辑关系;An obtaining module, configured to acquire a replacement rule between the sending signal and the measurement signal, where the replacement rule includes a logical relationship consisting of the signal name, the assignment name, the mapping name, the relationship between the mapping names, and the assignment mapping name;
    替换模块,用于根据所述替换规则对所述初始测试用例进行替换操作以生成最终的测试用例。And a replacement module, configured to perform a replacement operation on the initial test case according to the replacement rule to generate a final test case.
  7. 如权利要求6所述的汽车控制器中自动测试用例的生成系统,其特征在于,所述替换模块包括:The system of claim 6, wherein the replacement module comprises:
    索引模块,用于确定待替换信号名,并在所述初始测试用例中索引所述待替换信号名;An indexing module, configured to determine a signal name to be replaced, and index the signal name to be replaced in the initial test case;
    判断模块,用于判断所述待替换信号名对应的映射名中的个数是否等于1,以及判断所述待替换信号名对应的多个所述映射名之间的相互关系;a determining module, configured to determine whether the number of mapping names corresponding to the signal name to be replaced is equal to 1, and determining a mutual relationship between the plurality of mapping names corresponding to the signal name to be replaced;
    处理模块,用于所述待替换信号名对应的映射名中的个数等于1时,将所述初始测试用例中所述待替换信号名替换为所述映射名,并将所述赋值名替换为对应的所述赋值映射名,以生成所述最终的测试用例。a processing module, when the number of mapping names corresponding to the signal name to be replaced is equal to 1, replacing the to-be-replaced signal name in the initial test case with the mapping name, and replacing the assignment name Assigning a map name to the corresponding one to generate the final test case.
  8. 如权利要求7所述的汽车控制器中自动测试用例的生成系统,其特征在于,所述处理模块还用于:The system for generating an automatic test case in an automobile controller according to claim 7, wherein the processing module is further configured to:
    所述待替换信号名对应的映射名中的个数大于1,且所述多个映射名为与的关系时,将所述初始测试用例中每个待替换信号名替换为所有映射名的集合,并将所述赋值名替换为对应的所述赋值映射名,以生成所述最终的测试用例;以及When the number of mapping names corresponding to the signal name to be replaced is greater than 1, and the relationship between the plurality of mapping names is AND, replace each signal name to be replaced in the initial test case with a set of all mapping names. And replacing the assignment name with the corresponding assignment map name to generate the final test case;
    所述待替换信号名对应的映射名中的个数大于1,且所述多个映射名为或的关系时,生成与所述映射名数量相同的所述初始测试用例的衍生文件,并将所述衍生文件中的待替换信号名替换为所述映射名,并将赋值名替换为对应的所述赋值映射名,以得到所述最终的测试用例。And when the number of mapping names corresponding to the signal name to be replaced is greater than 1, and the plurality of mappings are named or, generating a derivative file of the initial test case with the same number of the mapping names, and The signal name to be replaced in the derived file is replaced with the mapping name, and the assignment name is replaced with the corresponding assignment mapping name to obtain the final test case.
  9. 如权利要求6所述的汽车控制器中自动测试用例的生成系统,其特征在于,所述信号名为所述测试用例中使用过的用于表达信号的语言文字,所述赋值名指某一个特定所述信号名在所有所述测试用例中所涉及的赋值名。A system for generating an automatic test case in an automobile controller according to claim 6, wherein said signal is a language word used for expressing a signal used in said test case, and said assignment name is a certain one. The specific name of the signal name that is involved in all of the test cases.
  10. 如权利要求8所述的汽车控制器中自动测试用例的生成系统,其特征在于,所述初始测试用例中多个所述待替换信号名所对应的映射名之间的相互关系均为或时,对多个所述待替换信号名进行排列组合穷举衍生。The system for generating an automatic test case in an automobile controller according to claim 8, wherein in the initial test case, a relationship between a plurality of map names corresponding to the signal names to be replaced is a tempo, A plurality of the signal names to be replaced are arranged and combined exhaustively.
  11. 如权利要求7所述的汽车控制器中自动测试用例的生成系统,其特征在于,所述初始测试用例与所述最终的测试用例的名称和/或序号相对应。 A system for generating an automatic test case in an automotive controller according to claim 7, wherein said initial test case corresponds to a name and/or a serial number of said final test case.
PCT/CN2016/102400 2015-11-17 2016-10-18 Method and system for generating automatic test case in automobile controller WO2017084462A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510792418.5 2015-11-17
CN201510792418.5A CN105373476B (en) 2015-11-17 2015-11-17 The generation method and system of automatic test case in automobile controller

Publications (1)

Publication Number Publication Date
WO2017084462A1 true WO2017084462A1 (en) 2017-05-26

Family

ID=55375694

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/102400 WO2017084462A1 (en) 2015-11-17 2016-10-18 Method and system for generating automatic test case in automobile controller

Country Status (2)

Country Link
CN (1) CN105373476B (en)
WO (1) WO2017084462A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109669436A (en) * 2018-12-06 2019-04-23 广州小鹏汽车科技有限公司 A kind of method for generating test case and device of the functional requirement based on electric car

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105373476B (en) * 2015-11-17 2018-01-19 北京新能源汽车股份有限公司 The generation method and system of automatic test case in automobile controller
CN105955887B (en) * 2016-05-04 2018-10-19 重庆长安汽车股份有限公司 A kind of generation method and system of test data
CN106326125B (en) * 2016-08-26 2019-04-05 上海合福信息科技有限公司 A kind of method for generating test case
CN108490922B (en) * 2018-04-27 2020-03-24 北京新能源汽车股份有限公司 Generation method and device of unified diagnostic service test case
CN109088780B (en) * 2018-10-25 2021-11-12 北京新能源汽车股份有限公司 Signal detection method and detection device
CN110888803B (en) * 2019-11-08 2023-08-22 北京国家新能源汽车技术创新中心有限公司 Method and system for converting test decision table into test case
CN110928790B (en) * 2019-11-27 2024-02-02 中国银行股份有限公司 Test case construction method and device and test equipment
CN113267702A (en) * 2021-06-24 2021-08-17 广东电网有限责任公司 Method and device for generating test case of power distribution network fault self-healing system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110208501A1 (en) * 2010-02-25 2011-08-25 Gm Global Technology Operations, Inc. Functional test generation through model inversion
CN104035873A (en) * 2014-06-30 2014-09-10 青岛海信电器股份有限公司 Method and device for generating testing codes
CN104850111A (en) * 2014-10-16 2015-08-19 北汽福田汽车股份有限公司 Hardware-in-loop test method and system
CN105373476A (en) * 2015-11-17 2016-03-02 北京新能源汽车股份有限公司 Method and system for generating automatic test case in automobile controller

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110208501A1 (en) * 2010-02-25 2011-08-25 Gm Global Technology Operations, Inc. Functional test generation through model inversion
CN104035873A (en) * 2014-06-30 2014-09-10 青岛海信电器股份有限公司 Method and device for generating testing codes
CN104850111A (en) * 2014-10-16 2015-08-19 北汽福田汽车股份有限公司 Hardware-in-loop test method and system
CN105373476A (en) * 2015-11-17 2016-03-02 北京新能源汽车股份有限公司 Method and system for generating automatic test case in automobile controller

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109669436A (en) * 2018-12-06 2019-04-23 广州小鹏汽车科技有限公司 A kind of method for generating test case and device of the functional requirement based on electric car
CN109669436B (en) * 2018-12-06 2021-04-13 广州小鹏汽车科技有限公司 Test case generation method and device based on functional requirements of electric automobile

Also Published As

Publication number Publication date
CN105373476A (en) 2016-03-02
CN105373476B (en) 2018-01-19

Similar Documents

Publication Publication Date Title
WO2017084462A1 (en) Method and system for generating automatic test case in automobile controller
CN103197666A (en) General-type handheld automobile fault diagnostic instrument
CN104035867A (en) Android-based application function traverse test method
CN109726136A (en) Test method, device, equipment and the storage medium of database
CN105138461A (en) Interface testing method and device for application program
US11922741B2 (en) Secure installation of approved parts using blockchain
CN104965507A (en) Method used for generating open diagnostic data exchange database and device
US11099828B2 (en) Updating a metadata structure for a firmware update
SE1250017A1 (en) System and method for providing diagnostic error information based on content from two databases
CN109101604A (en) Vehicle brand knows method for distinguishing and vehicle brand identification device
CN111474923B (en) Vehicle diagnosis method, device and equipment
CN103164335B (en) The method and system of inspection unit test mass
US7684886B2 (en) Method and system for managing and validating product development
CN101673200B (en) The detection method of user input model and device
CN107729097B (en) Display page configuration method and corresponding equipment
CN103559296A (en) XML-based parsing method for SCPI (The Standard Commands for Programmable Instruments)
CN106933750B (en) Verification method and device for data and state in multi-level cache
CN103699682B (en) Method for verifying structural logics of databases
CN104504179A (en) Method of connection among CAE (computer aided engineering) based collision model assemblies
CN107169294A (en) The secondary judgement processing method of Excel forms in a kind of ATS for Environmental Test
CN109240872B (en) Statistical analysis method for coverage rate of chip verification key signals and storage medium
CN105203331A (en) Vehicle acceleration time test method and device
CN106021087A (en) Method and device for detecting code
EP3945416B1 (en) Software query information management system and software query information management method
CN114915643A (en) Configuration method, device, equipment and medium of railway signal centralized monitoring system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16865640

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16865640

Country of ref document: EP

Kind code of ref document: A1