Summary of the invention
The objective of the invention is to propose a kind of dynamic testing method of Train Running Control System for High Speed function; Through set up the dynamic test model of Train Running Control System for High Speed based on parametric and Automatic machine model, in carrying out test process, dynamically generate cycle tests, and carry out test; Improve test coverage; And make test result more accurate, and the expense that cycle tests generates and carries out is little, is convenient to realize.
The dynamic testing method of the Train Running Control System for High Speed function that the present invention proposes may further comprise the steps:
(1) sets up the test model of a Train Running Control System for High Speed function: A
p=(M, W, B), wherein,
M is the finite-state automata according to the functional specification structure of Train Running Control System for High Speed,
W is the state transitions weight vectors of finite-state automata M, is used for representing the execution cost of dynamic test process state transitions, W=[w
1..., w
i..., w
n], wherein, n is the state transitions number, w
iExpression state transitions t
iThe execution cost, definition: the execution cost that normal condition shifts is 1, the execution cost that error condition shifts is ∞, the initial weight vector of finite-state automata M be W=[1 ..., 1 ..., 1],
B is the state transitions mark vector of finite-state automata M, B=p [b
1..., b
j..., b
n], b
jSo that 1,0, a value among the 1}, definition b
j=0, expression state transitions t
jMistake to be tested, and can judge state transitions t according to test result
jCorrectness, b
j=-1, expression state transitions t
jMistake to be tested, and can not judge state transitions t according to test result
jCorrectness, b
j=1 expression state transitions t
jMistake not to be tested, the initial marking vector of finite-state automata M be B=[1 ..., 1 ..., 1];
(2) with the finite-state automata M of above-mentioned functional specification structure according to Train Running Control System for High Speed reference model as Train Running Control System for High Speed function dynamic test;
(3) according to above-mentioned test model, the function of Train Running Control System for High Speed is carried out dynamic test, may further comprise the steps:
(3-1), all state transitions are numbered from short to long successively, obtain t according to the length of state transitions homing sequence among the finite-state automata M
1, t
2... T
n
(3-2) begin to EOT, carry out successively from the function of Train Running Control System for High Speed is carried out dynamic test:
(3-2-1) generate a cycle tests ts at the moment of test process k
k=ts
Pret
kTs
Post, t wherein
kBe tested state transitions, ts
PreBe tested state transitions t
kHoming sequence, ts
PostBe tested state transitions t
kShape of tail attitude checking sequence,
(3-2-2) according to above-mentioned cycle tests,, obtain the test output o of reference model respectively respectively to above-mentioned reference model and the tested Train Running Control System for High Speed input signal relevant with functional test
1..., o
l..., o
mTest output with tested Train Running Control System for High Speed
(3-2-3) o is exported in the test of above-mentioned reference model
1, o
2..., o
mTest output with tested Train Running Control System for High Speed
Compare:
If the test of reference model output is identical with the test output of tested Train Running Control System for High Speed, judge that then tested state transitions is for correct;
If the test of reference model output is inequality with the test output of tested Train Running Control System for High Speed, then to cycle tests ts
kCarry out location of mistake, obtain the judged result of tested state transitions;
(3-2-4) according to above-mentioned judged result, if tested state transitions be correctly, then the weighted value of tested state transitions is constant, and is b with the ident value assignment of tested state transitions
k=0, if tested state transitions is a mistake, then the weighted value assignment with tested state transitions is infinitely great w
k=∞, and be b with the ident value assignment of tested state transitions
k=0, if tested state transitions be for judging the correctness of state transitions according to test result, then the weighted value of tested state transitions is constant, and is b with the ident value assignment of tested state transitions
k=-1;
(3-2-5) if all tested state transitions ident values are 0, or be not that 0 tested state transitions has not existed and can carry out cycle tests, then stop the dynamic test process ident value.
In the said method, if the test of reference model output is inequality with the test output of tested Train Running Control System for High Speed, then cycle tests is carried out location of mistake, the location of mistake method may further comprise the steps:
(1) definition: it is a symptom that the test output of reference model is exported inconsistent situation with the test of tested Train Running Control System for High Speed, promptly
From a cycle tests ts
kIn identify all symptoms, obtain a sympotomatic set and be:
S
k={s
k,1,…,s
k,g,…s
k,h};
(2) each the symptom s that above-mentioned symptom is concentrated
K, g:
Confirm that corresponding conflict set is:
C
k,g={c
1 k,g,…,c
u k,g,…,c
p k,g};
Wherein, c
u K, gBe a conflict, being defined as of conflict: corresponding state transitions does not conform in function of tested Train Running Control System for High Speed and the reference model;
(3) obtain cycle tests ts according to above-mentioned conflict set
kInitial diagnostic Candidate Set IDS:
IDS
k=C
k,1∩C
k,2∩…∩C
k,h
According to conflict c
u K, gThe diagnosis candidate who does not conform to history output among the above-mentioned initial diagnostic Candidate Set IDS is deleted in the history output of middle state transitions, and according to conflict c
i K, gThe historical shape of tail attitude of middle state transitions; Delete the diagnosis candidate who does not conform to historical shape of tail attitude among the above-mentioned initial diagnostic Candidate Set IDS, obtain last diagnostic collection FDS, if there is a diagnosis candidate among the last diagnostic collection FDS; Judge that then the state transitions that comprises among this diagnosis candidate is a mistake; If have a plurality of diagnosis candidates among the last diagnostic collection FDS, then can not judge the correctness of state transitions according to test result, adopt the state transitions sequence t that produces symptom
K, v, t
K, v+1, t
K, v+jDescribe the error message of cycle tests, definition produces the state transitions sequence Fss of symptom
k=t
K, v, t
K, v+1, t
K, v+jBe wrong subsequence;
(4), then above-mentioned wrong subsequence is added in the wrong subsequence set if can not judge the correctness of state transitions according to test result:
FssS
k=FssS
k-1∪{Fss
k}。
The dynamic testing method of the Train Running Control System for High Speed function that the present invention proposes is compared with the dynamic testing method of existing Train Running Control System for High Speed static test and other field, has the following advantages:
1, the dynamic testing method of Train Running Control System for High Speed function of the present invention dynamically generates cycle tests for state transitions to be tested in carrying out test process.This cycle tests generating mode is when increasing the optional scope of cycle tests, and having overcome the conventional dynamic method of testing effectively need test the big problem of the cycle tests that all cycle testss carried out caused generation expense that begins generate before each state transitions.
2, in the dynamic testing method of Train Running Control System for High Speed function of the present invention; Location of mistake is an incremental process; Time marquis in that a state transitions is tested need not carry out exhaustive testing to this transfer to be measured, but constantly upgrades the location of mistake result through the process that cycle tests is carried out.The information of each location of mistake is used for upgrading the parameter of Train Running Control System for High Speed dynamic test model, to identify each execution test test result information afterwards.Further reduce the disconnected possibility of test result erroneous judgement through this method, reduced the cycle tests executive overhead simultaneously effectively.
Embodiment
The dynamic testing method of the Train Running Control System for High Speed function that the present invention proposes, its FB(flow block) is as shown in Figure 2, may further comprise the steps:
(1) sets up the test model of a Train Running Control System for High Speed function: A
p=(M, W, B), wherein,
M is the finite-state automata according to the functional specification structure of Train Running Control System for High Speed,
W is the state transitions weight vectors of finite-state automata M, is used for representing the execution cost of dynamic test process state transitions, W=[w
1..., w
i..., w
n], wherein, n is the state transitions number, w
iExpression state transitions t
iThe execution cost, definition: the execution cost that normal condition shifts is 1, the execution cost that error condition shifts is ∞, the initial weight vector of finite-state automata M be W=[1 ..., 1 ..., 1],
B is the state transitions mark vector of finite-state automata M, B=[b
1..., b
j..., b
n], b
jSo that 1,0, a value among the 1}, definition b
j=0, expression state transitions t
jMistake to be tested, and can judge state transitions t according to test result
jCorrectness, b
j=-1, expression state transitions t
jMistake to be tested, and can not judge state transitions t according to test result
jCorrectness, b
j=1 expression state transitions t
jMistake not to be tested, the initial marking vector of finite-state automata M be B=[1 ..., 1 ..., 1];
(2) with the finite-state automata M of above-mentioned functional specification structure according to Train Running Control System for High Speed reference model as Train Running Control System for High Speed function dynamic test;
(3) according to above-mentioned test model, the function of Train Running Control System for High Speed is carried out dynamic test, may further comprise the steps:
(3-1), all state transitions are numbered from short to long successively, obtain t according to the length of state transitions homing sequence among the finite-state automata M
1, t
2... T
n, the state transitions process of finite state machine is as shown in Figure 1, and when the homing sequence length of a plurality of state transitions was identical, number order was any, and the homing sequence length of state transitions (2,4) and state transitions (3,5) is identical, therefore is numbered t
3State transitions both can be that (2,4) also can be (3,5);
(3-2) begin to EOT, carry out successively from the function of Train Running Control System for High Speed is carried out dynamic test:
(3-2-1) generate a cycle tests ts at the moment of test process k
k=ts
Pret
kTs
Post, t wherein
kBe tested state transitions, ts
PreBe tested state transitions t
kHoming sequence, ts
PostBe tested state transitions t
kShape of tail attitude checking sequence,
(3-2-2) according to above-mentioned cycle tests,, obtain the test output o of reference model respectively respectively to above-mentioned reference model and the tested Train Running Control System for High Speed input signal relevant with functional test
1..., o
l..., o
mTest output with tested Train Running Control System for High Speed
(3-2-3) o is exported in the test of above-mentioned reference model
1, o
2..., o
mTest output with tested Train Running Control System for High Speed
Compare:
If the test of reference model output is identical with the test output of tested Train Running Control System for High Speed, judge that then tested state transitions is for correct;
If the test of reference model output is inequality with the test output of tested Train Running Control System for High Speed, then cycle tests tsk is carried out location of mistake, obtain the judged result of tested state transitions;
(3-2-4) according to above-mentioned judged result, if tested state transitions be correctly, then the weighted value of tested state transitions is constant, and is b with the ident value assignment of tested state transitions
k=0, if tested state transitions is a mistake, then the weighted value assignment with tested state transitions is infinitely great w
k=∞, and be b with the ident value assignment of tested state transitions
k=0, if tested state transitions be for judging the correctness of state transitions according to test result, then the weighted value of tested state transitions is constant, and is b with the ident value assignment of tested state transitions
k=-1;
(3-2-5) if all tested state transitions ident values are 0, or be not that 0 tested state transitions has not existed and can carry out cycle tests, then stop the dynamic test process ident value.
The finite-state automata that the present invention is used for describing the Train Running Control System for High Speed functional specification has following definition and form:
A typical finite-state automata is defined as one 6 tuple
M=(Q,q
0,Q
m,∑,Λ,δ,λ)
Wherein:
Q is the state set of finite-state automata;
∑ is the input character set of finite-state automata, and one of them character representative is by incoming event of modeling;
A is the output character set of finite-state automata, and one of them character representative is by outgoing event of modeling;
q
0Original state for finite-state automata;
δ is the state transition function of finite-state automata: δ: Q * ∑ → Q;
λ is the output function of finite-state automata: λ: Q * ∑ → Λ.
Q
mBe the identification-state set of finite-state automata, be used for identifying certain incident perhaps certain sequence of events generation takes place.
Based on the finite-state automata model Train Running Control System for High Speed is carried out functional test following hypothesis is arranged:
Suppose 1: do not have the state transitions of output to think for finite-state automata and be output as sky, promptly output is null event ε.
Suppose 2: make t
1: I
1/ O
1, t
2: I
2/ O
2Be two state transitions that order takes place, I
1, I
2Be the incoming event of state transitions, O
1, O
2It is the outgoing event of state transitions.It is I that following temporal partial ordering relation is arranged between four incidents
1<O
1<I
2<O
2, the time order and function order that takes place of operational character "<" presentation of events wherein, the incident on the operational character left side takes place prior to the incident on the right.
Suppose 3: the finite-state automata model of establishing corresponding to tested Train Running Control System for High Speed functional specification is M; The corresponding finite-state automata model of Train Running Control System for High Speed is M ', and the hypothesis that generates cycle tests based on the finite-state automata model comprises following 7 son hypothesis:
(3.1) finite-state automata M is a full-mesh, and promptly the state transition diagram of M is a full-mesh;
(3.2) finite-state automata M is the simplest finite-state automata;
(3.3) finite-state automata M ' can not change in test process;
(3.4) the input character collection of finite-state automata M ' is identical with the input character collection of finite-state automata M;
(3.5) status number of finite-state automata M ' can not surpass the status number of finite-state automata M;
(3.6) for each input character, if system under test (SUT) produces output, this output produced in the given time so;
(3.7) Test input signal is that steady state (SS) at system under test (SUT) applies.
In the said method, if the test of reference model output is inequality with the test output of tested Train Running Control System for High Speed, then cycle tests is carried out location of mistake, the location of mistake method may further comprise the steps:
(2-1) definition: it is a symptom that the test output of reference model is exported inconsistent situation with the test of tested Train Running Control System for High Speed; Promptly
identifies all symptoms from a cycle tests tsk, obtains a sympotomatic set to be:
S
k={s
k,1,…,s
k,g,…s
k,h};
Each the symptom s that (2-2) above-mentioned symptom is concentrated
K, g:
Confirm that corresponding conflict set is:
C
k,g={c
1 k,g,…,c
u k,g,…,c
p k,g};
Wherein, c
u K, gBe a conflict, being defined as of conflict: corresponding state transitions does not conform in function of tested Train Running Control System for High Speed and the reference model;
(2-3) obtain cycle tests ts according to above-mentioned conflict set
kInitial diagnostic Candidate Set IDS:
IDS
k=C
k,1∩C
k,2∩…∩C
k,h
According to conflict c
u K, gThe diagnosis candidate who does not conform to history output among the above-mentioned initial diagnostic Candidate Set IDS is deleted in the history output of middle state transitions, and according to conflict c
i K, jThe historical shape of tail attitude of middle state transitions; Delete the diagnosis candidate who does not conform to historical shape of tail attitude among the above-mentioned initial diagnostic Candidate Set IDS, obtain last diagnostic collection FDS, if there is a diagnosis candidate among the last diagnostic collection FDS; Judge that then the state transitions that comprises among this diagnosis candidate is a mistake; If have a plurality of diagnosis candidates among the last diagnostic collection FDS, then can not judge the correctness of state transitions according to test result, adopt the state transitions sequence t that produces symptom
K, v, t
K, v+1, t
K, v+jDescribe the error message of cycle tests, definition produces the state transitions sequence Fss of symptom
k=t
K, v, t
K, v+1, t
K, v+jBe wrong subsequence;
(2-4) if can not judge the correctness of state transitions, then above-mentioned wrong subsequence is added in the wrong subsequence set according to test result:
FssS
k=FssS
k-1∪{Fss
k}。
For the shortest wrong subsequence acquisition process in the location of mistake method is described better, below introduce the correlated results of wrong subsequence abbreviation:
For wrong subsequence, following 2 wrong subsequence abbreviation rules are arranged:
Rule 1: make that T is a wrong subsequence, and | T|>1 (| T| represents the length of wrong subsequence, i.e. the number of its transfer that comprises).If T=t
1T ', and t
1Be a correct state transitions that realizes, then T ' is the wrong subsequence shorter than T, and they have identical mistake to realize.
Rule 2: make that T is a wrong subsequence, and | T|>1.If T=T ' t
l, and t
lBe the state transitions of a correct realization, then T ' is the wrong subsequence shorter than T, and they have identical mistake.
The shortest wrong subsequence obtaining step among the present invention is following:
(1) if carries out cycle tests and produces symptom
Wherein
Be first symptom, and shift t in executing state
K, iThe time observe this symptom, then t
K, 1, t
K, 2..., t
K, iNecessarily contain wrong state transitions, t
K, 1, t
K, 2..., t
K, iAs initial wrong subsequence;
(2) use wrong subsequence rule of simplification based on the above-mentioned wrong subsequence of historical test data abbreviation, shift all can't take a decision as to whether correct state transitions the time when the head status of wrong subsequence shifts with the shape of tail attitude, this subsequence is the wrong subsequence of lacking most.
Below be an embodiment of the inventive method: present embodiment is through the superiority of Train Running Control System for High Speed mobile unit mode switch test specification the method for the invention.Present embodiment has contrasted the dynamic testing method of inventing said Train Running Control System for High Speed mobile unit function and the test performance of traditional static method of testing and conventional dynamic method of testing.Following in conjunction with accompanying drawing to mobile unit mode switch dynamic test procedure declaration:
1. set up the dynamic test model of a Train Running Control System for High Speed mobile unit function, A
p=(B), wherein the finite-state automata model M is shown in accompanying drawing 3 for M, W, and the state of M and input and output Event Description are shown in table 1, table 2 and table 3; A
pOriginal state shift weight vectors be W=[1,1 ..., 1], original state shift mark vector be B=[1,1 ..., 1].
Table 1 state table
Table 2 incoming event table
Table 3 outgoing event table
2. with the finite-state automata M of above-mentioned functional specification structure according to the Train Running Control System for High Speed mobile unit reference model as Train Running Control System for High Speed mobile unit function dynamic test
3. according to above-mentioned dynamic test model, the function of Train Running Control System for High Speed mobile unit is carried out dynamic test, process is following:
The state transitions t8 that supposes mobile unit has shape of tail attitude mistake, and (this state transitions is implemented as t
8: δ ' (s
6, I
8)=s
2), to get off in this realization situation, (3-2-1) to (3-2-5) 5 steps are carried out in circulation, and the implementation summary is: for all state transitions are numbered, number as shown in Figure 3; For state transitions t
1, based on finite-state automata M
0, use the UIO method to generate state transitions t
1Cycle tests ts
1=t
1, t
2, carry out cycle tests ts
1, do not find symptom, then description status shifts t
1Through test, and then state transitions t
1The corresponding identification value becomes 0, and weighted value is constant, after this state transitions t
2, t
3, t
4, t
5, t
6, t
7Also all passed through test, the mark vector that this moment, parametrization finite-state automata model state shifted is B=[0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1], when test mode shifts t
8The time, carry out cycle tests and find symptom afterwards
There are a plurality of diagnosis candidates to explain for this symptom, for example DC
8,1:
DC
8,2: δ (s
6, I
8)=s
2Deng, therefore, use the shortest wrong subsequence to describe the error message of test vehicle equipment, initial wrong subsequence is Fss
1=t
1, t
7, t
8, t
2, because state transitions t
1, t
2, t
7Mistake to be tested and checking are correct, use wrong subsequence abbreviation rule to obtain state transitions t
8Be that unique mistake shifts, and it is output as O
1So, state transitions t
8Be a state transitions that shape of tail attitude mistake is arranged, according to this test result, state transitions t
8Weighted value be set to infinitely, in ensuing test, can not generate the cycle tests that comprises this state transitions.Use dynamic testing method not to state transitions t to be tested
8Do exhaustive testing, but obtain error message, state transitions t in ensuing dynamic test process through reasoning
9, t
10, t
11, t
12, t
13, t
14, t
15, t
16, t
17, t
18, t
19, t
20, t
21All passed through test.
Under same false supposition prerequisite, contrast dynamic testing method of the present invention and traditional static test and dynamic conformance method of testing (DCTM), test execution result is listed in the table 4.Because state transitions t
8Be shape of tail attitude mistake, thus the test judged result of static test do not influenced, but for the DCTM dynamic testing method, at state transitions t
8When shape of tail attitude mistake was arranged, not only the test execution expense was big, and the test result of wrong judgement, and this is because as cycle tests t
1, t
7, t
8, t
2During not through test, need be to t
8Carry out exhaustive testing, work as t simultaneously
8After being judged as " mistake realization ", shift t
15, t
16, t
17, t
18In testing tree, do not had and can carry out cycle tests, so directly be judged as " mistake realization ", obviously this is false test result.
Table 4 is worked as t
8Experimental result during mistake
Annotate: C representes the test execution cost; P representes the state transitions number through test; F representes the not state transitions number through testing; W representes false test result number; U representes the state transitions number that can't test.
Then inject fault respectively,, obtain the experimental result of tested Train Running Control System for High Speed mobile unit under multiple single error situation, be listed in the table 5 through emulation experiment for 21 state transitions of Train Running Control System for High Speed mobile unit.
The experimental result of table 5 single fault
Annotate: E representes mean value.I representes ideal value.
Inject The simulation experiment result according to fault, compare the test performance of three kinds of method of testings from following four aspects:
1) test execution expense
Can know that from experimental result the average test expense of DCTM method is maximum.The average test expense of dynamic testing method of the present invention and the average test expense of static method are more approaching.This is because the DCTM dynamic testing method has used the test result determination strategy of exhaustive testing, so the test expense is bigger.
2) test coverage
The state transitions number that dynamic testing method of the present invention covers is 20.05, and the state transitions number that the DCTM method covers is 19.62, and the state transitions number that static test covers has only 19.23.Can know that from The simulation experiment result dynamic testing method test coverage of the present invention is the highest, relatively near ideal value.The DCTM dynamic testing method is owing to adopted the method for exhaustive testing to improve test coverage to a certain extent.The actual test coverage of static test is minimum.
3) false test result number
Use dynamic testing method of the present invention and DCTM dynamic testing method, false test result number is less than static test.Dynamic testing method of the present invention is because employing incremental testing location of mistake method is used " uncertain " result as the test judgement to judging whether wrong state transitions.
4) test result accuracy rate
From The simulation experiment result; The test result accuracy rate of using dynamic testing method of the present invention the to obtain the highest tested state transitions test result accurately of sign " uncertain " (this think in discussing), this is because the test determination strategy and the location of mistake method of dynamic testing method of the present invention use increment.And static test is owing to have only a cycle tests to each state transitions to be tested, so in case test crash, corresponding state transitions just is judged as " mistake realization ".The DCTM dynamic testing method has only it to a state transitions to be measured, and all can carry out cycle tests all during test crash, just give the test judgement of tested state transitions " mistake realization ".Though this can improve accuracy rating of tests to a certain extent, still there is the disconnected possibility of erroneous judgement.For example as state transitions t
6When being wrong a realization, DCTM passes through state transitions t
6Exhaustive testing judge t
6Be " mistake realization ", according to DCTM method of testing state transitions t
19, t
20, t
21Directly be judged as error condition and shift, this also is the disconnected test result of erroneous judgement.
In sum, dynamic testing method of the present invention has than traditional static method of testing and the better test performance of DCTM dynamic testing method.Dynamic testing method of the present invention dynamically generates cycle tests based on the parametric and Automatic machine model of Train Running Control System for High Speed in measuring executing process; And adopt increment location of mistake method that mistake is carried out incremental positioning; Use wrong subsequence to describe the local error locating information simultaneously, dynamically the parameter of the parametric and Automatic machine model of update system.Dynamic testing method of the present invention has also guaranteed less test execution expense when further improving the test result accuracy rate, therefore, method of the present invention is a kind of more excellent dynamic testing method of suitable Train Running Control System for High Speed functional test.