CN106681929B - A kind of electric function method for generating test case and system - Google Patents
A kind of electric function method for generating test case and system Download PDFInfo
- Publication number
- CN106681929B CN106681929B CN201710049676.3A CN201710049676A CN106681929B CN 106681929 B CN106681929 B CN 106681929B CN 201710049676 A CN201710049676 A CN 201710049676A CN 106681929 B CN106681929 B CN 106681929B
- Authority
- CN
- China
- Prior art keywords
- test
- case
- module
- template
- test case
- 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.)
- Active
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 kind of electric function method for generating test case and systems, method includes the following steps: Step 1: selection test scope;Step 2: selection test case template;Step 3: setting test case parameter;Step 4: generating test case.Simultaneously the present invention also provides a kind of Test Sample Design system, which includes test scope module, test case template module, parameter setting module and Test cases technology module.Wherein test scope module contains real vehicle functional test, the test of vehicle integrated functionality and three scopes of single system functional test;Test case template module contains stateful transfer class, conditional combination class, five boundary value class, representative value class and self defined class templates.The present invention provides a kind of method for test examples design independent of Test Engineer's experience, guarantees Test coverage degree and test quality, provides effective solution and important evidence for automobile function Test Sample Design.
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 technique
Currently, in automotive field functional test, the not no mature theoretical foundation of electric function testing example design is passed
Method for test examples design unite mainly according to technological document, is designed by the experience of Test Engineer, due to each test
The experience of engineer is different, and there are different degrees of othernesses for the test case of design, it is understood that there may be coverage is low and reduces survey
The risk of quality is tried, there are the hidden danger of function and secure context so as to cause car electrics.
Automobile function testing field needs one kind not cause test case to have differences because Test Engineer's experience is different
Property method for test examples design, can guarantee Test coverage degree and test quality, and then ensure car electrics functionality and
Safety.
Summary of the invention
The object of the present invention is to provide a kind of electric function method for test examples design and systems, are able to solve above-mentioned biography
The shortcomings that system method for test examples design, a kind of method for test examples design independent of Test Engineer's experience is provided, protected
Test coverage degree and test quality are demonstrate,proved, provides effective solution and important evidence for automobile function Test Sample Design.
The invention adopts the following technical scheme:
A kind of electric function method for generating test case, including the following steps:
Step 101: according to the corresponding test scope of test request selection in technological document;
Step 102: according to the form of function policy in test scope, selecting test case template;
Step 103: test case parameter is arranged according to selected test case template;
Step 104: generating test case according to established rule.
The test scope includes: that real vehicle functional test scope, vehicle integrated functionality test scope and single system function are surveyed
Try scope.
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 use-case template is designed according to the strategy of state transition diagram;Conditional combination class
Use-case template is that the strategy for generating a result according to many condition is designed;Boundary value class use-case template is according to critical point plan
Slightly it is designed;Representative value class use-case template is designed according to selection random value and representative value strategy in value range;It makes by oneself
Adopted class use-case template can be designed according to user is customized, and carry out of the function policy not in above-mentioned four class template is customized to be set
It sets.
A kind of electric function Test cases technology system, comprising:
Line module is created, creates new user, typing user information for administrator right user;
Authorized user's log-in module, for modifying the user information in addition to user right;
Use-case module is write, is connect with higher level user's auditing module and importing use-case library module, comprising:
Scope module is tested, for selecting test scope, corresponding test scope is selected according to test request, after being used for
Continuous use-case depositary management reason search;
Test case template module, including multiple test case templates, for for different function policy selection;
Parameter setting module is write for improving test case, and after selecting test case template, parameter setting module is negative
Duty improves the corresponding parameter of the test case template;
Test cases technology module is used for Test cases technology, according to the ginseng of selected test case template and setting
Number generates test case 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 audit are submitted, inspection
Logic error or clerical error are surveyed, judges whether to pass through, next higher level user's audit is carried out if passing through, if do not passed through
It then returns and writes use-case, rewrite or modify;
Use-case library module is imported, for use-case library will to be imported by the test case proofreaded and audited, is convenient for case management;
Use-case database management module is connected, for realizing use-case library management function with use-case library module is imported.
The user information includes: work number, name, initial password, identification card number, hiring date, user right, post.
Higher level user's auditing module include it is multiple, the realization of multiple higher level user's auditing modules is audited step by step.
The function of the use-case database management module includes: function of search, screening function, replacement function and deletes function.
The positive effect of the present invention is: it can overcome because Test Engineer's experience difference causes test case to there is covering
It spending low and tests ropy risk, the present invention provides the design that five kinds of test case templates realize all functional test use-cases,
To guarantee the coverage and consistency of test case, effective solution and important is provided for automobile function Test Sample Design
Foundation.
Detailed description of the invention
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 use-case template schematic diagram.
Fig. 4 is the flow chart of electric function Test Sample Design system.
Specific embodiment
Present invention will be further explained below with reference to the attached drawings and examples:
Steps are as follows for a kind of specific Test Sample Design of electric function method for generating test case of the present invention: according to technology
File, selection test scope;After having selected test scope, according to the form of function policy, test case template is selected, is then set
Parameter is set, test case is generated by Test cases technology module, wherein state transfer class use-case template is shifted according to state
Primitive reason 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, for condition C -2, system will automatically generate test case: 1. state A, and by condition B-1, into state B, 2. state B, is passed through
Condition C -1 is crossed, into state C, 3. state C, by condition A-1, into state A, 4. state B, by condition A-2, into shape
State A, 5. state C, by B-2, into state B, 6. state A, by condition C -2, into state C, by parameter when being arranged parameter
A, B, C, A-1, B-1, C-1, A-2, B-2, C-2 are set as specific state and condition;Conditional combination class use-case template is basis
The principle that many condition generates a result is designed, for meeting tri- conditions of D1, D2, D3 simultaneously and lead to result E, by phase
The condition answered is filled in corresponding parameter position, and system will automatically generate test case: 1. D1, D2, D3 while being met, as a result E, 2.
Non- D1, D2, D3 meet simultaneously, as a result non-E, and 3. D1, non-D2, D3 meet simultaneously, as a result non-E, and 4. D1, D2, non-D3 meet simultaneously,
As a result non-E sets specific condition and result for parameter D1, D2, D3, E when parameter is arranged;Boundary value class use-case template is root
It is designed according to critical point strategy, by taking result K when variable F is more than or equal to J limit value as an example, by corresponding numerical value minimum resolution L
It fills in corresponding parameter position, system will automatically generate test case: result K when 1. variable F is equal to J limit value, 2. variable F is equal to
Result K when J+L limit value, result non-K when 3. variable F is equal to J-L limit value set specific for parameter F, J, K, L when parameter is arranged
Variable, limit value, result and minimum resolution;Representative value class use-case template is according to selection random value and representative value in value range
It is designed, is greater than when N1 is less than N2 for result O by variable M value range, corresponding numerical value is filled in corresponding parameter bit
It sets, system will automatically generate test case: result O when 1. variable M is equal to (N1+N2)/3, when 2. variable M is equal to 2(N1+N2)/3
As a result O, result O when 3. variable M is equal to certain value any less than N2 greater than N1, sets parameter M, N1, N2, O to when parameter is arranged
Specific variable, limit value and result;Self defined class use-case template can be designed according to user is customized, and function policy is not upper
Customized setting can be carried out by stating in four class templates.
Specific electric function Test Sample Design system is as follows: creation user creates new user by administrator right user,
Typing user information includes work 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, has and writes use-case permission
User can carry 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,
It must be audited step by step, by taking two-stage is audited as an example, if the audit fails for the first order, writing user will be by suggestion for revision again
Use-case is write, if first order audit passes through, carries out second level audit, if the audit fails for second level, writing user will be by repairing
Change opinion and rewrite use-case, if second level audit passes through, carries out in next step;Test case is imported into use-case library;Carry out use-case
Depositary management reason has the function of search, screening, replacement, deletion etc..
Embodiment 1
It is illustrated in figure 3 state transfer class use-case template schematic diagram, with Body Control list in single system functional test scope
It is illustrated for the interior lamp state transition diagram of member, by parameter A, B, C, A-1, B-1, C-1, A-2, B-2, C- when parameter is arranged
2 are set as specific state and condition, state A be interior lamp extinguish and all door closure states, state B be interior lamp light and
All door closure states, state C are interior lamp illuminating state and at least one opening state, condition A-1 are ignition switch ON
Gear and all closings, condition B-1 are extraction key, condition C -1 is that any door is opened, condition A-2 is ignition switch ON gear, item
Part B-2 is ignition switch OFF gear and all closings, condition C -2 are extraction key and any door is opened, and system will automatically generate
Test case: 1. interior lamp is extinguished and all door closure states are lighted into interior lamp by extracting key and all are closed
State, 2. interior lamp is lighted and all door closure states, is opened by any door, into interior lamp illuminating state and at least one
Door opening state, 3. interior lamp illuminating state and at least one opening state, keep off by ignition switch ON and all are closed,
Extinguish into interior lamp and all door closure states, 4. interior lamp is lighted and all door closure states, it is kept off by ignition switch ON,
Extinguish into interior lamp and all door closure states, 5. interior lamp illuminating state and at least one opening state, by igniting
Switch OFF gear and all closings, are lighted and all door closure states into interior lamp, and 6. interior lamp is extinguished and all closings
State, by extracting key and any door opening, into interior lamp illuminating state and at least one opening state.
Embodiment 2
When parameter for reverse image function unlocking condition, is set in vehicle integrated functionality test scope by parameter D1,
D2, D3, E are set as specific state and as a result, D1 is ignition switch ON gear, D2 is vehicle gear R gear, D3 is that speed is effective, E
For the unlatching of reverse image function, system will automatically generate test case: 1. ignition switch ON gear, vehicle gear R gear, speed are effective
Meet simultaneously, as a result reverse image function is opened, and 2. the non-ON gear of ignition switch, vehicle gear R gear, speed effectively meet simultaneously,
As a result reverse image function cannot open, and 3. the non-R gear of ignition switch ON gear, vehicle gear, speed effectively meet simultaneously, as a result fall
Vehicle imaging function cannot be opened, and 4. ignition switch ON gear, vehicle gear R gear, speed meet simultaneously in vain, as a result reverse image function
It can open.
Embodiment 3
By taking the function that latches automatically in real vehicle functional test scope as an example, parameter F, J, K, L are set as having when parameter is arranged
Variable, limit value, result and the minimum resolution of body, variable F is speed, J 20km/h, K be latch automatically, L 1km/h, be
System will automatically generate test case: 1. speed be equal to 20km/h when result latch automatically, 2. speed be equal to 21km/h when result from
Dynamic to latch, result does not latch automatically when 3. speed is equal to 19km/h.
Embodiment 4
By taking instrument coolant temperature in single system functional test scope rises display function as an example, by parameter when parameter is arranged
M, N1, N2, O are set as specific variable, limit value and as a result, variable M is coolant temperature signal, N1 is 90 DEG C, N2 108
DEG C, O be coolant temperature gauge always show 90 DEG C, system will automatically generate test case: 1. coolant temperature signal be equal to 66
DEG C when result coolant temperature gauge always show 90 DEG C, 2. coolant temperature signal be equal to 132 DEG C when result coolant temperature gauge
90 DEG C are always showed, 3. coolant temperature signal is equal to result coolant temperature gauge when being greater than 90 DEG C less than 108 DEG C of certain any values
Always show 90 DEG C.
Embodiment 5
Using user YH1 information as work number GH1, name XM1, initial password CS1, identification card number SF1, hiring date RZ1, use
Family permission QX1, post ZW1 for two-stage audits respectively SH1, SH2, are illustrated in figure 4 administrator and create new user, typing
User information work 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 work number GH1 and initial password CS1, can be modified as the case may be except user right
Personal information is revised as initial password CS2, identification card number SF2, hiring date RZ2, post ZW2 by personal information in addition;It compiles
Use-case is write, user YH1 can write according to embodiment 1 to embodiment 4 method;It audits step by step, user's YH1 use-case has been write
Cheng Hou submits to level-one audit SH1, if first order audit SH1 does not pass through, proposes suggestion for revision, writing user YH1 will be by repairing
Change opinion and rewrite use-case, be resubmitted to level-one audit SH1 after the completion, until level-one audit SH1 passes through, carries out second level and examine
Core SH2 proposes suggestion for revision if second level audit SH2 does not pass through, and use-case will be rewritten by suggestion for revision by writing user YH1,
It is resubmitted to level-one audit SH1 after the completion, repeats level-one auditing flow, if second level audit is carried out in next step by SH2;
Test case is imported into use-case library;Use-case depositary management reason is carried out, has the function of search, screening, replacement, deletion etc., is convenient for user couple
Use-case using and managing.
Claims (6)
1. a kind of electric function method for generating test case, which is characterized in that including the following steps:
Step 101: according to the corresponding test scope of test request selection in technological document;
Step 102: according to the form of function policy in test scope, selecting test case template;
Step 103: test case parameter is arranged according to selected test case template;
Step 104: generating test case according to established rule;
Test case template 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 use-case template is designed according to the strategy of state transition diagram;Conditional combination class use-case
Template is that the strategy for generating a result according to many condition is designed;Boundary value class use-case template be according to critical point strategy into
Row design;Representative value class use-case template is designed according to selection random value and representative value strategy in value range;Self defined class
Use-case template is designed according to user is customized.
2. electric function method for generating test case according to claim 1, which is characterized in that the test scope packet
It includes: real vehicle functional test scope, vehicle integrated functionality test scope and single system functional test scope.
3. a kind of electric function Test cases technology system characterized by comprising
Line module is created, creates new user, typing user information for administrator right user;
Authorized user's log-in module, for modifying the user information in addition to user right;
Use-case module is write, is connect with higher level user's auditing module and importing use-case library module, comprising:
Scope module is tested, for selecting test scope, corresponding test scope is selected according to test request, to be used for subsequent use
Example depositary management reason search;
Test case template module, including multiple test case templates, for for different function policy selection;
Parameter setting module is write for improving test case, and after selecting test case template, parameter setting module has been responsible for
It is apt to the corresponding parameter of the test case template;
Test cases technology module is pressed for Test cases technology according to the parameter of selected test case template and setting
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 audit are submitted, and detection is patrolled
Mistake or clerical error are collected, judges whether to pass through, next higher level user's audit is carried out if passing through, is returned if not passing through
It returns and writes use-case, rewrite or modify;
Use-case library module is imported, for use-case library will to be imported by the test case proofreaded and audited, is convenient for case management;
Use-case database management module is connected, for realizing use-case library management function with use-case library module is imported.
4. electric function Test cases technology system according to claim 3, which is characterized in that the user information packet
It includes: work number, name, initial password, identification card number, hiring date, user right, post.
5. electric function Test cases technology system according to claim 3, which is characterized in that higher level user's audit
Module include it is multiple, the realization of multiple higher level user's auditing modules is audited step by step.
6. electric function Test cases technology system according to claim 3, which is characterized in that mould is managed in the use-case depositary management
The function of block includes: function of search, screening function, replacement function and deletes 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 CN106681929A (en) | 2017-05-17 |
CN106681929B true 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) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
CN110069412B (en) * | 2019-04-22 | 2023-05-26 | 中国第一汽车股份有限公司 | Electrical function test management device |
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 |
CN114860516B (en) * | 2022-03-30 | 2023-07-04 | 中国人民解放军军事科学院国防科技创新研究院 | Random pressure testing method and device for RISC-V processor function verification |
Citations (2)
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 |
CN105446316A (en) * | 2015-11-12 | 2016-03-30 | 东方电气(乐山)新能源设备有限公司 | Pure electric vehicle control unit model in-loop test device and test method thereof |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140236527A1 (en) * | 2013-02-21 | 2014-08-21 | Advantest Corporation | Cloud based infrastructure for supporting protocol reconfigurations in protocol independent device testing systems |
-
2017
- 2017-01-23 CN CN201710049676.3A patent/CN106681929B/en active Active
Patent Citations (2)
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 |
CN105446316A (en) * | 2015-11-12 | 2016-03-30 | 东方电气(乐山)新能源设备有限公司 | Pure electric vehicle control unit model in-loop test device and test method thereof |
Also Published As
Publication number | Publication date |
---|---|
CN106681929A (en) | 2017-05-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106681929B (en) | A kind of electric function method for generating test case and system | |
Kirwan | Human error identification techniques for risk assessment of high risk systems—Part 1: review and evaluation of techniques | |
Preston | Rethinking development: Essays on development and Southeast Asia | |
Bakirtzis et al. | An ontological metamodel for cyber-physical system safety, security, and resilience coengineering | |
CN109634600A (en) | A kind of code generating method based on security extension SysML and AADL model | |
Bertrand | Metaphysical explanation by constraint | |
CN105005697A (en) | Dynamic fault tree analysis method of system with time restraint on repair | |
CN113326027B (en) | Domain-driven design tactical modeling method | |
CN110049108A (en) | A kind of net connection vehicular events generation method and device | |
Denney et al. | Software certification and software certificate management systems | |
CN104615438B (en) | A kind of characteristic slice model checking method of software product line | |
Penn | Algorithmic silence: a call to decomputerize | |
Mohammad et al. | A component‐based development process for trustworthy systems | |
Graydon | The safety argumentation schools of thought | |
Boehm et al. | Conflicts and synergies among quality requirements | |
Verhulst et al. | ARRL: A criterion for compositional safety and systems engineering: A normative approach to specifying components | |
McLucas | An investigation into the integration of qualitative and quantitative techniques for addressing systemic complexity in the context of organisational strategic decision-making | |
Fildes | Scenarios, strategic conversations, and forecasting: A commentary on Rowland and Spaniol (2021) | |
Hennig | From Data Modeling to Knowledge Engineering in Space System Design | |
Marín et al. | A quality model for conceptual models of mdd environments | |
CN108416012B (en) | Multi-structured data access method based on semantic dependence | |
Bergler et al. | Integrating Security and Safety with Systems Engineering: a Model-Based Approach | |
Yang | A Model Theory for Nonmonotonic Multiple Value and Code Inheritance in Object-Oriented Knowledge Bases | |
Ju et al. | A dynamic deontic logic based on histories | |
CN110321114A (en) | Integration method of UML modeling and safety modeling based on view |
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 |