CN106681929A - Method and system for generating electric function test case - Google Patents
Method and system for generating electric function test case Download PDFInfo
- Publication number
- CN106681929A CN106681929A CN201710049676.3A CN201710049676A CN106681929A CN 106681929 A CN106681929 A CN 106681929A CN 201710049676 A CN201710049676 A CN 201710049676A CN 106681929 A CN106681929 A CN 106681929A
- Authority
- CN
- China
- Prior art keywords
- test
- case
- module
- test case
- template
- Prior art date
- Legal status (The legal status 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 status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Lock And Its Accessories (AREA)
Abstract
The invention discloses a method and system for generating electric function test case. The method comprises the steps of S1, selecting a test scope, S2, selecting a test case template, S3, setting test case parameters, and S4, generating a test case. The invention further provides a design system of the test case. The system comprises a test scope module, a test case template module, a parameter setting module and a test case generating module. The test scope module comprises three scopes which are actual vehicle function test, whole vehicle integrated function test and single system function test. The test case template module comprises five templates which are state transfer class, condition combination class, boundary value class, typical value class and custom class. The test case design method which is not reliant on the experience of a test engineer can guarantee the test coverage and test quality, and provide an effective solution and important basis for the design of the vehicle function test case.
Description
Technical field
The present invention relates to auto electric functional test field, more particularly to a kind of electric function method for test examples design and
System.
Background technology
At present, in automotive field functional test, electric function testing example design is passed without ripe theoretical foundation
System method for test examples design Main Basiss technological document, the experience by Test Engineer is designed, due to each test
The experience of engineer is different, and the test case of design has different degrees of otherness, it is understood that there may be coverage is low and reduces survey
The risk of quality is tried, there is the hidden danger of function and secure context so as to cause car electrics.
Automobile function testing field is not, it is necessary to one kind causes test case to have differences because of Test Engineer's experience difference
Property method for test examples design, ensure that Test coverage degree and test quality, so ensure car electrics feature and
Security.
The content of the invention
It is an object of the invention to provide a kind of electric function method for test examples design and system, it can solve the problem that above-mentioned biography
A kind of shortcoming of system method for test examples design, there is provided method for test examples design for not relying on Test Engineer's experience, protects
Card Test coverage degree and test quality, for automobile function Test Sample Design provides effective solution and important evidence.
The present invention uses following technical scheme:
A kind of electric function method for generating test case, including following steps:
Step 101:Test request selection correspondence test category in technological document;
Step 102:According to the form of function policy in test category, test case template is selected;
Step 103:Test case parameter is set according to selected test case template;
Step 104:Test case is generated according to established rule.
The test category includes:Real vehicle functional test category, vehicle integrated functionality test category and single system function are surveyed
Examination category.
Test case template includes:State transfer class use-case template, conditional combination class use-case template, boundary value class use-case mould
Plate, representative value class use-case template and self defined class use-case template;
Wherein, the state transfer class template is designed according to the strategy of state transition diagram;Conditional combination class template is root
The strategy for producing a result according to many condition is designed;Boundary value class template is designed according to critical point strategy;Typical case
Value class template is designed according to selection random value and representative value strategy in value range;Self defined class can be according to User Defined
It is designed, function policy does not carry out self-defined setting in above-mentioned four class template.
A kind of electric function Test cases technology system, including:
Line module is created, new user, typing user profile are created for administrator right user;
Authorized user's log-in module, for changing the user profile in addition to user right;
Use-case module is write, is connected with higher level user's auditing module and importing use-case library module, including:
Test category module, for selecting test category, corresponding test category is selected according to test request, for follow-up use
Example library management search;
Test case template module, including multiple test case templates, for supplying difference in functionality policy selection;
Parameter setting module, writes for improving test case, and after test case template is selected, parameter setting module has been responsible for
It is apt to the corresponding parameter of the test case template;
Test cases technology module, for Test cases technology, according to selected test case template and the parameter for setting, presses
Test case is generated according to established rule;
Higher level user's auditing module, is connected with use-case module is write, and is responsible for the test case that check and correction and examination & verification are submitted to, and detection is patrolled
Mistake or clerical error are collected, judges whether to pass through, audited if next higher level user is carried out if, returned if not passing through
Return and write use-case, write again or change;
Use-case library module is imported, for use-case storehouse will to be imported by the test case of check and correction and examination & verification, is easy to case management;
Use-case database management module, is connected, with use-case library module is imported for realizing use-case library management function.
The user profile includes:Job number, name, initial password, identification card number, hiring date, user right, post.
Higher level user's auditing module includes multiple, and multiple higher level user's auditing modules are realized auditing step by step.
The function of the use-case database management module includes:Function of search, screening function, replacement function and deletion function.
The positive effect of the present invention is:It can be overcome because Test Engineer's experience difference causes test case to there is covering
Low and test quality difference the risk of degree, the present invention provides the design that five kinds of test case templates realize all functional test use-cases,
To ensure the coverage and uniformity of test case, for automobile function Test Sample Design provides effective solution and important
Foundation.
Brief description of the drawings
Fig. 1 is the flow chart of electric function method for test examples design.
Fig. 2 is electric function Test Sample Design system block diagram.
Fig. 3 is that state shifts class template schematic diagram.
Fig. 4 is the flow chart of electric function Test Sample Design system.
Specific embodiment
The invention will be further described with reference to the accompanying drawings and examples:
A kind of specific Test Sample Design step of electric function method for generating test case of the present invention is as follows:According to technology text
Part, selection test category;After having selected test category, according to the form of function policy, test case template is selected, then set
Parameter, test case is generated by Test cases technology module, and wherein state transfer class template is according to state transition diagram principle
It is designed, herein with state A, state B, state C, condition A-1, condition B-1, condition C -1, condition A-2, condition B-2, condition
As a example by C-2, system will automatically generate test case:1. state A, by condition B-1, into state B, 2. state B, by condition
C-1, into state C, 3. state C, by condition A-1, into state A, 4. state B, by condition A-2, into state A, 5.
State C, by B-2, into state B, 6. state A, by condition C -2, into state C, during arrange parameter by parameter A, B, C,
A-1, B-1, C-1, A-2, B-2, C-2 are set to specific state and condition;Conditional combination class template is produced according to many condition
The principle of one result is designed, and as a example by meeting tri- conditions of D1, D2, D3 simultaneously and cause result E, corresponding condition is filled out
Correspondence parameter position is written to, system will automatically generate test case:1. D1, D2, D3 meet simultaneously, as a result E, 2. non-D1, D2, D3
Meet simultaneously, as a result non-E, 3. D1, non-D2, D3 meet simultaneously, as a result non-E, 4. D1, D2, non-D3 meet simultaneously, as a result non-E, if
Parameter D1, D2, D3, E are set to specific condition and result when putting parameter;Boundary value class template is entered according to critical point strategy
Row design, when variable F is more than or equal to J limit values as a example by result K, corresponding numerical value minimum resolution L is filled in correspondence parameter
Position, system will automatically generate test case:1. result K when variable F is equal to J limit values, result when 2. variable F is equal to J+L limit values
K, result non-K when 3. variable F is equal to J-L limit values, specific variable, limit value, knot are set to during arrange parameter by parameter F, J, K, L
Fruit and minimum resolution;Representative value class template is designed according to selection random value and representative value in value range, is taken with variable M
When value scope is less than N2 more than N1 as a example by result O, corresponding numerical value is filled in correspondence parameter position, system will automatically generate survey
Example on probation:1. variable M is equal to(N1+N2)Result O when/3,2. variable M is equal to 2(N1+N2)Result O when/3,3. variable M is equal to big
Result O when N1 certain value any less than N2, specific variable, limit value and knot are set to during arrange parameter by parameter M, N1, N2, O
Really;Self defined class can be designed according to User Defined, and function policy can not carry out self-defined setting in above-mentioned four class template
Put.
Specific electric function Test Sample Design system is as follows:User is created, new user is created by administrator right user,
Typing user profile includes job number, name, initial password, identification card number, hiring date, user right, post;Authorized user steps on
Land, the personal information that can be modified as the case may be in addition to user right;Use-case is write, with writing use-case authority
User can be carried out writing use-case, and write method is carried out according to above-mentioned Test Sample Design step;After the completion of test case is write,
Must be audited step by step, by taking two-stage examination & verification as an example, if first order examination & verification does not pass through, writing user will be by suggestion for revision again
Use-case is write, if first order examination & verification passes through, second level examination & verification is carried out, if two grades of examination & verifications do not pass through, writing user will be by repairing
Change opinion and write use-case again, if two grades of examination & verifications pass through, carry out next step;Test case is imported into use-case storehouse;Carry out use-case
Library management, with functions such as search, screening, replacement, deletions.
Embodiment 1
State transfer class template schematic diagram is illustrated in figure 3, with the inside of vehicle body control unit in single system functional test category
Illustrated as a example by lamp state transition diagram, be set to parameter A, B, C, A-1, B-1, C-1, A-2, B-2, C-2 during arrange parameter
Specific state and condition, state A are that interior lamp is extinguished and all door closure states, state B are for interior lamp is lighted and all doors
Closed mode, state C are for interior lamp illuminating state and at least one open mode, condition A-1 are ignition switch ON gears and institute
It is that any door is opened, condition A-2 is ignition switch ON gears, condition B-2 to extract key, condition C -1 to have a closing, condition B-1
It is that ignition switch OFF gears and all closings, condition Cs -2 are opened to extract key and any door, system will automatically generate test
Use-case:1. interior lamp is extinguished and all door closure states, by extracting key, is lighted into interior lamp and all closing shapes
State, 2. interior lamp light and all door closure states, opened by any door, into interior lamp illuminating state and at least one
Open mode, 3. interior lamp illuminating state and at least one open mode, by ignition switch ON gears and all closings, enter
Enter interior lamp to extinguish and all door closure states, 4. interior lamp is lighted and all door closure states, kept off by ignition switch ON, enter
Enter interior lamp to extinguish and all door closure states, 5. interior lamp illuminating state and at least one open mode, opened by igniting
OFF gears and all closings are closed, is lighted into interior lamp and all door closure states, 6. interior lamp is extinguished and all closing shapes
State, opens, into interior lamp illuminating state and at least one open mode by extracting key and any door.
Embodiment 2
By in vehicle integrated functionality test category as a example by reverse image function unlocking condition, during arrange parameter by parameter D1, D2,
D3, E are set to specific state and result, and D1 is that vehicle gear R keeps off, D3 is effective speed for ignition switch ON gears, D2, and E is
Reverse image function is opened, and system will automatically generate test case:1. ignition switch ON gears, vehicle gear R gears, speed are effectively same
When meet, as a result reverse image function is opened, and 2. ignition switch non-ON gears, vehicle gear R gears, speed effectively meet simultaneously, knot
Fruit reverse image function can not be opened, and 3. the non-R gears of ignition switch ON gears, vehicle gear, speed effectively meet simultaneously, as a result move backward
Imaging function can not be opened, and 4. ignition switch ON gears, vehicle gear R gears, speed are invalid while meeting, as a result reverse image function
Can not open.
Embodiment 3
By taking the automatic function that latches in real vehicle functional test category as an example, parameter F, J, K, L are set to specifically during arrange parameter
Variable, limit value, result and minimum resolution, variable F be speed, J be 20km/h, K to latch automatically, L be 1km/h, system by
Automatically generate test case:1. result latches automatically when speed is equal to 20km/h, and result falls automatically when 2. speed is equal to 21km/h
Lock, result does not latch automatically when 3. speed is equal to 19km/h.
Embodiment 4
By in single system functional test category instrument coolant temperature rise display function as a example by, during arrange parameter by parameter M,
N1, N2, O are set to specific variable, limit value and result, and variable M is coolant temperature signal, N1 is 90 DEG C, N2 is 108 DEG C, O
Show 90 DEG C all the time for coolant temperature gauge, system will automatically generate test case:1. when coolant temperature signal is equal to 66 DEG C
As a result coolant temperature gauge shows 90 DEG C all the time, and result coolant temperature gauge is all the time when 2. coolant temperature signal is equal to 132 DEG C
90 DEG C of display, result coolant temperature gauge is all the time when 3. coolant temperature signal is equal to more than 90 DEG C less than 108 DEG C of any certain values
90 DEG C of display.
Embodiment 5
It is job number GH1, name XM1, initial password CS1, identification card number SF1, hiring date RZ1, Yong Huquan with user YH1 information
Limit QX1, post ZW1, two-stage examination & verification is respectively as a example by SH1, SH2, is illustrated in figure 4 keeper and is created new user, typing user
Information job number GH1, name XM1, initial password CS1, identification card number SF1, hiring date RZ1, user right QX1, post ZW1;
Authorized user YH1 is logged in using job number GH1 and initial password CS1, can be modified as the case may be in addition to user right
Personal information, personal information is revised as initial password CS2, identification card number SF2, hiring date RZ2, post ZW2;Write use
Example, user YH1 can be write according to embodiment 1 to the method for embodiment 4;Audit step by step, user's YH1 use-cases write completion
Afterwards, one-level examination & verification SH1 is submitted to, if first order examination & verification SH1 does not pass through, suggestion for revision is proposed, writing user YH1 will be by modification
Opinion writes use-case again, after the completion of be resubmitted to one-level examination & verification SH1, until one-level examination & verification SH1 pass through, carry out two grades examination & verification
SH2, if two grades of examination & verification SH2 do not pass through, proposes suggestion for revision, and writing user YH1 will again write use-case by suggestion for revision, complete
One-level examination & verification SH1 is resubmitted to after, one-level auditing flow is repeated, if two grades of examination & verifications carry out next step by SH2;Will
Test case imports use-case storehouse;Carry out use-case library management, with search, screening, replace, delete etc. function, be easy to user to
Example being used and managed.
Claims (7)
1. a kind of electric function method for generating test case, it is characterised in that including following steps:
Step 101:Test request selection correspondence test category in technological document;
Step 102:According to the form of function policy in test category, test case template is selected;
Step 103:Test case parameter is set according to selected test case template;
Step 104:Test case is generated according to established rule.
2. electric function method for generating test case according to claim 1, it is characterised in that the test category bag
Include:Real vehicle functional test category, vehicle integrated functionality test category and single system functional test category.
3. electric function method for generating test case according to claim 1, it is characterised in that test case template bag
Include:State transfer class use-case template, conditional combination class use-case template, boundary value class use-case template, representative value class use-case template and
Self defined class use-case template;
Wherein, the state transfer class template is designed according to the strategy of state transition diagram;Conditional combination class template is root
The strategy for producing a result according to many condition is designed;Boundary value class template is designed according to critical point strategy;Typical case
Value class template is designed according to selection random value and representative value strategy in value range;Self defined class enters according to User Defined
Row design.
4. a kind of electric function Test cases technology system, it is characterised in that including:
Line module is created, new user, typing user profile are created for administrator right user;
Authorized user's log-in module, for changing the user profile in addition to user right;
Use-case module is write, is connected with higher level user's auditing module and importing use-case library module, including:
Test category module, for selecting test category, corresponding test category is selected according to test request, for follow-up use
Example library management search;
Test case template module, including multiple test case templates, for supplying difference in functionality policy selection;
Parameter setting module, writes for improving test case, and after test case template is selected, parameter setting module has been responsible for
It is apt to the corresponding parameter of the test case template;
Test cases technology module, for Test cases technology, according to selected test case template and the parameter for setting, presses
Test case is generated according to established rule;
Higher level user's auditing module, is connected with use-case module is write, and is responsible for the test case that check and correction and examination & verification are submitted to, and detection is patrolled
Mistake or clerical error are collected, judges whether to pass through, audited if next higher level user is carried out if, returned if not passing through
Return and write use-case, write again or change;
Use-case library module is imported, for use-case storehouse will to be imported by the test case of check and correction and examination & verification, is easy to case management;
Use-case database management module, is connected, with use-case library module is imported for realizing use-case library management function.
5. electric function Test cases technology system according to claim 4, it is characterised in that the user profile bag
Include:Job number, name, initial password, identification card number, hiring date, user right, post.
6. electric function Test cases technology system according to claim 4, it is characterised in that higher level user's examination & verification
Module includes multiple, and multiple higher level user's auditing modules are realized auditing step by step.
7. electric function Test cases technology system according to claim 4, it is characterised in that the use-case library management mould
The function of block includes:Function of search, screening function, replacement function and deletion function.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710049676.3A CN106681929B (en) | 2017-01-23 | 2017-01-23 | A kind of electric function method for generating test case and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710049676.3A CN106681929B (en) | 2017-01-23 | 2017-01-23 | A kind of electric function method for generating test case and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106681929A true CN106681929A (en) | 2017-05-17 |
CN106681929B CN106681929B (en) | 2019-05-14 |
Family
ID=58859914
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710049676.3A Active CN106681929B (en) | 2017-01-23 | 2017-01-23 | A kind of electric function method for generating test case and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106681929B (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107391385A (en) * | 2017-08-28 | 2017-11-24 | 北京航空航天大学 | A kind of construction method of Generation of software test case technology |
CN109542794A (en) * | 2018-12-04 | 2019-03-29 | 中国航空工业集团公司西安航空计算技术研究所 | A kind of Software Automatic Testing Method applied to embedded system |
CN110069412A (en) * | 2019-04-22 | 2019-07-30 | 中国第一汽车股份有限公司 | A kind of electric function supervision test software |
CN110704329A (en) * | 2019-10-30 | 2020-01-17 | 一汽轿车股份有限公司 | System with automatic code conversion function of electrical test case and conversion method |
CN113642306A (en) * | 2021-07-29 | 2021-11-12 | 一汽奔腾轿车有限公司 | Management method and management system for test problems of electrical function test |
CN114860516A (en) * | 2022-03-30 | 2022-08-05 | 中国人民解放军军事科学院国防科技创新研究院 | RISC-V processor function verification-oriented random pressure testing method and device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102565563A (en) * | 2010-12-29 | 2012-07-11 | 上海汽车集团股份有限公司 | Automated integration test system and method for automotive electronic and electric appliance system |
US20140236527A1 (en) * | 2013-02-21 | 2014-08-21 | Advantest Corporation | Cloud based infrastructure for supporting protocol reconfigurations in protocol independent device testing systems |
CN105446316A (en) * | 2015-11-12 | 2016-03-30 | 东方电气(乐山)新能源设备有限公司 | Pure electric vehicle control unit model in-loop test device and test method thereof |
-
2017
- 2017-01-23 CN CN201710049676.3A patent/CN106681929B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102565563A (en) * | 2010-12-29 | 2012-07-11 | 上海汽车集团股份有限公司 | Automated integration test system and method for automotive electronic and electric appliance system |
US20140236527A1 (en) * | 2013-02-21 | 2014-08-21 | Advantest Corporation | Cloud based infrastructure for supporting protocol reconfigurations in protocol independent device testing systems |
CN105446316A (en) * | 2015-11-12 | 2016-03-30 | 东方电气(乐山)新能源设备有限公司 | Pure electric vehicle control unit model in-loop test device and test method thereof |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107391385A (en) * | 2017-08-28 | 2017-11-24 | 北京航空航天大学 | A kind of construction method of Generation of software test case technology |
CN107391385B (en) * | 2017-08-28 | 2018-06-01 | 北京航空航天大学 | A kind of construction method of Generation of software test case technology |
CN109542794A (en) * | 2018-12-04 | 2019-03-29 | 中国航空工业集团公司西安航空计算技术研究所 | A kind of Software Automatic Testing Method applied to embedded system |
CN110069412A (en) * | 2019-04-22 | 2019-07-30 | 中国第一汽车股份有限公司 | A kind of electric function supervision test software |
CN110704329A (en) * | 2019-10-30 | 2020-01-17 | 一汽轿车股份有限公司 | System with automatic code conversion function of electrical test case and conversion method |
CN113642306A (en) * | 2021-07-29 | 2021-11-12 | 一汽奔腾轿车有限公司 | Management method and management system for test problems of electrical function test |
CN114860516A (en) * | 2022-03-30 | 2022-08-05 | 中国人民解放军军事科学院国防科技创新研究院 | RISC-V processor function verification-oriented random pressure testing method and device |
Also Published As
Publication number | Publication date |
---|---|
CN106681929B (en) | 2019-05-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106681929A (en) | Method and system for generating electric function test case | |
CN103946854B (en) | The intrinsic fingerprint recognition based on reservation being characterized with fuzzy algorithmic approach and dynamic key | |
Derrick et al. | Refinement in Object-Z | |
White | The fictions of factual representation | |
US20230144153A1 (en) | Blockchain-implemented control method and system for controlling an external process or system | |
Roffe | Abstract market theory | |
CN109871705A (en) | A kind of database update method and system | |
CN107169210A (en) | The self checking method and self-checking system of BIM database | |
CN110049108A (en) | A kind of net connection vehicular events generation method and device | |
CN101241611A (en) | Authentication device | |
CN110443348A (en) | A kind of modeling of the nerve network system based on MSVL and verification method | |
Cansell et al. | Refinement: A constructive approach to formal software design for a secure e-voting interface | |
Canavotto et al. | Reasoning with hierarchies of open-textured predicates | |
Burgueño et al. | Belief uncertainty in software models | |
Baldan et al. | Multilevel transitive and intransitive non-interference, causally | |
CN108920939A (en) | Information security method of discrimination, system and relevant apparatus based on Learner diagnosis device | |
Dummett | Chairman's address: Basic law V | |
US20110167198A1 (en) | Non-volatile storage alteration tracking | |
Goldoni | Political Constitutionalism and the Question of Constitution‐Making | |
Sobotka et al. | Testing automotive reactive systems using timed automata | |
Hawkins | Body of knowledge-structure and scope | |
Kılıç et al. | The Moderating Role of Feedback on Forgetting in Item Recognition | |
Tarrach et al. | Threat repair with optimization modulo theories | |
Hennig | From Data Modeling to Knowledge Engineering in Space System Design | |
Ligęza et al. | Visual design and on-line verification of tabular rule-based systems with xtt |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |