CN104375943A - Embedded software black-box test case generation method based on static models - Google Patents

Embedded software black-box test case generation method based on static models Download PDF

Info

Publication number
CN104375943A
CN104375943A CN201410765285.8A CN201410765285A CN104375943A CN 104375943 A CN104375943 A CN 104375943A CN 201410765285 A CN201410765285 A CN 201410765285A CN 104375943 A CN104375943 A CN 104375943A
Authority
CN
China
Prior art keywords
test
item
test item
black
testing
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.)
Pending
Application number
CN201410765285.8A
Other languages
Chinese (zh)
Inventor
吴翔虎
曲明成
邹炳松
张森
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to CN201410765285.8A priority Critical patent/CN104375943A/en
Publication of CN104375943A publication Critical patent/CN104375943A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention belongs to the technical field of model-based test automation of software engineering, discloses an embedded software black-box test case generation method based on a static model and solves the problems that the black-box test based on requirement specification documents is behind, difficult to understand and low in test efficiency, and test case quality is unguaranteed. The technical scheme includes the embedded software black-box test case generation method includes (1) adopting a data flow diagram, a fault tree, a cause-and-effect diagram, a decision table, a nest mechanism of diagrams and expanded semantics of the diagrams to construct the static model of the embedded software; (2) based on the static model, planning test items, and automatically generating black box test case collections corresponding to the test items according to a test coverage principle and a test case generation algorithm. The embedded software black-box test case generation method is applicable to static test requirement description of the embedded software and black-box test case generation.

Description

A kind of Black-box Testing of Embedded Software case generation method based on static model
Technical field
The present invention relates to a kind of Black-box Testing of Embedded Software case generation method, particularly a kind of Black-box Testing of Embedded Software case generation method based on static model, belongs to the model-based testing technical field of automation in soft project.
Background technology
Current, the complexity of embedded software is more and more higher, and reliability and requirement of real-time are also more and more stricter, but the time requirement of embedded product listing is shorter and shorter.For meeting these harsh requirements, efficient software test is necessary, comprises the automatic planning of test case, generation, optimization, execution and assessment etc.How efficient software test is trying one's best under weak Test hypotheses if needing to solve, generate as far as possible little but that debugging ability is as far as possible strong test use cases as soon as possible.
Model-based testing (Model-Based Testing, MBT) be a kind of production assurance technology producing test case and assessment test result according to system under test (SUT) (System UnderTest, SUT) demand and the model of function declaration and the model (being commonly referred to as test model) of derivation thereof.Model-based testing is a kind of software test efficiently.
It is generally acknowledged, MBT originates in 1956, is mainly used in the test that circuit, communication protocol etc. are relevant to hardware device at first, just starts for the test relevant to software to the end of the seventies.Through years of researches, MBT has defined three kinds of more classical theories---the theory that automaton theory, UML unified Modeling theory and probability statistics combine with automat.These three kinds of theories distinguish corresponding three class models---FSM/EFSM/LTS/ASM model, uml model and Markov model again.In recent years, mainly comprise about the study hotspot of MBT and model is dissolved in software assembly line, use-case optimization, use-case assessment, MBT is used for different field (as embedded system, large scale distributed system and data acquisition system (DAS) etc.), according to uml model and other models (as Uppaal model, Simulink/Stateflow model etc.) generating test use case etc.
In traditional software test, classical Black-box testing Cases method for designing has equivalence class partition, boundary value analysis, cause-and-effect diagram, decision table, mistake supposition etc.Equivalence class classifying method is that the input domain of program is divided into some parts (class), then from each part, choose a few representative data as test case, the representative data effect in testing of each class is equivalent to other data in this class.Boundary analysis inputs or outputs on the border of variable range at certain, the method whether verification system function is normally run, usually choose just be less than, equal or be just greater than boundary value value as test data.Cause effect graph is a kind of formal graphic language, the various combinations of weight analysis initial conditions by figure, often kind of combination condition be exactly " because of ", it certainly leads to a result exported, and Here it is " really ".Decision table method is a kind of combined analysis method, describes the combination of multiple condition, correspondingly produces multiple action.Mistake conferring method is that tester infers the mistake program and may exist according to working experience and intuition, thus tests targetedly.
At present, Black-box Testing Main Basis requirement documents carries out, but based on the Black-box Testing of requirements specification document, there are the following problems: (1) is based on manual test, test delayed and indigestion, (2) test case is difficult to realization and reuses, cause the duplication of labour, testing efficiency is low; (3) very large to the dependence of tester, and tester is difficult to design comparatively complicated test case, cannot ensure the quality of test case;
Summary of the invention
The object of the invention is to propose a kind of Black-box Testing of Embedded Software case generation method based on static model, have that test is delayed for the existing Black-box Testing based on requirements specification document and indigestion, testing efficiency are low, cannot ensure the problem of the quality of test case to solve.
The present invention for solving the problems of the technologies described above adopted technical scheme is:
A kind of Black-box Testing of Embedded Software case generation method based on static model of the present invention, realizes according to following steps:
Nested mechanism between step one, employing data flow diagram, fault tree, cause-and-effect diagram, decision table, figure and the expansion semanteme of figure build the static model of embedded software;
Step 2, the static model of embedded software that step one builds to be verified, and manually plan test item according to test purpose, then automatic completion and validity decision are carried out to test item, finally fill in the title of test item;
The completion of described test item adopts the classical ergodic algorithm of figure to realize, and is communicated with the inside realizing test item;
The validity decision of described test item is: the meaningless pel of data flow diagram comprises " with relation node ", " or relation node " and " XOR relation node ", the meaningless pel of fault tree comprises " line ", " with door " and disjunction gate, and the meaningless pel of cause-and-effect diagram comprises " line ".If test item is made up of above-mentioned insignificant pel entirely, then will be judged as illegal;
Step 3, automatically generate Black-box testing Cases set corresponding to test item according to Testing criteria and Test cases generation algorithm, and test item and test use cases are incorporated into storehouse and preserve, wherein often kind of test item has corresponding Test cases generation algorithm;
Described test item is divided into data flow diagram test item, fault tree test item, cause-and-effect diagram test item, decision table test item, time domain test item and interface testing item;
Described Testing criteria comprises test path coverage criterion, the minimal cut set coverage criterion of fault tree, the first attribute coverage criterion combining coverage criterion, interface between coverage criterion, time domain coverage criterion, time coupled zone of condition metaaction of decision table of data flow diagram.
Step 4, test item and test case set to be managed, comprise interpolation, delete, revise and check operation, to improve the generation of test case set.
Beneficial effect of the present invention is as follows:
(1) the present invention can find more mistake in the early stage intervention of embedded software life cycle, there is not the problem that test is delayed, because when creating the static test pattern of embedded software, test deviser can find some the inconsistent or incomplete information in priginal soft demand or system model;
(2) model of the present invention can be reused, and the test case according to model generation also can be reused, and can reduce the duplication of labour like this, and improve testing efficiency;
(3) the present invention can realize static testing requirement easily and follows the trail of because the testing requirement of static state is present among static model, and static model have very strong can traceability, this is conducive to the efficiency improving test;
(4) the present invention can respond the changes in demand of embedded software in time, safeguards better to test case, because can regenerate test case after test model change, improves testing efficiency;
(5) the present invention automatically can generate comparatively complicated test case set according to coverage criterion from formalized model, more can find aacode defect, ensure that the quality of test case than traditional test case;
(6) the present invention can complete varigrained test easily, because model can have different abstraction hierarchies, this makes test have more specific aim, is conducive to the quality improving test;
(7) the generation comparison image of test design of the present invention and test case is directly perceived, not only ensure that the validity of Test Sample Design, also ensure that repeatability and intelligibility;
(8) compared with the Black-box Testing based on requirements specification document, the Black-box Testing of Embedded Software case generation method based on static model that the present invention proposes can generate the test case of higher testing requirement coverage rate automatically, and testing efficiency improves about 30%.
Accompanying drawing explanation
Fig. 1 is the automated test frame figure of model-based testing of the present invention;
Fig. 2 is process flow diagram of the present invention;
Fig. 3 is the graph of a relation between static graphics of the present invention;
Fig. 4 is that the data flow diagram of the embodiment of the present invention uses example---the ground floor data flow diagram of automatic saler system;
Fig. 5 is that the fault tree of the embodiment of the present invention uses example---the fault tree that " inspection coin " data mart modeling node is nested;
Fig. 6 is that the decision table of the embodiment of the present invention uses example---the decision table that " inspection coin " data mart modeling node is nested.
Embodiment
Below in conjunction with accompanying drawing, the present invention is described in further detail:
As shown in Figure 1, the present invention is under the automated test frame of MBT, and process to generating test use case set, mainly stresses the description of embedded software static characteristics from structure SUT test model.MBT automated test frame is divided into " three levels, processes "---test model layer, test case layer, physical storage layer and test tracking and management process.The core missions of test model layer build SUT test model.The core missions of test case layer produce test item set, test case set and test script set.The core missions of physical storage layer are for the element of test model layer and test case layer provides physical store service, comprise the physical store of SUT test model, test item set, test case set and test document set.It is tracing and managing test process that test is followed the tracks of with the core missions of management process, comprises the tracking of test item and test case, the change of test model to test item and the impact of test case, the change of test item to the impact etc. of test case.
Embodiment one: composition graphs 2, Fig. 3 illustrate present embodiment, and present embodiment comprises the following steps:
Step one, be familiar with tested software after, use structural workflow net, the expansion semanteme of the nested mechanism between data flow diagram, fault tree, cause-and-effect diagram, decision table, figure and figure is adopted to build the static model of embedded software, to describe the static test demand of embedded software;
Step 2, the static model of embedded software that step one builds to be verified, and manually plan test item according to test purpose, then automatic completion and validity decision are carried out to test item, finally fill in the title of test item;
The completion of described test item, to reach " inside of test item is communicated with " for target, adopts the classical ergodic algorithm of figure to realize, the test item that final generation is complete.
The validity decision of described test item is must there is significant pel in the complete test item of requirement.The meaningless pel of data flow diagram comprises " with relation node ", " or relation node " and " XOR relation node ", and the meaningless pel of fault tree comprises " line ", " with door " and disjunction gate, and the meaningless pel of cause-and-effect diagram comprises " line ".If test item is made up of above-mentioned insignificant pel entirely, then will be judged as illegal.Such as, in data flow diagram, although comprise some nodes and data stream in test item, and be communicated with, if but these nodes be all picture with or, the node irrelevant with concrete function such as XOR, so this test item will be judged as illegal, test item planning failure.
Step 3, automatically generate Black-box testing Cases set corresponding to test item according to Testing criteria and Test cases generation algorithm, and test item and test use cases are incorporated into storehouse and preserve, wherein often kind of test item has corresponding Test cases generation algorithm;
The problem that what described test item solved is " what is surveyed ", it is the embodiment of test point, in static graphics model, concrete manifestation is the pel set be made up of one or more graphic element, is divided into data flow diagram test item, fault tree test item, cause-and-effect diagram test item, decision table test item, time domain test item and interface testing item.Often kind of test item has corresponding Test cases generation algorithm.
Described Testing criteria comprises test path coverage criterion, the minimal cut set coverage criterion of fault tree, the first attribute coverage criterion combining coverage criterion, interface between coverage criterion, time domain coverage criterion, time coupled zone of condition metaaction of decision table of data flow diagram.
Step 4, test item and test case set to be managed, comprise interpolation, delete, revise and check operation, to improve the generation of test case set.
The beneficial effect of present embodiment is as follows:
(1) the present invention can find more mistake in the early stage intervention of embedded software life cycle, there is not the problem that test is delayed, because when creating the static test pattern of embedded software, test deviser can find some the inconsistent or incomplete information in priginal soft demand or system model;
(2) model of the present invention can be reused, and the test case according to model generation also can be reused, and can reduce the duplication of labour like this, and improve testing efficiency;
(3) the present invention can realize static testing requirement easily and follows the trail of because the testing requirement of static state is present among static model, and static model have very strong can traceability, this is conducive to the efficiency improving test;
(4) the present invention can respond the changes in demand of embedded software in time, safeguards better to test case, because can regenerate test case after test model change, improves testing efficiency;
(5) the present invention automatically can generate comparatively complicated test case set according to coverage criterion from formalized model, more can find aacode defect, ensure that the quality of test case than traditional test case;
(6) the present invention can complete varigrained test easily, because model can have different abstraction hierarchies, this makes test have more specific aim, is conducive to the quality improving test;
(7) the generation comparison image of test design of the present invention and test case is directly perceived, not only ensure that the validity of Test Sample Design, also ensure that repeatability and intelligibility;
(8) compared with the Black-box Testing based on requirements specification document, the Black-box Testing of Embedded Software case generation method based on static model that the present invention proposes can generate the test case of higher testing requirement coverage rate automatically, and testing efficiency improves about 30%.
Embodiment two: composition graphs 2, Fig. 3 illustrate present embodiment, present embodiment and embodiment one unlike:
Structural method described in step one is the common method that embedded software carries out demand analysis and design, data flow diagram is the product in embedded software demand analysis and overall design stage, and fault tree, cause-and-effect diagram and decision table are the conventional means of traditional Black-box Testing design.
As shown in Figure 3, the nest relation (starting point is that father schemes, and terminal is subgraph) between the connecting line presentation graphic of band arrow, comprising nested mechanism between figure:
(1) data flow diagram divides layer building, is specially the nested subdata flow graph of data mart modeling of data flow diagram;
(2) the data mart modeling nested fault tree of data flow diagram, cause-and-effect diagram and decision table;
(3) the nested sub-fault tree of the bottom event of fault tree.
Embodiment three: composition graphs 2, Fig. 3 illustrate present embodiment, present embodiment and embodiment one or two unlike: the expansion semanteme of the figure described in step one comprises:
(1) for the pel of data flow diagram with the addition of test semanteme, comprise data mart modeling and with the addition of inverse program, time domain, hardware and interruption attribute;
(2) for the pel of fault tree with the addition of test semanteme, comprise bottom event and with the addition of CMP attribute (describing the generation of bottom event) this attribute quantification;
(3) for decision table with the addition of test semanteme, comprise and automatically generate decision table according to logical expression, add the precondition of decision table.
Embodiment four: composition graphs 2, Fig. 3 illustrate present embodiment, one of present embodiment and embodiment one to three unlike: the condition of the verification demand fulfillment described in step 2 is as follows:
(1) for data mart modeling, data flow diagram requires data conservation;
(2) for the layering of data flow diagram, data flow diagram requires Parent Submap balance;
(3) event Constraint of fault tree, comprise a fault tree and only have a top event, bottom event must use CMP attribute quantification to describe;
(4) cause-and-effect diagram essential factor constraint, comprise a cause-and-effect diagram only have one main because of;
(5) the condition metaaction tuple contract bundle of decision table, comprises condition unit and the equal non-NULL of action element of a regularization term.
Embodiment five: composition graphs 2, Fig. 3 illustrate present embodiment, present embodiment and one of embodiment one to four unlike: be specially according to Testing criteria and Black-box testing Cases set corresponding to Test cases generation algorithm automatically generated data flow graph test item in step 3:
The static graphics model of embedded software adopts the form of XML document to store, and test item and test case set adopt the form of database to store.
The process of data flow diagram test item generating test use case is: all test path set first obtaining legal complete test item, by test path set reduction rules, abbreviation is carried out in the hope of all simple test paths to each test path set again, finally according to the set of every bar simple test coordinates measurement test case.Wherein, test path set refers to all reachable paths from a node to another node, and simple test path refers to a reachable path from a node to another node.The use example of data flow diagram as shown in Figure 4.
If m, n are two nodes in data flow diagram, test path set reduction rules is as follows: (1) if there is a data stream t=(m, n) from m to n, then data stream t is a paths; (2) if a, b are paths, and tail (a)=head (b), then (a, b) is also a paths, and the execution in (a, b) path needs to perform a and b successively; (3) if a, b is a paths, and tail (a)=tail (b) or head (a)=head (b), then (a and b) is also a paths, and the execution in (a and b) path needs to perform a and b simultaneously; (4) if a, b is a paths, and tail (a)=tail (b) or head (a)=head (b), then (a or b) represents two paths, and the execution in (a or b) path needs to perform a and b respectively; (5) if a, b is a paths, and tail (a)=tail (b) or head (a)=head (b), then (a xor b) represents two paths, and the execution in (a xor b) path needs to perform one of a and b.
Input: data flow diagram DFD, legal complete data flow diagram test item I1
Export: the test case set T1 of data flow diagram test item
Algorithmic procedure:
1) in legal complete test item I1, all test path set W1 are obtained based on test path coverage criterion traversal;
2) make simple test set of paths U1 be empty set, the test case set T1 of data flow diagram test item is empty set;
3) all test path set W1 are traveled through one by one, if current test path set is W1 [i];
4) by test path set reduction rules, abbreviation is carried out to current test path set W1 [i], obtain all simple test path S1 in this test path set;
5) S1 is added in simple test set of paths U1, gets back to step 3) continue traversal until all test path set W1 are crossed by abbreviation;
6) simple test set of paths U1 is traveled through one by one, if current simple test path is U1 [j];
7) the test case set M1 of U1 [j] is generated according to the examination point in current simple test path U1 [j] (correctness of effective equivalence class of data stream and invalid equivalence class, data mart modeling function);
8) M1 is added in test case set T1, gets back to step 6) continue traversal until simple test path in simple test set of paths U1 all generated test use cases is only combined into;
9) the test case set T1 of return data flow graph test item.
Embodiment six: composition graphs 2, Fig. 3 illustrate present embodiment, present embodiment and one of embodiment one to five unlike: the Black-box testing Cases set automatically generating fault tree test item corresponding according to Testing criteria and Test cases generation algorithm in step 3 is specially:
The process of the fault tree test item generating test use case described in step 3 is: first according to asking minimal cut set algorithm to obtain the minimal cut set of fault tree, then according to the set of minimal cut set structure test case, the CMP attribute generating test use case according to bottom event is finally considered.The use example of fault tree as shown in Figure 5.
Input: fault tree FTA, legal complete fault tree test item I2
Export: the test case set T2 of fault tree test item
Algorithmic procedure:
1) in legal complete test item I2, minimal cut set algorithm is adopted to obtain all minimal cut set W2 of fault tree, so that based on the set of minimal cut set coverage criterion generating test use case;
2) the test case set T2 making fault tree test item is empty set;
3) all minimal cut set W2 are traveled through one by one, if current minimal cut set is W2 [i];
4) the test case set M2 of W2 [i] is generated according to the examination point (whether the event of failure in W2 [i] occurs) of current minimal cut set W2 [i];
5) M2 is added in the test case set T2 of fault tree test item, gets back to step 3) until all minimal cut set W2 generated test use cases is combined into only;
6) pel in legal complete fault tree test item I2 is traveled through one by one, if current pel is I2 [j];
7) if I2 [j] is bottom event, the test case set M3 of I2 [j] is so generated according to the CMP attribute of bottom event I2 [j]; 8) M3 is added in the test case set T2 of fault tree test item, gets back to step 6) until the pel in legal complete fault tree test item I2 was all traversed;
9) the test case set T2 of fault tree test item is returned.
Embodiment seven: composition graphs 2, Fig. 3 illustrate present embodiment, present embodiment and one of embodiment one to six unlike: the Black-box testing Cases set automatically generating cause-and-effect diagram test item corresponding according to Testing criteria and Test cases generation algorithm in step 3 is specially:
The process of the cause-and-effect diagram test item generating test use case described in step 3 and the process of fault tree test item generating test use case similar, namely consider the logical combination of bottom essential factor one by one, then generate corresponding test case set.
Input: cause-and-effect diagram CD, legal complete cause-and-effect diagram test item I3
Export: the test case set T3 of cause-and-effect diagram test item
Algorithmic procedure:
1) in legal complete test item I3, traversal obtains all bottom essential factor W3 of I3;
2) the test case set T3 making cause-and-effect diagram test item is empty set;
3) all bottom essential factor W3 are traveled through one by one, if current bottom essential factor is W3 [i];
4) the test case set M4 of W3 [i] is generated according to the examination point (whether bottom essential factor occurs) of bottom essential factor W3 [i];
5) M4 is added the test case set T3 of cause-and-effect diagram test item, gets back to step 3) until all bottom essential factor W3 generated test use cases is combined into only;
6) the test case set T3 of cause-and-effect diagram test item is returned.
Embodiment eight: composition graphs 2, Fig. 3 illustrate present embodiment, present embodiment and one of embodiment one to seven unlike: the Black-box testing Cases set automatically generating decision table test item corresponding according to Testing criteria and Test cases generation algorithm in step 3 is specially:
The process of the decision table test item generating test use case described in step 3 is relatively more direct, and the condition tuple cooperation by decision table is the input of test case, the expection of the action element of decision table as test case is exported.The use example of decision table as shown in Figure 6.
Input: decision table DT
Export: the test case set T4 of decision table test item
Algorithmic procedure:
1) all conditions metaaction unit combination W4 of decision table DT is obtained, so that based on the coverage criterion generating test use case set of condition metaaction unit;
2) the test case set T4 making decision table test item is empty set;
3) all conditions metaaction unit combination W4 is traveled through one by one, if current condition metaaction unit is combined as W4 [i];
4) W4 [i] is organized as a test case M5, the cooperation of condition tuple is test input, and action element is that test oracle exports;
5) M5 is added the test case set T4 of decision table test item, returns step 3) until all conditions metaaction unit combination W4 generated test case;
6) the test case set T4 of decision table test item is returned.
Embodiment nine: composition graphs 2, Fig. 3 illustrate present embodiment, present embodiment and one of embodiment one to eight unlike: be specially according to Testing criteria and Black-box testing Cases set corresponding to Test cases generation algorithm domain test of automatic rise time item in step 3:
Time domain test item described in step 3 is divided into " data mart modeling time domain test item " and " between time coupled zone functional test item ".
Data mart modeling time domain test item generates corresponding Black-box testing Cases set and is specially: the time domain (may exist one or more) first obtaining data mart modeling, then according to the set of limit testing method generating test use case.
Input: data flow diagram DFD, legal complete data flow diagram test item I4
Export: the test case set T5 of data mart modeling time domain test item
Algorithmic procedure:
1) in legal complete test item I4, traversal obtains the data mart modeling W5 of all time domain attribute non-NULLs;
2) the test case set T5 making data mart modeling time domain test item is empty set;
3) the data mart modeling W5 of all time domain attribute non-NULLs is traveled through one by one, if current data mart modeling is W5 [i];
4) the time domain list TDL of current data mart modeling W5 [i] is traveled through one by one, if current time domain is TDL [j];
5) based on time domain coverage criterion, the test case set M6 of W [i] is generated according to the time domain TDL [j] of current data mart modeling W5 [i];
6) M6 is added in the test case set T5 of data mart modeling time domain test item, gets back to step 4) until the time domain list of W5 [i] all generated test use cases is combined into only;
7) step 3 is got back to) until the data mart modeling in W5 was all traversed;
8) the test case set T5 of return data domain test process time item;
The Black-box testing Cases set that between time coupled zone, the generation of functional test item is corresponding is specially:
First obtain territory all times of coincidence (the corresponding test item in territory each time of coincidence), then find out carry out the data mart modeling of collective's test in territory in the time of coincidence according to the rule of " time domain of data mart modeling really comprises the territory time of coincidence ", last according to the set of limit testing method generating test use case.
Input: data flow diagram DFD, legal complete data flow diagram test item I5
Export: the test case set T6 of functional test item between time coupled zone
Algorithmic procedure:
1) in legal complete test item I5, traversal obtains the data mart modeling W6 of all time domain attribute non-NULLs;
2) in W6, obtain the time domain S2 of all overlaps and record the data mart modeling comprising territory overlapping time;
3) the test case set T6 making functional test item between time coupled zone is empty set;
4) the time domain S2 of all overlaps is traveled through one by one, if current territory overlapping time is S2 [i];
5) based on coverage criterion between time coupled zone, according to generating the test case set M7 of many data mart modeling at S2 [i] territory S2 overlapping time [i];
6) by the test case set T6 of functional test item between M7 joining day coupled zone, step 4 is got back to) until the time domain S2 of all overlaps generated test use cases is combined into only;
7) the test case set T6 of functional test item between time of return coupled zone.
Embodiment ten: composition graphs 2, Fig. 3 illustrate present embodiment, present embodiment and one of embodiment one to nine unlike: the Black-box testing Cases set automatically generating interface testing item corresponding according to Testing criteria and Test cases generation algorithm in described step 3 is specially:
The process that interface testing item generating test use case described in step 3 generates is: the main attribute adopting equivalence class partition and boundary value analysis to consider interface, at least comprises effective equivalence class and invalid equivalence class two kinds.
Input: interface attributes set H
Export: the test case set T7 of interface testing item
Algorithmic procedure:
1) the test case set T7 making interface testing item is empty set;
2) based on interface attributes coverage criterion, generate proper testing use-case M8, namely H attribute all adopts normal value;
3) M8 is added in the test case set T7 of interface testing item;
4) interface attributes set H is traveled through one by one, if current interface attributes is H [i];
5) based on interface attributes coverage criterion, attribute H [i] is set to inefficacy, all the other interface attributes are set to normally, generating test use case M8;
6) M8 is added in the test case set T7 of interface testing item, gets back to step 4) until attribute in interface attributes set H is all set as inefficacy and generated test case;
7) the test case set T7 of interface testing item is returned.
The above; be only the present invention's preferably embodiment; but protection scope of the present invention is not limited thereto; anyly be familiar with those skilled in the art in the technical scope that the present invention discloses; be equal to according to technical scheme of the present invention and inventive concept thereof and replace or change, all should be encompassed within protection scope of the present invention.
For the Black-box Testing Problems existing based on requirements specification document, the static test demand of different forms method of the present invention to embedded software carries out formalized description, build the embedded software static model be made up of data flow diagram, fault tree, cause-and-effect diagram and decision table, manual planning test item, Test cases generation algorithm according to Testing criteria and test item generates corresponding test case set automatically, thus helps the Black-box Testing of embedded software to complete quickly and efficiently.
The present invention is after understanding tested software in depth, use structural workflow net, the static model adopting the expansion of data flow diagram, fault tree, cause-and-effect diagram and the nested mechanism between decision table and figure and figure semanteme to build embedded software describe the static test demand of embedded software, then manually test item is planned, finally according to Testing criteria and the automatic generating test use case set of Test cases generation algorithm.
Embodiment:
For ease of understanding the Test cases technology process of various test item, draw various static graphics for automatic saler system below.
Automatic saler system is a kind of self-service system.When selling goods, client drops into coin in the coin slot of machine, the size of hardware check coin, weight, thickness and edge type.Effective coin is the size of coin, weight, thickness and all satisfactory coin of edge type, and other coins are considered to counterfeit money.Machine refusal accepts counterfeit money, and it is exited from moving back coin hole.After machine receives effective coin, coin is sent in coin storage, and the currency of customer payment adds up according to the face amount of coin.Automatic vending machine is equipped with cargo allocation device, comprises zero or the identical goods of multiple price in each cargo allocation device, and client selects goods and quantity thereof by selecting cargo allocation device.If have enough goods in cargo allocation device, and the monetary value of customer payment is not less than the price of required goods, and goods will be assigned to goods transfer port and give client, and is restored to by suitable change and moves back coin hole.If divider does not have enough goods, then equal with the monetary value of customer payment coin will be sent back to and move back coin hole.If the monetary value of customer payment is less than the price of required goods, wait client is knocked down more currency by machine.If client determine do not buy selected goods, he throw in into currency will exit from moving back coin hole.Automatic saler system requires to move back counterfeit money and move back coin operation and must complete in 5s.Data flow diagram uses example as shown in Figure 4, and fault tree uses example as shown in Figure 5, and decision table uses example as shown in Figure 6.

Claims (10)

1., based on a Black-box Testing of Embedded Software case generation method for static model, it is characterized in that said method comprising the steps of:
Nested mechanism between step one, employing data flow diagram, fault tree, cause-and-effect diagram, decision table, figure and the expansion semanteme of figure build the static model of embedded software;
Step 2, the static model of embedded software that step one builds to be verified, and manually plan test item according to test purpose, then automatic completion and validity decision are carried out to test item, finally fill in the title of test item;
The completion of described test item adopts the classical ergodic algorithm of figure to realize;
The validity decision of described test item is: the meaningless pel of data flow diagram comprises " with relation node ", " or relation node " and " XOR relation node ", the meaningless pel of fault tree comprises " line ", " with door " and disjunction gate, the meaningless pel of cause-and-effect diagram comprises " line ", if test item is made up of above-mentioned insignificant pel entirely, then will be judged as illegal;
Step 3, automatically generate Black-box testing Cases set corresponding to test item according to Testing criteria and Test cases generation algorithm, and test item and test use cases are incorporated into storehouse and preserve, wherein often kind of test item has corresponding Test cases generation algorithm;
Described test item is divided into data flow diagram test item, fault tree test item, cause-and-effect diagram test item, decision table test item, time domain test item and interface testing item;
Described Testing criteria comprises test path coverage criterion, the minimal cut set coverage criterion of fault tree, the first attribute coverage criterion combining coverage criterion, interface between coverage criterion, time domain coverage criterion, time coupled zone of condition metaaction of decision table of data flow diagram;
Step 4, test item and test case set to be managed, comprise interpolation, delete, revise and check operation, to improve the generation of test case set.
2. a kind of Black-box Testing of Embedded Software case generation method based on static model according to claim 1, is characterized in that the nested mechanism between the figure described in step one comprises:
(1) data flow diagram divides layer building, is specially the nested subdata flow graph of data mart modeling of data flow diagram;
(2) the data mart modeling nested fault tree of data flow diagram, cause-and-effect diagram and decision table;
(3) the nested sub-fault tree of the bottom event of fault tree.
3. a kind of Black-box Testing of Embedded Software case generation method based on static model according to claim 2, is characterized in that the expansion semanteme of the figure described in step one comprises:
(1) for the pel of data flow diagram with the addition of test semanteme, comprise data mart modeling and with the addition of inverse program, time domain, hardware and interruption attribute;
(2) for the pel of fault tree with the addition of test semanteme, comprise bottom event and with the addition of CMP attribute;
(3) for decision table with the addition of test semanteme, comprise and automatically generate decision table according to logical expression, add the precondition of decision table.
4. a kind of Black-box Testing of Embedded Software case generation method based on static model according to claim 3, is characterized in that the condition of the verification demand fulfillment described in step 2 is as follows:
(1) for data mart modeling, data flow diagram requires data conservation;
(2) for the layering of data flow diagram, data flow diagram requires Parent Submap balance;
(3) event Constraint of fault tree, comprise a fault tree and only have a top event, bottom event must use CMP attribute quantification to describe;
(4) cause-and-effect diagram essential factor constraint, comprise a cause-and-effect diagram only have one main because of;
(5) the condition metaaction tuple contract bundle of decision table, comprises condition unit and the equal non-NULL of action element of a regularization term.
5. a kind of Black-box Testing of Embedded Software case generation method based on static model according to claim 4, is characterized in that being specially according to Testing criteria and Black-box testing Cases set corresponding to Test cases generation algorithm automatically generated data flow graph test item in described step 3:
Algorithmic procedure:
1) in legal complete test item I1, all test path set W1 are obtained based on test path coverage criterion traversal;
2) make simple test set of paths U1 be empty set, the test case set T1 of data flow diagram test item is empty set;
3) all test path set W1 are traveled through one by one, if current test path set is W1 [i];
4) by test path set reduction rules, abbreviation is carried out to current test path set W1 [i], obtain all simple test path S1 in this test path set;
5) S1 is added in simple test set of paths U1, gets back to step 3) continue traversal until all test path set W1 are crossed by abbreviation;
6) simple test set of paths U1 is traveled through one by one, if current simple test path is U1 [j];
7) according to the test case set M1 of the examination dot generation U1 [j] in current simple test path U1 [j];
8) M1 is added in test case set T1, gets back to step 6) continue traversal until simple test path in simple test set of paths U1 all generated test use cases is only combined into;
9) the test case set T1 of return data flow graph test item.
6. a kind of Black-box Testing of Embedded Software case generation method based on static model according to claim 5, is characterized in that the Black-box testing Cases set automatically generating fault tree test item corresponding according to Testing criteria and Test cases generation algorithm in described step 3 is specially:
Algorithmic procedure:
1) in legal complete test item I2, minimal cut set algorithm is adopted to obtain all minimal cut set W2 of fault tree, so that based on the set of minimal cut set coverage criterion generating test use case;
2) the test case set T2 making fault tree test item is empty set;
3) all minimal cut set W2 are traveled through one by one, if current minimal cut set is W2 [i];
4) according to the test case set M2 of the examination dot generation W2 [i] of current minimal cut set W2 [i];
5) M2 is added in the test case set T2 of fault tree test item, gets back to step 3) until all minimal cut set W2 generated test use cases is combined into only;
6) pel in legal complete fault tree test item I2 is traveled through one by one, if current pel is I2 [j];
7) if I2 [j] is bottom event, the test case set M3 of I2 [j] is so generated according to the CMP attribute of bottom event I2 [j];
8) M3 is added in the test case set T2 of fault tree test item, gets back to step 6) until the pel in legal complete fault tree test item I2 was all traversed;
9) the test case set T2 of fault tree test item is returned.
7. a kind of Black-box Testing of Embedded Software case generation method based on static model according to claim 6, is characterized in that the Black-box testing Cases set automatically generating cause-and-effect diagram test item corresponding according to Testing criteria and Test cases generation algorithm in described step 3 is specially:
Algorithmic procedure:
1) in legal complete test item I3, traversal obtains all bottom essential factor W3 of I3;
2) the test case set T3 making cause-and-effect diagram test item is empty set;
3) all bottom essential factor W3 are traveled through one by one, if current bottom essential factor is W3 [i];
4) according to the test case set M4 of the examination dot generation W3 [i] of bottom essential factor W3 [i];
5) M4 is added the test case set T3 of cause-and-effect diagram test item, gets back to step 3) until all bottom essential factor W3 generated test use cases is combined into only;
6) the test case set T3 of cause-and-effect diagram test item is returned.
8. a kind of Black-box Testing of Embedded Software case generation method based on static model according to claim 7, is characterized in that the Black-box testing Cases set automatically generating decision table test item corresponding according to Testing criteria and Test cases generation algorithm in described step 3 is specially:
Algorithmic procedure:
1) all conditions metaaction unit combination W4 of decision table DT is obtained, so that based on the coverage criterion generating test use case set of condition metaaction unit;
2) the test case set T4 making decision table test item is empty set;
3) all conditions metaaction unit combination W4 is traveled through one by one, if current condition metaaction unit is combined as W4 [i];
4) W4 [i] is organized as a test case M5, the cooperation of condition tuple is test input, and action element is that test oracle exports;
5) M5 is added the test case set T4 of decision table test item, returns step 3) until all conditions metaaction unit combination W4 generated test case;
6) the test case set T4 of decision table test item is returned.
9. a kind of Black-box Testing of Embedded Software case generation method based on static model according to claim 8, is characterized in that being specially according to the Black-box testing Cases set of Testing criteria and Test cases generation algorithm automatic rise time domain test item correspondence in described step 3:
Time domain test item described in step 3 is divided into " data mart modeling time domain test item " and " between time coupled zone functional test item ", and data mart modeling time domain test item generates corresponding Black-box testing Cases set and is specially:
Algorithmic procedure:
1) in legal complete test item I4, traversal obtains the data mart modeling W5 of all time domain attribute non-NULLs;
2) the test case set T5 making data mart modeling time domain test item is empty set;
3) the data mart modeling W5 of all time domain attribute non-NULLs is traveled through one by one, if current data mart modeling is W5 [i];
4) the time domain list TDL of current data mart modeling W5 [i] is traveled through one by one, if current time domain is TDL [j];
5) based on time domain coverage criterion, the test case set M6 of W [i] is generated according to the time domain TDL [j] of current data mart modeling W5 [i];
6) M6 is added in the test case set T5 of data mart modeling time domain test item, gets back to step 4) until the time domain list of W5 [i] all generated test use cases is combined into only;
7) step 3 is got back to) until the data mart modeling in W5 was all traversed;
8) the test case set T5 of return data domain test process time item;
The Black-box testing Cases set that between time coupled zone, the generation of functional test item is corresponding is specially:
Algorithmic procedure:
1) in legal complete test item I5, traversal obtains the data mart modeling W6 of all time domain attribute non-NULLs;
2) in W6, obtain the time domain S2 of all overlaps and record the data mart modeling comprising territory overlapping time;
3) the test case set T6 making functional test item between time coupled zone is empty set;
4) the time domain S2 of all overlaps is traveled through one by one, if current territory overlapping time is S2 [i];
5) based on coverage criterion between time coupled zone, according to generating the test case set M7 of many data mart modeling at S2 [i] territory S2 overlapping time [i];
6) by the test case set T6 of functional test item between M7 joining day coupled zone, step 4 is got back to) until the time domain S2 of all overlaps generated test use cases is combined into only;
7) the test case set T6 of functional test item between time of return coupled zone.
10. a kind of Black-box Testing of Embedded Software case generation method based on static model according to claim 9, is characterized in that the Black-box testing Cases set automatically generating interface testing item correspondence according to Testing criteria and Test cases generation algorithm in described step 3 is specially:
Algorithmic procedure:
1) the test case set T7 making interface testing item is empty set;
2) based on interface attributes coverage criterion, generate proper testing use-case M8, namely H attribute all adopts normal value;
3) M8 is added in the test case set T7 of interface testing item;
4) interface attributes set H is traveled through one by one, if current interface attributes is H [i];
5) based on interface attributes coverage criterion, attribute H [i] is set to inefficacy, all the other interface attributes are set to normally, generating test use case M8;
6) M8 is added in the test case set T7 of interface testing item, gets back to step 4) until attribute in interface attributes set H is all set as inefficacy and generated test case;
7) the test case set T7 of interface testing item is returned.
CN201410765285.8A 2014-12-11 2014-12-11 Embedded software black-box test case generation method based on static models Pending CN104375943A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410765285.8A CN104375943A (en) 2014-12-11 2014-12-11 Embedded software black-box test case generation method based on static models

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410765285.8A CN104375943A (en) 2014-12-11 2014-12-11 Embedded software black-box test case generation method based on static models

Publications (1)

Publication Number Publication Date
CN104375943A true CN104375943A (en) 2015-02-25

Family

ID=52554878

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410765285.8A Pending CN104375943A (en) 2014-12-11 2014-12-11 Embedded software black-box test case generation method based on static models

Country Status (1)

Country Link
CN (1) CN104375943A (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104835239A (en) * 2015-05-13 2015-08-12 昆山古鳌电子机械有限公司 Coin identification apparatus and identification method thereof
CN104991863A (en) * 2015-07-14 2015-10-21 株洲南车时代电气股份有限公司 Method for automatically generating testing case on basis of function block diagram testing module
CN105718372A (en) * 2016-01-22 2016-06-29 珠海市精实测控技术有限公司 Black-box test case generation and automatic test method for electric control board
CN107608895A (en) * 2017-09-22 2018-01-19 深圳航天科技创新研究院 Software testing generation method, system and storage medium based on static models
CN107783901A (en) * 2017-09-26 2018-03-09 深圳市牛鼎丰科技有限公司 Method for generating test case, device, computer equipment and storage medium
CN107832225A (en) * 2017-11-22 2018-03-23 中国航空工业集团公司西安飞机设计研究所 A kind of flight management software test case design method
CN107844417A (en) * 2017-10-20 2018-03-27 东软集团股份有限公司 Method for generating test case and device
CN107885487A (en) * 2017-11-20 2018-04-06 广西师范大学 The method that a kind of test of information physical emerging system and need satisfaction are examined
CN113238932A (en) * 2021-04-30 2021-08-10 西南电子技术研究所(中国电子科技集团公司第十研究所) Automatic test case generation method
CN113419964A (en) * 2021-07-14 2021-09-21 上海浦东发展银行股份有限公司 Test case generation method and device, computer equipment and storage medium
CN113419970A (en) * 2021-08-24 2021-09-21 卡斯柯信号(北京)有限公司 Interface fault testing method and device
CN113806232A (en) * 2021-10-08 2021-12-17 中国航空综合技术研究所 Model-based embedded software test case generation model

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060101331A1 (en) * 2004-11-05 2006-05-11 Institute For Information Industry Methods and systems for automated test-case generation
CN101521899A (en) * 2009-03-31 2009-09-02 大连海事大学 System and method for on-computer test of mobile applications
CN102087630A (en) * 2011-01-27 2011-06-08 中国人民解放军63928部队 Method for generating U2TP testing model from UML behavior design model
CN102419728A (en) * 2011-11-01 2012-04-18 北京邮电大学 Method for determining software test process sufficiency based on coverage rate quantitative indicators
CN102968368A (en) * 2012-08-30 2013-03-13 中国人民解放军63928部队 Embedded test use case design and generation method for traversal scene state diagram
US20130159774A1 (en) * 2011-12-19 2013-06-20 Siemens Corporation Dynamic reprioritization of test cases during test execution
CN103530228A (en) * 2013-09-27 2014-01-22 西安电子科技大学 Software testing method based on model
CN103729293A (en) * 2013-12-30 2014-04-16 华东师范大学 GUI testing method based on UML activity diagrams

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060101331A1 (en) * 2004-11-05 2006-05-11 Institute For Information Industry Methods and systems for automated test-case generation
CN101521899A (en) * 2009-03-31 2009-09-02 大连海事大学 System and method for on-computer test of mobile applications
CN102087630A (en) * 2011-01-27 2011-06-08 中国人民解放军63928部队 Method for generating U2TP testing model from UML behavior design model
CN102419728A (en) * 2011-11-01 2012-04-18 北京邮电大学 Method for determining software test process sufficiency based on coverage rate quantitative indicators
US20130159774A1 (en) * 2011-12-19 2013-06-20 Siemens Corporation Dynamic reprioritization of test cases during test execution
CN102968368A (en) * 2012-08-30 2013-03-13 中国人民解放军63928部队 Embedded test use case design and generation method for traversal scene state diagram
CN103530228A (en) * 2013-09-27 2014-01-22 西安电子科技大学 Software testing method based on model
CN103729293A (en) * 2013-12-30 2014-04-16 华东师范大学 GUI testing method based on UML activity diagrams

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
周景才: "基于模型驱动的测试用例自动生成技术研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104835239A (en) * 2015-05-13 2015-08-12 昆山古鳌电子机械有限公司 Coin identification apparatus and identification method thereof
CN104991863A (en) * 2015-07-14 2015-10-21 株洲南车时代电气股份有限公司 Method for automatically generating testing case on basis of function block diagram testing module
CN105718372B (en) * 2016-01-22 2018-05-18 珠海市精实测控技术有限公司 A kind of electric-controlled plate Black-box testing Cases generation and automatic test approach
CN105718372A (en) * 2016-01-22 2016-06-29 珠海市精实测控技术有限公司 Black-box test case generation and automatic test method for electric control board
CN107608895A (en) * 2017-09-22 2018-01-19 深圳航天科技创新研究院 Software testing generation method, system and storage medium based on static models
CN107783901A (en) * 2017-09-26 2018-03-09 深圳市牛鼎丰科技有限公司 Method for generating test case, device, computer equipment and storage medium
CN107783901B (en) * 2017-09-26 2020-05-12 深圳市牛鼎丰科技有限公司 Test case generation method and device, computer equipment and storage medium
CN107844417A (en) * 2017-10-20 2018-03-27 东软集团股份有限公司 Method for generating test case and device
CN107844417B (en) * 2017-10-20 2020-06-16 东软集团股份有限公司 Test case generation method and device
CN107885487A (en) * 2017-11-20 2018-04-06 广西师范大学 The method that a kind of test of information physical emerging system and need satisfaction are examined
CN107832225A (en) * 2017-11-22 2018-03-23 中国航空工业集团公司西安飞机设计研究所 A kind of flight management software test case design method
CN113238932A (en) * 2021-04-30 2021-08-10 西南电子技术研究所(中国电子科技集团公司第十研究所) Automatic test case generation method
CN113238932B (en) * 2021-04-30 2024-03-19 西南电子技术研究所(中国电子科技集团公司第十研究所) Automatic test case generation method
CN113419964A (en) * 2021-07-14 2021-09-21 上海浦东发展银行股份有限公司 Test case generation method and device, computer equipment and storage medium
CN113419970A (en) * 2021-08-24 2021-09-21 卡斯柯信号(北京)有限公司 Interface fault testing method and device
CN113806232A (en) * 2021-10-08 2021-12-17 中国航空综合技术研究所 Model-based embedded software test case generation model
CN113806232B (en) * 2021-10-08 2023-05-09 中国航空综合技术研究所 Model-based embedded software test case generation model

Similar Documents

Publication Publication Date Title
CN104375943A (en) Embedded software black-box test case generation method based on static models
CN104461887A (en) Embedded software black-box test case generation method based on dynamic model
CN102341781B (en) Software test bed generation
CN106991183B (en) A kind of packaging method and system of business intelligence ETL
CN102236672B (en) A kind of data lead-in method and device
CN107844424B (en) Model-based testing system and method
Măruşter et al. Redesigning business processes: a methodology based on simulation and process mining techniques
CN108108297A (en) The method and apparatus of automatic test
Kuusela et al. Requirements engineering for product families
van der Aalst Distributed process discovery and conformance checking
CN104866426A (en) Software test integrated control method and system
US8560893B1 (en) Systems and methods for automatically generating executable system level-tests from a partially specified scenario
CN103646104A (en) Hard real-time fault diagnosis method and system
CN106951369A (en) The management method and device of a kind of joint debugging test
CN110362562A (en) The method and system of big data sample drawn data
CN111695805B (en) Intelligent contract model construction method and system for legal contracts
CN109408360A (en) A kind of software reliability estimation method and system
CN105912461A (en) Test method and system for software agility
CN110083814A (en) A kind of report form generation method and device, computer readable storage medium
CN107133020A (en) A kind of data processing method, system, interface end and server
CN111813739A (en) Data migration method and device, computer equipment and storage medium
US20100161676A1 (en) Lifecycle management and consistency checking of object models using application platform tools
CN108897686A (en) It is complete to record separately automated testing method and device
CN114817022A (en) Railway electronic payment platform test method, system, equipment and storage medium
Ereth et al. A Capability Approach for Designing Business Intelligence and Analytics Architectures.

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20150225