CN103226512A - Component composition test method based on combination of component test case suites - Google Patents
Component composition test method based on combination of component test case suites Download PDFInfo
- Publication number
- CN103226512A CN103226512A CN2013101137929A CN201310113792A CN103226512A CN 103226512 A CN103226512 A CN 103226512A CN 2013101137929 A CN2013101137929 A CN 2013101137929A CN 201310113792 A CN201310113792 A CN 201310113792A CN 103226512 A CN103226512 A CN 103226512A
- Authority
- CN
- China
- Prior art keywords
- test
- test case
- belong
- relevant
- occurs
- 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
Links
Images
Abstract
The invention discloses a component composition test method based on combination of component test case suites, and belongs to the field of software testing. The component composition test method uses single component test case suites to combine new test cases used for component composition testing, so that the effects of reusing the conventional work and saving the development cost are achieved. According to the method, through the analysis of interactive component activities, composition test cases are generated on the condition that model assembly is not performed, and accordingly, a series of problems during model assembly are avoided.
Description
Technical field
The present invention relates to a kind of member assembling method of testing, belong to the technical field of software test based on the combination of component testing set of uses case.
Background technology
The member assembling is based on the component software exploitation, and (the member assembling test generally is by the model combination at present, generates the interactive testing use-case from the entire system model that obtains for Component-based Software Development, core technology CBSD).The problem of bringing like this one is in the fashionable blast that is easy to generate state space of model group, the 2nd, and some work of finishing when unit testing will repeat.In the process of CBSD, can be multiplexing except member, also there is the character of reusability in the test use cases of member.
The test use cases of a member has comprised test process and the test result to function that this member provides.In general, except at some special user's request, member all unlikely changes a lot on interface and function.Therefore in the CBSD process, can come the composite software system by multiplexing existing member, also can multiplexing corresponding test case be used for carrying out the member assembling test.
Summary of the invention
The present invention proposes a kind of member assembling method of testing based on the test case combination, utilizes single component testing set of uses case, and the test case that combination makes new advances is used for the member assembling test, thereby reaches multiplexing existing work, saves the effect of cost of development.
Technical scheme of the present invention: a kind of member assembling method of testing based on the combination of component testing set of uses case, establish the member M that passes through single component testing
1With M
2Be assembled into the P of system, test philosophy is C, T
M1And T
M2Be respectively member M
1With M
2Satisfy the test use cases of C-adequate-for-P, O is an output interface, and I is an input interface, O
M1Be M
1Output interface set, I
M1Be M
1Input interface set;
Definition: if the test use cases T of member M
MComprise δ D
C(P-relevant (D
M)) at least one test data in each subdomain, then claim T
MSatisfy C-adequate-for-P, wherein, D
MBe the input subdomain of member M, P-relevant (D
M) employed D when representing the P of system component invoking M
MIn subclass, δ D
C(D
M) represent that the member M by test philosophy C derivation all imports the multiset of subdomain;
Concrete testing procedure is as follows:
Step 1: definition member M
1And M
2, when
And
Or
The time claim that they are assemblnig, IP wherein
M1Expression M
1Provide the set of interfaces of service, IR
M1Expression M
1The set of interfaces of request service, IP
M2Expression M
2Provide the set of interfaces of service, IR
M2Expression M
2If the set of interfaces of request service is M
1And M
2Can not assemble then end operation;
Step 2: obtain member M
2Need M
1The service that provides, i.e. IP
M1∩ IR
M2, obtain member M
1Need M
2The service that provides, i.e. IP
M2∩ IR
M1, draw M
1And M
2The union that needs the service that the other side provides, i.e. Shared (M
1, M
2)=(IP
M1∩ IR
M2) ∪ (IP
M2∩ IR
M1);
Step 3: from T
M1With T
M2In find out and integrated relevant test use cases, at test use cases T
M1In each test case t
i, judge member M
1Each output interface O
iWhether be present in test case t
iIn, if O
iBe present in t
iIn, and O
iBelong to IP
M1∩ IR
M2, test case t is described so
iBelong to T
M1In with IP
M1∩ IR
M2Relevant part is with (IP
M1∩ IR
M2) _ relevant (T
M1) [k] note t
i, wherein i represents M
1The number of middle test case;
At member M
1Each input interface I
j, judge I
jWhether be present in test case t
iIn, if I
jBe present in t
iIn, and I
jBelong to IP
M2∩ IR
M1, test case t is described so
iBelong to T
M1In with IP
M2∩ IR
M1Relevant part is with (IP
M2∩ IR
M1) _ relevant (T
M1) [l] note I
j, wherein, j represents M
1The number of middle input interface;
Again at test use cases T
M2In each test case t
k, judge member M
2Each output interface O
kWhether be present in test case t
kIn, if O
kBe present in t
kIn, and O
kBelong to IP
M2∩ IR
M1, test case t is described so
kBelong to T
M2In with IP
M2∩ IR
M1Relevant part is used
(IP
M2∩ IR
M1) _ relevant (T
M2) [k] note t
k, wherein, k represents M
2Middle test case number;
At member M
2Each input interface I
l, judge I
lWhether be present in test case t
kIn, if I
lBe present in t
kIn, and I
lBelong to IP
M1∩ IR
M2, test case t is described so
kBelong to T
M2In with IP
M1∩ IR
M2Relevant part is with (IP
M1∩ IR
M2) _ relevant (T
M2) [l] note I
l, wherein, l represents M
2The number of middle input interface;
Step 4: the interface according to coupling, carry out subtracting approximately of test case, to Shared (M
1, M
2) in each interface a, T
M1, T
M2In each and IP
M1∩ IR
M2And IP
M2∩ IR
M1Relevant test case t
p, the type of pressing a is with t
pBe set at a fixed value, remove identical test case, wherein, p represents dependence test use-case number;
Step 5: the syntagmatic in the determining step 4 between the gained test case, calculation combination result:
At T
M1In each and IP
M1∩ IR
M2Relevant test case t
iAnd T
M2In each and IP
M1∩ IR
M2Relevant test case t
kCarry out following processing,
(501): judge t
iIn arbitrary interface x
iWhether belong to IP
M1∩ IR
M2If, x
iBelong to IP
M1∩ IR
M2, simultaneously, have t
kAnd x
iBelong to t
k, then continue to judge x
iAt t
iMiddle number of times and the x that occurs
iAt t
kWhether the middle number of times that occurs equates, if x
iAt t
iMiddle number of times and the x that occurs
iAt t
kThe middle number of times that occurs equates, enters step (502);
(502): judge t
kIn arbitrary interface y
iWhether belong to IP
M1∩ IR
M2If, y
iBelong to IP
M1∩ IR
M2, simultaneously, have t
iAnd y
iBelong to t
i, then continue to judge y
iAt t
iMiddle number of times and the y that occurs
iAt t
kWhether the middle number of times that occurs equates, if y
iAt t
iMiddle number of times and the y that occurs
iAt t
kThe middle number of times that occurs equates, enters step (503);
(503): through the t of step (501), (502) processing
iWith t
kCombination belongs to M
1With M
2The assembling test use-case, with IntTest (M
1M
2) [k] record, otherwise record not;
Again at T
M2In each and IP
M2∩ IR
M1Relevant test case t
kAnd T
M1In each and IP
M2∩ IR
M1Relevant test case t
iCarry out following processing,
(504): judge t
kIn arbitrary interface x
kWhether belong to IP
M2∩ IR
M1If, x
kBelong to IP
M2∩ IR
M1, simultaneously, have t
iAnd x
kBelong to t
i, then continue to judge x
kAt t
kMiddle number of times and the x that occurs
kAt t
iWhether the middle number of times that occurs equates, if x
kAt t
kMiddle number of times and the x that occurs
kAt t
iThe middle number of times that occurs equates, enters step (505);
(505): judge t
iIn arbitrary interface y
kWhether belong to IP
M2∩ IR
M1If, y
kBelong to IP
M2∩ IR
M1, simultaneously, have t
kAnd y
kBelong to t
k, then continue to judge y
kAt t
kMiddle number of times and the y that occurs
kAt t
iWhether the middle number of times that occurs equates, if y
kAt t
kMiddle number of times and the y that occurs
kAt t
iThe middle number of times that occurs equates, enters step (506);
(506): through the t of step (504), (505) processing
iWith t
kCombination belongs to M
1With M
2The assembling test use-case, with IntTest (M
1M
2) [k] record, otherwise record not;
The union of all test cases that process above-mentioned steps 1 to step 5 obtains is exactly M
1With M
2The set of uses case of assembling test.
Further, in step 5, the property capable of being combined of test case is judged by following method:
The test use cases of member P and Q is respectively T
PAnd T
Q, test case
t
1=(v
1, i
1, o
1, i
2, o
2..., i
m, o
n, v
n) ∈ T
P, t
2=(v
1', i
1', o
1', i
2', o
2' ..., i
m', o
n', v
n') ∈ T
Q, if satisfy:
(2)
Wherein, Onum is that x is at t
1The middle number of times that occurs, Inum is that x is at t
2The middle number of times that occurs, and
Onum=Inum;
Then claim test case t
1And t
2Can make up, wherein, v
1Be t
1The state of system before carrying out, i
1, i
2I
mThe expression input operation, o
1, o
2O
nThe expression output function, v
nBe t
1Carry out the state of back system; v
1' be t
2The state of system before carrying out, i
1', i
2' ... i
m' the expression input operation, o
1', o
2' ... o
n' the expression output function, v
n' be t
2Carry out the state of back system, m and n are natural number.
Further, when a plurality of members are assembled,, make it be varied to the form of two above-mentioned members assemblings by the assembling in twos of member.
Method disclosed by the invention generates the assembling test use-case, thereby has avoided the fashionable a series of problems of model group by the analysis to the component interactive activity under the situation of not carrying out the model assembling.
Description of drawings
Fig. 1 is the universal model figure of member assembling, wherein:
Can cause M in the input domain of the 1 expression P of system
1Invoked part is expressed as M
1-traverse (D
P);
Can cause M in the input domain of the 2 expression P of system
1Be called and and IP
M1∩ IR
M2Relevant input subdomain;
Can cause M in the input domain of the 3 expression P of system
2Be called and and IP
M2∩ IR
M1Relevant input subdomain;
Can cause M in the input domain of the 4 expression P of system
2Invoked part is expressed as M
2-traverse (D
P).
Fig. 2 is a component order assembling exemplary plot.
Fig. 3 is the IT-on-CUTC algorithm flow chart.
Embodiment
The member that the present invention's supposition will be assembled only need be tested the mutual situation between the different component all by unit testing (single component testing) when member is assembled.Assemblnig member is realized the transmission of information between the two by the interface of coupling, and the emphasis of member assembling is a correctness of guaranteeing that this information is transmitted.The test use cases of single member can be verified a relation between the member input and output, and the combination by test case, can realize the assembling test of member.
We at first provide three definition that will use,
Definition 1(member): Component is one two tuple: Component=<I
C, P
C>, wherein,
I
C=<IP
C, IR
C>be the set of component interface static nature, wherein IP
C={ ip
C1, ip
C2..., ip
CmBe the set of interfaces that member provides service, IR
C={ ir
C1, ir
C2..., ir
CnBe the set of interfaces of member request service, each interface comprises quantity, particular type, the invariant of parameter, precondition and postcondition;
Definition 2 (but assembleabilities of member): two member P and Q are if satisfy condition:
Or
Claim that then they are assemblnig.Make Shared (P, Q)=(IP
P∩ IR
Q) ∪ (IP
Q∩ IR
P), we represent the assembling of two members with P#Q.
Definition 3 (test case): test case t are ordered sequences of one group of state and input and output interface operation, with t=(v
1, i
1, o
1, i
2, i
3, o
2..., i
m, o
n, v
n) expression.v
1Be the state of system before the t execution, i represents input operation, and o represents output function, v
nBe the state of t execution back system, n and m are generally unequal.
Illustrate: in a test case, may exist a plurality of continuous input correspondences an output, perhaps an input (a plurality of continuous input) corresponding the situation of a plurality of continuous outputs, wherein each interface operation can be got a plurality of different values.
For member M, generating test case according to certain test philosophy C is exactly the representative data that selection can meet the demands in the input space of M.If a plurality of members all have the test use cases that satisfies test philosophy C, and have mutual interface to fit together, whether the combination of test use cases can effectively be tested and need analyze the validity of test case combination component composition so.We analyze this problem by the related notion of input space subdomain.
Analytic system and comprise relation between the test use cases of member, provide two related definitions.In the subdomain strategy based on system architecture, subdomain is defined as comprising all input set that can cause a specific code element to be performed.Supposing has the P of system, wherein includes member M, based on the testing adequacy criterion C of subdomain, D
PBe the input subdomain of P, D
MInput subdomain for member M.M-traverse (D
P) expression D
PIn can cause the set of invoked all input elements of M, M-bypass (D
P) expression D
PIn with the irrelevant input element set of M; P-relevant (D
M) employed D when representing P component invoking M
MIn subclass, P-irrelevant (D
M) the untapped D of expression P
MSubclass; δ D
C(D
P) be the multiset of all importing subdomain by the system P that C derives, δ D
C(D
M) be the multiset of all importing subdomain by the member M that C derives.
Definition 4 (C-adequate): if T
PComprise δ D
C(D
P) at least one test data in each subdomain, then claim the test use cases T of the P of system
PSatisfy C-adequate; Equally, if T
MComprise δ D
C(D
M) at least one test data in each subdomain, then claim the test use cases T of member M
MSatisfy C-adequate.
Definition 5 (C-adequate-for-P): if T
MComprise δ D
C(P-relevant (D
M)) at least one test data in each subdomain, then claim the test use cases T of member M
MSatisfy C-adequate-for-P.
System P comprises member M, and definition 5 is the test use cases T that describe M
MThe notion of validity for P.If P calls δ D
C(D
M) each subdomain in have data at least by T
MTest, then think T
MFor program P, can satisfy test philosophy C.Above-mentioned notion to total system and wherein the test use cases of the member that uses analyze respectively, wherein C-adequate is the notion that the validity of single test use cases is measured, and C-adequate-for-P comprehensively considers system's member employed with it, then the validity of analytical test set of uses case.
But we have verified the assembleability of selected member behavior model in the design phase at supposition, so can produce of deadlock after the member assembling and situation such as illegal state, only consider how component groups is fitted together and test job accordingly in the assembling stage.
Utilize above-mentioned notion, the assembling mode that we are different according to member is analyzed the mutual situation that may exist between the member, draws the universal model of member assembling, as shown in Figure 1.Situation when only providing two member assemblings among the figure, the situation of a plurality of member assemblings similarly can realize by the assembling in twos of member.
System shown in Figure 1 P is by member M
1With M
2Assembling realize, can cause M in the input domain of line 1 and the 2 expression P of system
1Invoked part is expressed as M
1-traverse (D
P), can cause M in the input domain of line 3 and the 4 expression P of system
2Invoked part is expressed as M
2-traverse (D
P).Dotted line 2 expression and IP
M1∩ IR
M2Relevant input subdomain, dotted line 3 expression and IP
M2∩ IR
M1Relevant input subdomain.
According to the assembling mode difference, member assembling is divided into four kinds of fundamental types: in proper order, select, repeat and parallel assembling, Fig. 1 has described the universal models of two member assemblings.If line 1,3,4 does not wherein have, have only dotted line 2, Fig. 1 just becomes M
1Whole outputs as M
2Situation during input, then this model representation member M
1With M
2Order assembling; If line 2,3 is empty, the alternative condition between 1,4 can be realized member M
1With M
2Selection assembling; 1,2,3,4 then do not represent M for sky
1With M
2It is parallel assembled relation; Repeating to assemble the input that can be re-used as himself by the output with a member realizes.
As can be seen from Figure 1 after the member assembling, the function part of system P can be by M
1And M
2Realize that separately another part may be finished by the interactive collaboration of the two.If M
1With M
2All by unit testing and can be met the test use cases T of C-adequate-for-P
M1And T
M2, then the test of figure center line 1 part can be passed through T
M1In the relevant portion input that is mapped as P realize that the test of line 4 parts can be by T
M2In the relevant portion input that is mapped as P finish.Dotted line 2 expression M
1Offer M
2Input, its test can be by T
M1And T
M2In with IP
M1∩ IR
M2Relevant test case makes up and realizes, the test of same dotted line 3 can by with IP
M2∩ IR
M1Relevant test case makes up to be finished.
The present invention mainly studies the interactive testing when how the test use cases of multiplexing single member carries out the member assembling, promptly to the test of 2,3 parts of the dotted line among Fig. 1.Certain interface I for member M
M, T
MCan be divided into and this interface related part and the part that has nothing to do with this interface.The test use cases T of member M
MIn with interface I
MRelevant test use cases, we use I
M_ relevant (T
M) expression, i.e. I
M_ relevant (T
M) in the operation of each test case all include interface I
MT
MIn with interface I
MIncoherent test case is gathered us and is used I
M_ irrelevant (T
M) expression, I
M_ irrelevant (T
M)=T
M-(I
M_ relevant (T
M)), promptly in the operation of each test case do not comprise interface I
M
By above-mentioned analysis,, provide the definition of test case property capable of being combined and test case combination below in conjunction with existing definition.
Definition 6 (property capable of being combined of test case): the test use cases of member P and Q is respectively T
PAnd T
Q, test case t
1=(v
1, i
1, o
1, i
2, o
2..., i
m, o
n, v
n) ∈ T
P, t
2=(v
1', i
1', o
1', i
2', o
2' ..., i
m', o
n', v
n') ∈ T
Q, if satisfy:
(2)
Onum is that x is at t
1The middle number of times that occurs,
Inum is that x is at t
2The middle number of times that occurs, and Onum=Inum;
Inum is that x is at t
2The middle number of times that occurs,
Onum is that x is at t
1The middle number of times that occurs, and Inum=Onum;
Then claim test case t
1And t
2Can make up.
Definition 6 has illustrated the requirement to the test case combination, at first the two must have the interface operation that is complementary, require then in the output of a test case, if relate to the interactive interface operation of two members, then require this operation must appear in the input of another test case and occurrence number identical.Condition (1) has guaranteed that test case capable of being combined has the interface that is complementary, and condition (2) has then guaranteed test case capable of being combined interface quantity and type consistent when interactive operation.Such as, suppose t
1Certain output information " ok " belong to Shared (P Q), but do not belong to t
2Input, this moment t
2That need in the input operation is Shared (P, Q) in " fail ".Then show t
1The operation described sequence and t
2Do not match, the two can not make up in this case.
The combination of definition 7(test case): suppose test case t
1=(v
1, i
1, o
1, i
2, o
2..., o
M-1, i
m, o
n, v
n) ∈ T
P, t
2=(v
1', i
1', o
1', i
2', o
2' ..., i
M-1', o
M-1', i
m', o
n', v
n') ∈ T
Q, Shared (P, Q)=(x
1, x
2), x wherein
1=o
1=i
2', x
2=o
M-1'=i
mT as a result after then making up
1T
2For:
t
1·t
2=((v
1,v
1'),i
1,i
1',o
1',i
2,o
2,...,o
m-1,o
2',...,i
m-1',o
n,i
m',o
n',(v
n,v
n'))。
t
1T
2The state of system is (v before carrying out
1, v
1'), the state after the execution is (v
n, v
n').t
1And t
2In the sequence of operation synchronous at the interface that is complementary, and with mutual irrelevant operation can be by successively making up smoothly on the basis that keeps former sequence.In the implementation of test case, the input activity can be controlled, therefore can be by to importing movable adjustment, make t
1T
2Operation satisfy form in the definition 7.t
1T
2Formal description the ordinal relation of carrying out between two test cases, promptly require t
1Prior to t
2Operation.t
1With t
2After the combination, the interface operation that is complementary becomes internal activity, no longer belongs to inputoutput data.In order to express the matched interfaces of two test cases, the internal activity that obtains after the combination can be retained among the result.
For example: if t
1=(V
0, start?, computer; , msg! , ok?, return! , V
1), t
2=(V
0', msg?, send! , ack?, ok! , V
1'), t then
1T
2=((V
0, V
0'), start?, computer; , msg; , send! , ack?, ok; , (V
1, V
1')).
Figure 2 shows that the anabolic process of the test case of two members, two member User identification and Account are the relations of order assembling among the figure.
Suppose the test case T of User identification
1Collection comprises two test cases:
t
1=(V
b,ID?,Password?,Valid?user!,V
e);t
2=(V
b,ID?,Password?,Invalid?user!,V
e);
Suppose the test use cases T of Account
1' two test cases are also arranged:
t
1'=(V
b’,Valid?user?,User?info!,V
e’);t
2'=(V
b’,Invalid?user?,Error?info!,V
e’)。
Then the combined result of two component testing sets of uses case is:
t
1·t
1'=(V
b,ID?,Password?,Valid?user!,V
e)·(V
b’,Valid?user?,User?info!,V
e’)
=((V
b,V
b’),ID?,Password?,Valid?user;,User?info!,(V
e,V
e’));
t
2·t
2'=(V
b,ID?,Password?,Invalid?user!,V
e)(V
b’,Invalid?user?,Error?info!,V
e’)
=((V
b,V
b’),ID?,Password?,Invalid?user;,Error?info!,(V
e,V
e’))。
And t
1T
2' and t
2T
1' because of not satisfying the definition in the definition 6, so can not make up.Therefore, according to T
1And T
1', the t that is generated
1T
1' and t
2T
2' promptly be the interactive testing set of uses case of member User identification and Account.
When test case makes up, also to determine to make up the beginning and the done state of back test case, this process is comparatively simple, and only the corresponding states of two test cases need be grouped together gets final product.We ignore the introduction of this part in the content afterwards, a docking port operation part be combined into line description.
Information is mutual normally two-way in the component groups process of assembling, the analysis by Fig. 1 as can be known, if member M
1With M
2Can assemble (IP
M1∩ IR
M2) _ releva (nt
M1T represents M
1In can call M
2Test use cases, (IP
M1∩ IR
M2) _ relevant (T
M2) expression M
2In can be by M
1The test use cases that calls, the combination of these two test use cases has been represented and IP
M1∩ IR
M2Relevant test activity.In like manner, (IP
M2∩ IR
M1) _ relevant (T
M2) and (IP
M2∩ IR
M1) _ relevant (T
M1) combination can test and IP
M2∩ IR
M1Relevant activity.Therefore, the combination by the dependence test use-case can realize the test to component interactive.
Illustrate: in order effectively to generate the assembling test use-case, when test use cases made up, if the interface of a coupling becomes internal interface, then test case concentrated interface related therewith test case to subtract approximately.Can give fixed value of this interface setting, concentrate in test case then identical test case is removed.
The analysis and arrangement said process, we propose a kind of by unit testing set of uses case combination generation interactive testing use-case (Interaction Testing based on Composition of Unit Test Case, method IT-on-CUTC).This method is at first analyzed two component interfaces, determine the interface operation that relates to alternately, then test use cases is subtracted approximately, counterpart in test use cases relevant in first member and second the component testing set of uses case is made up, again the dependence test set of uses case of second member and the counterpart in first member are made up, guarantee that like this all interactive operations that relate to can both be tested; Obtain the required test use cases of component interactive test at last.The total flow process of algorithm specifically describes following (is example with two members) as shown in Figure 3:
If member M
1With M
2Be assembled into the P of system, test philosophy is C, T
M1And T
M2Be satisfied
Test use cases.O is an output interface, and i is an input interface, o
M1Be M
1Output interface set, i
M1Be M
1Input interface set.
Step1:, use IP according to definition 1 and definition 2
M1, IR
M1With IP
M2, IR
M2Judge M
1With M
2Whether can assemble, if end operation then.
Step2: obtain IP
M1∩ IR
M2With IP
M2∩ IR
M1, i.e. Shared (M
1, M
2).
Step3: from T
M1With T
M2In find out and integrated relevant test use cases:
For test use cases T
M1In each test case and member M
1Each output interface, judge each output interface o
iIf, output interface o
iBe present in test case t
iIn, and o
iBelong to IP
M1∩ IR
M2, test case t is described so
iBelong to T
M1In with IP
M1∩ IR
M2Relevant part is with (IP
M1∩ IR
M2) _ relevant (T
M1) [k] note t
iFor member M
1Each input interface, judge each input interface i
jIf, input interface i
jBe present in test case t
iIn, and i
jBelong to IP
M2∩ IR
M1, test case t is described so
iBelong to T
M1In with IP
M2∩ IR
M1Relevant part is with (IP
M2∩ IR
M1) _ relevant (T
M1) [l] note i
j
For test use cases T
M2In each test case and for member M
2Each output interface, judge each output interface o
iIf, output interface o
iBe present in test case t
iIn, and o
iBelong to IP
M2∩ IR
M1, test case t is described so
iBelong to T
M2In with IP
M2∩ IR
M1Relevant part is with (IP
M2∩ IR
M1) _ relevant (T
M2) [k] note t
iFor member M
2Each input interface, judge each input interface i
jIf, input interface i
jBe present in test case t
iIn, and i
jBelong to IP
M1∩ IR
M2, test case t is described so
iBelong to T
M2In with IP
M1∩ IR
M2Relevant part is with (IP
M1∩ IR
M2) _ relevant (T
M2) [l] note i
j
Step4: the interface according to coupling, carry out subtracting approximately of test case:
For Shared (M
1, M
2) in each interface and T
M1And T
M2In with IP
M1∩ IR
M2And IP
M2∩ IR
M1The type that relevant test case is pressed a is set at a fixed value with relevant test case, removes identical test case.
Step5: determine the syntagmatic between the gained test case among the Step3, calculation combination result:
For T
M1In each and IP
M1∩ IR
M2Relevant test case and T
M2In each and IP
M1∩ IR
M2Relevant test case is judged t
iIn arbitrary interface x
iIf, x
iBelong to IP
M1∩ IR
M2, have t
jAnd x
iBelong to t
jIf, this moment x
iAt t
iMiddle number of times and the x that occurs
iAt t
jThe middle number of times that occurs equates, continues to judge; For t
jIn arbitrary interface y
iIf, y
iBelong to IP
M1∩ IR
M2, have t
iAnd y
iBelong to t
iIf, this moment y
iAt t
iMiddle number of times and the y that occurs
iAt t
jThe middle number of times that occurs is equal, so t
iWith t
jCombination belong to M
1With M
2The assembling test use-case, with IntTest (M
1M
2) [k] record.
For T
M2In each and IP
M2∩ IR
M1Relevant test case and T
M1In each and IP
M2∩ IR
M1Relevant test case is judged t
iIn arbitrary interface x
iIf, x
iBelong to IP
M2∩ IR
M1, have t
jAnd x
iBelong to t
jIf, this moment x
iAt t
iMiddle number of times and the x that occurs
iAt t
jThe middle number of times that occurs equates, continues to judge; For t
jIn arbitrary interface y
iIf, y
iBelong to IP
M2∩ IR
M1, have t
iAnd y
iBelong to t
iIf, this moment y
iAt t
iMiddle number of times and the y that occurs
iAt t
jThe middle number of times that occurs is equal, so t
iWith t
jCombination belong to M
1With M
2The assembling test use-case.The union of above-mentioned all test cases that obtain is exactly M
1With M
2The assembling test set of uses case, promptly be used for M
1With M
2Set of uses case IntTest (the M of interactive portion test
1M
2).
Step3, Step4 and Step5 are topmost calculation procedures in the algorithm, establish T
M1And T
M2The maximal value of middle test case number is n, and interface input data number related in each test case mostly is m most, and then the time complexity of algorithm is O (n
2* m
2).During actual the use, T
M1And T
M2In the test case number that can make up generally much smaller than n, so the complexity of this algorithm can be much smaller than O (n
2* m
2).
Claims (3)
1. the member assembling method of testing based on the combination of component testing set of uses case is characterized in that: establish the member M that passes through single component testing
1With M
2Be assembled into the P of system, test philosophy is C, T
M1And T
M2Be respectively member M
1With M
2Satisfy the test use cases of C-adequate-for-P, O is an output interface, and I is an input interface, O
M1Be M
1Output interface set, I
M1Be M
1Input interface set;
Definition: if the test use cases T of member M
MComprise δ D
C(P-relevant (D
M)) at least one test data in each subdomain, then claim T
MSatisfy C-adequate-for-P, wherein, D
MBe the input subdomain of member M, P-relevant (D
M) employed D when representing the P of system component invoking M
MIn subclass, δ D
C(D
M) represent that the member M by test philosophy C derivation all imports the multiset of subdomain;
Concrete testing procedure is as follows:
Step 1: definition member M
1And M
2, when
And
Or
The time claim that they are assemblnig, IP wherein
M1Expression M
1Provide the set of interfaces of service, IR
M1Expression M
1The set of interfaces of request service, IP
M2Expression M
2Provide the set of interfaces of service, IR
M2Expression M
2If the set of interfaces of request service is M
1And M
2Can not assemble then end operation;
Step 2: obtain member M
2Need M
1The service that provides, i.e. IP
M1∩ IR
M2, obtain member M
1Need M
2The service that provides, i.e. IP
M2∩ IR
M1, draw M
1And M
2The union that needs the service that the other side provides, i.e. Shared (M
1, M
2)=(IP
M1∩ IR
M2) ∪ (IP
M2∩ IR
M1);
Step 3: from T
M1With T
M2In find out and integrated relevant test use cases, at test use cases T
M1In each test case t
i, judge member M
1Each output interface O
iWhether be present in test case t
iIn, if O
iBe present in t
iIn, and O
iBelong to IP
M1∩ IR
M2, test case t is described so
iBelong to T
M1In with IP
M1∩ IR
M2Relevant part is with (IP
M1∩ IR
M2) _ relevant (T
M1) [k] note t
i, wherein i represents M
1The number of middle test case;
At member M
1Each input interface I
j, judge I
jWhether be present in test case t
iIn, if I
jBe present in t
iIn, and I
jBelong to IP
M2∩ IR
M1, test case t is described so
iBelong to T
M1In with IP
M2∩ IR
M1Relevant part is with (IP
M2∩ IR
M1) _ relevant (T
M1) [l] note I
j, wherein, j represents M
1The number of middle input interface;
Again at test use cases T
M2In each test case t
k, judge member M
2Each output interface O
kWhether be present in test case t
kIn, if O
kBe present in t
kIn, and O
kBelong to IP
M2∩ IR
M1, test case t is described so
kBelong to T
M2In with IP
M2∩ IR
M1Relevant part is with (IP
M2∩ IR
M1) _ relevant (T
M2) [k] note t
k, wherein, k represents M
2Middle test case number;
At member M
2Each input interface I
l, judge I
lWhether be present in test case t
kIn, if I
lBe present in t
kIn, and I
lBelong to IP
M1∩ IR
M2, test case t is described so
kBelong to T
M2In with IP
M1∩ IR
M2Relevant part is with (IP
M1∩ IR
M2) _ relevant (T
M2) [l] note I
l, wherein, l represents M
2The number of middle input interface;
Step 4: the interface according to coupling, carry out subtracting approximately of test case, to Shared (M
1, M
2) in each interface a, T
M1, T
M2In each and IP
M1∩ IR
M2And IP
M2∩ IR
M1Relevant test case t
p, the type of pressing a is with t
pBe set at a fixed value, remove identical test case, wherein, p represents dependence test use-case number;
Step 5: the syntagmatic in the determining step 4 between the gained test case, calculation combination result:
At T
M1In each and IP
M1∩ IR
M2Relevant test case t
iAnd T
M2In each and IP
M1∩ IR
M2Relevant test case t
kCarry out following processing,
(501): judge t
iIn arbitrary interface x
iWhether belong to IP
M1∩ IR
M2If, x
iBelong to IP
M1∩ IR
M2, simultaneously, have t
kAnd x
iBelong to t
k, then continue to judge x
iAt t
iMiddle number of times and the x that occurs
iAt t
kWhether the middle number of times that occurs equates, if x
iAt t
iMiddle number of times and the x that occurs
iAt t
kThe middle number of times that occurs equates, enters step (502);
(502): judge t
kIn arbitrary interface y
iWhether belong to IP
M1∩ IR
M2If, y
iBelong to IP
M1∩ IR
M2, simultaneously, have t
iAnd y
iBelong to t
i, then continue to judge y
iAt t
iMiddle number of times and the y that occurs
iAt t
kWhether the middle number of times that occurs equates, if y
iAt t
iMiddle number of times and the y that occurs
iAt t
kThe middle number of times that occurs equates, enters step (503);
(503): through the t of step (501), (502) processing
iWith t
kCombination belongs to M
1With M
2The assembling test use-case, with IntTest (M
1M
2) [k] record, otherwise record not;
Again at T
M2In each and IP
M2∩ IR
M1Relevant test case t
kAnd T
M1In each and IP
M2∩ IR
M1Relevant test case t
iCarry out following processing,
(504): judge t
kIn arbitrary interface x
kWhether belong to IP
M2∩ IR
M1If, x
kBelong to IP
M2∩ IR
M1, simultaneously, have t
iAnd x
kBelong to t
i, then continue to judge x
kAt t
kMiddle number of times and the x that occurs
kAt t
iWhether the middle number of times that occurs equates, if x
kAt t
kMiddle number of times and the x that occurs
kAt t
iThe middle number of times that occurs equates, enters step (505);
(505): judge t
iIn arbitrary interface y
kWhether belong to IP
M2∩ IR
M1If, y
kBelong to IP
M2∩ IR
M1, simultaneously, have t
kAnd y
kBelong to t
k, then continue to judge y
kAt t
kMiddle number of times and the y that occurs
kAt t
iWhether the middle number of times that occurs equates, if y
kAt t
kMiddle number of times and the y that occurs
kAt t
iThe middle number of times that occurs equates, enters step (506);
(506): through the t of step (504), (505) processing
iWith t
kCombination belongs to M
1With M
2The assembling test use-case, with IntTest (M
1M
2) [k] record, otherwise record not;
The union of all test cases that process above-mentioned steps 1 to step 5 obtains is exactly M
1With M
2The set of uses case of assembling test.
2. member assembling method of testing as claimed in claim 1 is characterized in that in step 5, the property capable of being combined of test case is judged by following method:
The test use cases of member P and Q is respectively T
PAnd T
Q, test case
t
1=(v
1, i
1, o
1, i
2, o
2..., i
m, o
n, v
n) ∈ T
P, t
2=(v
1', i
1', o
1', i
2', o
2' ..., i
m', o
n', v
n') ∈ T
Q, if satisfy:
(2)
Wherein, Onum is that x is at t
1The middle number of times that occurs, Inum is that x is at t
2The middle number of times that occurs, and
Onum=Inum;
Then claim test case t
1And t
2Can make up, wherein, v
1Be t
1The state of system before carrying out, i
1, i
2I
mThe expression input operation, o
1, o
2O
nThe expression output function, v
nBe t
1Carry out the state of back system; v
1' be t
2The state of system before carrying out, i
1', i
2' ... i
m' the expression input operation, o
1', o
2' ... o
n' the expression output function, v
n' be t
2Carry out the state of back system, m and n are natural number.
3. a kind of member assembling method of testing based on the combination of component testing set of uses case as claimed in claim 1 is characterized in that: when a plurality of members are assembled, by the assembling in twos of member, make it be varied to the form of two members assembling as claimed in claim 1.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2013101137929A CN103226512A (en) | 2013-04-02 | 2013-04-02 | Component composition test method based on combination of component test case suites |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2013101137929A CN103226512A (en) | 2013-04-02 | 2013-04-02 | Component composition test method based on combination of component test case suites |
Publications (1)
Publication Number | Publication Date |
---|---|
CN103226512A true CN103226512A (en) | 2013-07-31 |
Family
ID=48836970
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2013101137929A Pending CN103226512A (en) | 2013-04-02 | 2013-04-02 | Component composition test method based on combination of component test case suites |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103226512A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109542753A (en) * | 2017-09-21 | 2019-03-29 | 中国航发商用航空发动机有限责任公司 | Software System Integrated Testing method and platform |
CN114880242A (en) * | 2022-06-08 | 2022-08-09 | 北京百度网讯科技有限公司 | Test case extraction method, device, equipment and medium |
-
2013
- 2013-04-02 CN CN2013101137929A patent/CN103226512A/en active Pending
Non-Patent Citations (3)
Title |
---|
张驰: ""基于接口匹配的构件组装"", 《计算机应用》 * |
李良明: ""基于动态行为模型的构件及组装测试的研究"", 《中国博士学位论文全文数据库 信息科技辑 2012年第01期》 * |
李良明等: ""测试驱动的构件组装过程"", 《南京航空航天大学学报》 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109542753A (en) * | 2017-09-21 | 2019-03-29 | 中国航发商用航空发动机有限责任公司 | Software System Integrated Testing method and platform |
CN109542753B (en) * | 2017-09-21 | 2021-08-03 | 中国航发商用航空发动机有限责任公司 | Software integration test method and platform |
CN114880242A (en) * | 2022-06-08 | 2022-08-09 | 北京百度网讯科技有限公司 | Test case extraction method, device, equipment and medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CA2948250C (en) | System and method for safety-critical software automated requirements-based test case generation | |
CN106708719B (en) | Service function testing method and device | |
CN108805561B (en) | Method and system for executing intelligent contract capable of accessing multiple blockchains | |
White et al. | Automated diagnosis of product-line configuration errors in feature models | |
CN103870260A (en) | Method and system for service interface development | |
CN107704386B (en) | Unit testing method and device of business process, computer equipment and storage medium | |
US20180004495A1 (en) | Verification of a dataflow representation of a program through static type-checking | |
CN105404497A (en) | Logic expression analysis method and apparatus | |
CN104572072A (en) | MVC (model view controller) mode-based language transformation method and equipment for program | |
Abbas et al. | Binary pattern for nested cardinality constraints for software product line of IoT-based feature models | |
Sanchez et al. | Bigraphical modelling of architectural patterns | |
Kruse et al. | A model-based functional modeling and library approach for mechatronic systems in SysML | |
CN103226512A (en) | Component composition test method based on combination of component test case suites | |
CN104750610A (en) | Dominating degree based aberrance reduction method for message passing parallel program | |
CN107977312B (en) | Software system test verification method based on complex interface time sequence | |
Dini et al. | Optimizing parallel Korat using invalid ranges | |
Kriebel et al. | The next generation of bmw’s electrified powertrains: Providing software features quickly by model-based system design | |
CN101860460A (en) | Web composite service test method of extension-based hierarchical colored Petri net | |
Santos et al. | Transformation of UML behavioral diagrams to support software model checking | |
CN110378735A (en) | Resource information management system and method | |
CN101251820A (en) | Software test method based on program operating field | |
Miao et al. | A formal specification-based integration testing approach | |
Lopez-Herrejon et al. | Searching the variability space to fix model inconsistencies: A preliminary assessment | |
EP3572945A1 (en) | System and method for safety-critical software automated requirements-based test case generation | |
CN102035860B (en) | Method and device for verifying application matching relationship and method and system for combining applications |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C02 | Deemed withdrawal of patent application after publication (patent law 2001) | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20130731 |