CN106095669A - Parallel program testing method based on schedule sequences yojan - Google Patents
Parallel program testing method based on schedule sequences yojan Download PDFInfo
- Publication number
- CN106095669A CN106095669A CN201610390006.3A CN201610390006A CN106095669A CN 106095669 A CN106095669 A CN 106095669A CN 201610390006 A CN201610390006 A CN 201610390006A CN 106095669 A CN106095669 A CN 106095669A
- Authority
- CN
- China
- Prior art keywords
- statement
- schedule sequences
- program
- sequences
- communication
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Devices For Executing Special Programs (AREA)
Abstract
The present invention studies the schedule sequences reduction method of concurrent program, it is desirable to based on existing test data set, and the schedule sequences after letter performs program according to the appointment, can coverage goal statement, thus reduce the cost that program performs, improve the efficiency of parallel program testing.The thought of institute's extracting method is: first, based on the relation between schedule sequences and object statement execution, determines the schedule sequences affecting object statement;Then, whether the situation according to object statement execution is identical, and the schedule sequences affecting object statement is divided into some equivalence classes;Finally, for schedule sequences each in equivalence class, calculate two performance index values, and select comprehensive index value minimum, as the schedule sequences after yojan.When needs coverage goal statement, perform tested program based on this schedule sequences.
Description
Technical field
The present invention relates to computer software testing field, devise a kind of schedule sequences yojan side for concurrent program
Method, can be used for improving the efficiency of such program test.
Background technology
Software test is to ensure that the important method of software correctness.Owing to software test is very time-consuming so that software test
Cost be greatly increased.Existing statistics shows, software test accounts for more than the 50% of whole software development cost.With software
The extensive application of test, the demand to high performance software method of testing will be more and more stronger.In consideration of it, use suitable method,
Reduce the time needed for software test, be very necessary.
Concurrent program refers to, the program containing two or more executed in parallel processes.In many large-scale science and work
During journey calculates, concurrent program is often used to realize, such as energy exploration, medical science, military affairs etc..In numerous concurrent programs, message passes
Passing concurrent program is a kind of widely used concurrent program.This program is based on FORTRAN and C language, and provides function call
Interface library, has that transplantability is good, powerful, efficiency advantages of higher, additionally, almost all of parallel computation manufacturer all provide right
The support of this class method.
In software test procedure, test philosophy is extremely important, is not only able to guide the generation of test data, additionally it is possible to comment
The adequacy of valency software test.Up to the present, it has been suggested that multiple test philosophies, wherein, statement covers is a kind of conventional
Structure coverage criterion.So-called statement covers and refers to, runs tested program using a certain test data as the input of program, if energy
Enough perform a certain given statement (referred to as object statement), then, claim this test data cover object statement.
For serial program, it is judged that can test data cover a certain object statement, only need to perform once by
Ranging sequence.The execution of message-passing parallel program has uncertainty so that identical test data, at different schedule sequences
Under, it is likely to be of different covering results.If in consideration of it, a certain test data, under a certain schedule sequences, it is impossible to cover mesh
Poster sentence, can not conclude that this test data can not coverage goal statement, in addition it is also necessary to investigates this test data and dispatches sequence at other
Object statement coverage condition under Lie.Therefore, compared with serial program test, the program of concurrent program statement coverage test performs
Time-consuming very big.This explanation, studies effective method, and the program shortening the covering of concurrent program statement performs time-consuming, very must be
Want.
In consideration of it, the present invention is based on statement coverage criterion, the schedule sequences reduction problem of research message-passing parallel program.
Through consulting pertinent literature, there is not yet similar approach at present, this has had a strong impact on the application of concurrent program.
Content of the invention
The present invention studies the schedule sequences reduction method of concurrent program, it is desirable to based on existing test data set, according to the appointment letter
After schedule sequences perform program, can coverage goal statement, thus reduce program perform cost, improve parallel program testing
Efficiency.The thought of institute's extracting method is: first, and based on the relation between schedule sequences and object statement execution, determining affects mesh
The schedule sequences of poster sentence;Then, whether the situation according to object statement execution is identical, will affect the schedule sequences of object statement
It is divided into some equivalence classes;Finally, for schedule sequences each in equivalence class, calculate two performance index values, and select comprehensively to refer to
Scale value minimum, as the schedule sequences after yojan.When needs coverage goal statement, perform tested based on this schedule sequences
Program.
It can be seen that the schedule sequences affecting object statement determines, the formation of schedule sequences equivalence class, and based on synthesis
The schedule sequences of desired value selects, and is closely related, deep layer by layer, is also 3 key technologies of the present invention.
Step 1: the schedule sequences affecting object statement determines
Different from serial program, one of feature of message-passing parallel program is, containing miscellaneous communication statement, as
Blocking communication statement, non-blocking communication statement, group communication statement etc..In these communication statements, the different settings of parameter, make
The execution of calling program has uncertainty.
One communication statement, if its parameter value comprising so that it would be not that the message of this statement sends or receive statement
Determine, then, this statement is referred to as uncertain communication statement.Uncertain communication statement, both can be that message sends statement, it is possible to
To be message sink statement.Just because of comprising uncertain communication statement, the execution of message-passing parallel program is just made to have
Uncertain.
The uncertainty that message-passing parallel program performs so that for identical program input, perform different processes
Sequentially, the program output difference of generation.The order that program process performs, referred to as one schedule sequences.For an object statement
For, can this statement perform, not only relevant with program input, also related to schedule sequences.This is embodied in, for identical journey
Sequence inputs, and dispatches the different processes of this program according to a certain sequence, is able to carry out this statement;And dispatch these according to another sequence
Process, but can not perform this statement.This explanation, the schedule sequences of program affects the execution of object statement.
Although a message-passing parallel program comprises multiple schedule sequences, but, it is not each schedule sequences, all
Affect the execution of a certain object statement.In order to cover this object statement, find and affect the schedule sequences that this object statement performs, be
Very necessary.The execution of a certain object statement of so-called schedule sequences impact, refers at least there is a program input, depends on
The different processes of this sequence scheduler program, are able to carry out this object statement.
The method that the present invention is combined with static analysis by Dynamic Execution, finds the schedule sequences affecting object statement.
Step 2: the formation of object statement schedule sequences class of equal value
For identical program input, different schedule sequences, the object statement of execution is different, but, these statements it
Between execution relation not completely self-contained, but exist certain contact.Whether the practice condition according to object statement is identical, will
Affecting the schedule sequences divide into several classes of object statement, the schedule sequences in every class is all of equal value.
Consider the set of concurrent program all schedule sequences composition, be designated as S, this program process PiJ-th statementFor mesh
Poster sentence.Whether affect according to schedule sequencesExecution, set S is divided into following two classes: a class is impactThe tune performing
The set of degree series composition, is designated asAnother kind of for not affectingThe set of the schedule sequences composition performing, is designated asSo,According to arbitrary input under,Can perform, willIt is further divided into following m class:
In formula, m is the number of equivalence class,It isK-th schedule sequences class of equal value.
According to the definition of schedule sequences class of equal value, the present invention utilizes program dependency graph to find the schedule sequences of equivalence, and
Form corresponding schedule sequences class of equal value.
Step 3: the selection of schedule sequences
In schedule sequences of equal value, as long as selecting one of them test just permissible, other can be with yojan.For equivalence
Schedule sequences, although the object statement of execution is identical, but, different schedule sequences, the execution process of program not exclusively
Identical.Now, how from schedule sequences of equal value, a suitable schedule sequences is selected, very heavy to improve testing efficiency
Want.In consideration of it, this step will provide a kind of schedule sequences system of selection.
For selection scheduling sequence, it is considered to the cost that a concurrent program performs.Generally speaking, the generation that concurrent program performs
Valency can be divided into following 2 parts: communication cost and calculation cost, wherein, and the number of times that communicates between communication cost with process and logical
The data volumes of transmission in letter etc. are closely related;Calculation cost depends on lines of code and computational complexity etc..
For rational selection scheduling sequence, the present invention is by setting up an index system, under different schedule sequences, and journey
The Executing Cost of sequence is evaluated.This index system comprises following 2 indexs, respectively: average communication cost and Halstead
Estimate.
For schedule sequences each in equivalence class, calculate the two performance index value, and select comprehensive index value minimum,
As the schedule sequences after yojan
The main contributions of the present invention is: (1) defines the schedule sequences affecting object statement, and provides these scheduling sequences
The finding method of row;(2) define object statement schedule sequences class of equal value, and provide the forming method of these classes;(3) propose
Evaluate the index system of schedule sequences performance of equal value, and be used for selection scheduling sequence.
Brief description
The example procedure source code of Fig. 1 present invention
The schedule sequences of Fig. 2 Fig. 1 example procedure
Fig. 3 example procedure is at schedule sequences ss1Under program dependency graph
Fig. 4 example procedure is at schedule sequences ss2Under program dependency graph
Detailed description of the invention
It is described in detail below in conjunction with the embodiment to institute of the present invention extracting method for the concrete accompanying drawing.
Step 1: the schedule sequences affecting object statement determines
It is readily apparent that, the schedule sequences more than one of a message-passing parallel program, and uncertain communication statement is more,
Its schedule sequences is also more.Remembering that a message-passing parallel program is P, this program comprises t (t > 1) individual process, i-th (i=0,
1 ..., t-1) individual process is Pi, this process comprises NiIndividual uncertain communication statement.Consider PiJ-th uncertain communication statement,
Have with the communication statement of this statement matchingIt is individual, then, based on PiUncertain communication statement, the schedule sequences of formation is up toIndividual.If it is considered that all t processes, then, the schedule sequences of formation can be more.This explanation, with parallel
Increasing of program process, the schedule sequences of formation will sharply increase.
Now, by the example procedure of Fig. 1, the relation between schedule sequences and uncertain communication statement is described.In order to retouch
State conveniently, remember journey P intoiK-th statement beKnown by Fig. 1, process P0It containing 4 uncertain communication statements, is respectively
P6 0、P7 0、P8 0And P9 0, these statements all can receive and send statement P from message4 1、P4 2、P4 3、P4 4The message sent, but, often
Secondary execution, can only receive the message that wherein a statement sends, and the statement receiving transmission message is uncertain.By piece
Lifting, the match messages of the uncertain communication statement of this program has 24 kinds of situations, creates 24 schedule sequences.The l of note program
Individual schedule sequences is ssl, then, all schedule sequences of this program are as listed by Fig. 2, and wherein, the 1st row are the sequences of schedule sequences
Number, the 1st row is process P04 uncertain message sink statements, remaining each row represent under corresponding schedule sequences, send out with message
Send the match condition of statement.
For an object statement, can this statement perform, not only relevant with program input, also with schedule sequences phase
Close.Although a message-passing parallel program comprises multiple schedule sequences, but, it is not each schedule sequences, all affect
The execution of a certain object statement.In order to cover this object statement, find and affect the schedule sequences that this object statement performs, be very
Necessary.The present invention proposes the method that Dynamic Execution combines with static analysis, finds these schedule sequences.
First, it is considered to the input set of a certain program.For a certain input in this set, perform each of this program successively
Schedule sequences.It if there is a certain schedule sequences, under this input, is able to carry out object statement, then, this sequence is impact
The schedule sequences that object statement performs;, it is considered to next schedule sequences, and record whether this sequence affects holding of object statement then
OK, until all of schedule sequences is all performed.For not affecting the schedule sequences that object statement performs, use new journey
Sequence inputs, and repeats said process, until all of schedule sequences all affects object statement or all of input is performed both by program and is
Only.
Owing to said method is by performing tested program, finding desired schedule sequences, therefore, the method is called dynamic
Method.Use dynamic method, although some can be found to affect the schedule sequences that object statement performs, but, whether the method is effective,
Closely related with program input set.If it is improper that this set is chosen, then, it may be difficult to find out all of expectation scheduling sequence
Row.At this time, it may be necessary to pass through the static analysis control statement related to object statement, and the pass of control statement and schedule sequences
System, to determine whether certain schedule sequences affects the execution of object statement, the method is referred to as static method.
It is readily apparent that, by dynamic method, the schedule sequences needing to find further can be reduced, thus to a certain extent
Alleviate the analysis burden using static method to cause;Find desired schedule sequences by static method, can make up in dynamic method
The schedule sequences causing owing to Resource selection is improper finds infull defect.This Dynamic Execution combines with static analysis
Method, contributes to finding all of schedule sequences affecting object statement execution.
Step 2: the formation of object statement schedule sequences class of equal value
By previous step it can be seen that for identical program input, different schedule sequences, the object statement of execution is not
With, but, the execution relation between these statements is not completely self-contained, but there is certain contact.To this end, according to target language
Whether the practice condition of sentence is identical, will affect the schedule sequences divide into several classes of object statement, and the schedule sequences in every class is all
Of equal value.
Below, the finding method of schedule sequences class of equal value is given.When object statement is present in branch or loop structure,
Must there is an object statement and directly control the statement of dependence.In order to illustrate directly to control dependence, it is assumed that s1And s2It is program
Two statements, if s2Execution whether depend on s1, then, claim s2Control depends on s1.Further, if there is no statement
s3So that s3It is positioned at s1To s2Path on and s2Control depends on s3, then, claim s2Directly control depends on s1.It is recognised that
s1It must be conditional statement.Claim object statement directly to control the statement of dependence, be target-dependent statement.In view of concurrent program
Schedule sequences, can pass through corresponding uncertain communication statement and match statement reflection thereof, therefore, if affecting object statement pair
Uncertain communication statement and the match statement thereof of answering target-dependent statement are all identical, then, corresponding schedule sequences is exactly of equal value
's.The present invention passes through program dependency graph, portray affect the uncertain communication statement of this target-dependent statement or its match statement it
Between relation.Saying intuitively, program dependency graph is a digraph, is designated as G=(N, E), and wherein, N is vertex set, Mei Yiding
One or more statement of the corresponding program of point;E is directed edge set, the dependence between the corresponding statement of each directed edge.This
Dependence can be that control relies on, it is also possible to is data dependence, can also is that communication relies on.In view of difference is relied on by the present invention
The processing mode of relation is identical, therefore, does not subdivide these dependences.According to the dependence between statement, can obtain
Corresponding program dependency graph.
For the example procedure of Fig. 1, at schedule sequences ss1Under program dependency graph as shown in Figure 3.
According to the corresponding program dependency graph of a certain schedule sequences, go out from the summit of the corresponding target-dependent statement of object statement
Send out, along the contrary direction of directed edge, find the summit of the uncertain communication statement of all correspondences and match statement, obtain a top
Point sequence.For different schedule sequences, if above-mentioned vertex sequence is identical, then, corresponding schedule sequences is
The schedule sequences of valency.By said method, the schedule sequences of multiple equivalence can be obtained.
For the example procedure of Fig. 1, schedule sequences ss2Under program dependency graph as shown in Figure 4.From Fig. 3 and 4,
Under this 2 schedule sequences, object statementCorresponding target-dependent statement isAnd affectVertex sequence be { P4 1,
P6 0, therefore, this 2 schedule sequences are of equal value.
If object statement is in sequential organization, then, the execution of this statement, typically do not controlled by other statements,
It when arbitrary input performs program under any schedule sequences, is all able to carry out it.The scheduling of equal value of this kind of object statement only one of which
Sequence class, this equivalence class contains and is had an impact its schedule sequences.
Step 3: the selection of schedule sequences
Index 1: average communication cost
For concurrent program, the transmission of information between process, perform the required time much larger than statement in process.Owing to adjusting
The transmission of information between degree series decision process, therefore, it can the cost by communication between process, reflects the excellent of schedule sequences
Bad.
The communication mode of message-passing parallel program, can be divided into following 2 classes: point to point link and group communicate.If 2
Process is by the message of point-to-point communication transmission n byte, and transmission delay is σ, and the time needed for each byte of transmitting is θ, then,
Completing this traffic operation needs θ the unit interval of σ+n;In view of group communication realizes based on point to point link, based on point to point link
The time that operation needs, by different models, can be evaluated whether the communication cost under different group communication mode.
In message-passing parallel program, complete a traffic operation, need the cooperation of 2 or multiple process communication functions
Can complete.In order to avoid certain communication cost computes repeatedly, perform the communication cost producing to each communication functions, do following rule
Fixed: message sends and message sink function coordinates, and completes a point to point link, and the communication producing θ the unit interval of σ+n is opened
Pin, then, message sends the execution of function or receiver function, and the communication cost of generation isThe individual unit interval.For many
The group communication functions of individual process coordinates jointly, completes a traffic operation, and each communication functions performs the communication cost producing, and is
Respective sets communication cost and the ratio of process number.
Under same schedule sequences, different program inputs, the communication functions of execution is not necessarily identical, consequent logical
Letter cost is also not necessarily identical.In consideration of it, with under this schedule sequences, go to the mean value of object statement communication cost, reaction
The communication cost of this schedule sequences.
Below, the type according to communication functions place program structure, calculates the average communication cost of this communication functions.
If a certain communication functions is in the sequential organization of a certain process, then, it as long as performing this process, is carried out this
Communication functions, and produce communication cost.But, if this communication functions is in the branched structure of a certain process, then, this enters
The execution of journey, does not ensures that this communication functions also performs.In view of the execution of this communication functions is a chance event, therefore,
Probability can be used, represent the possibility that this communication functions performs.Being readily apparent that, the execution of this communication functions, it is held with control
The true value of the conditional statement predicate expressions of row is closely related.Note predicate expressions be genuine probability be p, if this communication functions
The communication cost performing is α unit interval, then, the execution of this communication functions, required average communication cost is p α
Unit interval.When this communication functions is in a certain course cycles structure, it is assumed that the number of times performing loop structure is n,
Due to each circulation, being performed both by this communication functions, therefore, the execution of this communication functions, required average communication cost is n α.
Assume the communication functions that a certain schedule sequences comprises, N1,N2,N3Individual lay respectively at process sequential organization, branch knot
In structure and loop structure, wherein, in sequential organization, the communication cost of i-th communication functions is αiIndividual chronomere, branched structure
In, the communication cost of j-th communication functions is βjIndividual chronomere, in loop structure, the communication cost of k-th communication functions is
γkIndividual chronomere, then, the average communication cost of this schedule sequences is
Index 2: the Halstead of schedule sequences estimates
In message-passing parallel program, the statement that there is order execution relation is likely to be present in different processes, claims
A series of statements with order execution relation are a statement sequence.The process more than one comprising due to concurrent program, because of
This, a paths of this program, usually contain multiple statement sequence.Being readily apparent that, the complexity of different statement sequences is different
, and the statement sequence of complexity maximum often affects the execution in path.The maximum statement sequence of our complexity is called crucial
Statement sequence.In order to reflect the complexity of a statement sequence, present invention introduces Halstead and estimate.This is estimated and passes through operator
With the number of operand, estimating the complexity of statement sequence, wherein, operand refers to variable that this statement sequence comprises and often
Amount, operator mainly has arithmetic sum Boolean operator.
Remembering that a statement sequence is Sq, the operator comprising and the number of operand are respectively N1And N (Sq)2(Sq), Sq
Halstead is a length of:
L (Sq)=N1(Sq)+N2(Sq)
The all statement sequences comprising for a paths, calculate the Halstead length of each sequence, then,
The maximum statement sequence of Halstead length, it is simply that the key sentence sequence in this path.Relate to many for a schedule sequences
Paths, asks for the key sentence sequence in each path, and by the maximum Halstead length of these statement sequences, as this tune
The Halstead of degree series estimates.
For each schedule sequences, obtain the average communication cost of this sequence and after Halstead estimates, by returning
The one value weighted sum changed, can obtain the comprehensive index value of this schedule sequences.The present invention uses Min-max method for normalizing,
By certain value x of index A, being standardized by min-max, being mapped to value x' of interval [0,1], formula is:In formula, minA and maxA is respectively the minimum and maximum value of index A.Although the two indices pair being carried
The execution of program all produces important impact, but, the transmission of information between process, needed for performing much larger than statement in process
Time so that after normalization, same difference, the impact on executing efficiency for the average communication cost is estimated greatly than Halstead
Many, therefore, the weight of average communication cost is taken as 0.8, and the weight that Halstead estimates is taken as 0.2;Finally, from of equal value
In schedule sequences, select the schedule sequences that comprehensive index value is minimum, as desired schedule sequences.
Application example
It is applied to the concurrent program schedule sequences reduction method of proposition in benchmark test, by series of experiments,
Verify following 3 problems, the evaluation present invention:
(1) use the method for the present invention, the schedule sequences affecting object statement can be found, and form schedule sequences of equal value
Class?
(2) use the method for the present invention, the schedule sequences of yojan object statement, the effect that object statement covers can be improved
Rate?
(3) index that the present invention proposes is used, can selection scheduling sequence from schedule sequences class of equal value, reduce program and hold
The cost of row?
The configuration of experimental situation is as follows: hardware configuration is Intel Core i5CPU, 500G hard disk and 4G internal memory;Software kit
Include Windows 8.1 operating system, Visual Studio 2013 compiler, and MPI application software MPICH.
Selecting 10 benchmark programs as tested program, the essential information of these programs is as listed in table 1.Program Convex_
Quadrilateral finds 3 angle values less in 4 angle values of input, and judges that can they constitute convex quadrangle.
Match is accomplished that string matching function.Program Server_client has master-slave architecture, and host process processes different son
The message that process sends.Server_client_communication is to change, based on to Server_client, the journey obtaining
Sequence.The relation realizing between matrix multiple, and judgment matrix element of program Matrix.Deposit_withdraw is one and deposits
Withdraw the money simulation program.Including is for judging the position relationship a little and between polygon.Creator_consumer is one
The program of simulated production consumption.Date_swich investigates the relevant information of inputting date.Min program is for asking for many numbers
Little value.
The essential information of table 1 tested program
(1) validation problem 1
In order to answer this validation problem, to each tested program, investigate all of branched structure.For each branch knot
Structure, therefrom an optional statement, as object statement;All object statements form the object statement collection of this program.For each
Object statement, uses the inventive method, determines the schedule sequences affecting this statement, and forms schedule sequences equivalence class.
Its result is as listed in table 2.In table, the 1st row are tested program;2nd is classified as the schedule sequences number that program comprises;The
Object statement bar number is shown in 3 lists;4th row provide the schedule sequences number affecting object statement;5th row reflection equivalence schedule sequences
The number of class;The yojan rate of last column count schedule sequences.In view of only selecting a tune from each schedule sequences class of equal value
Degree series, therefore, the schedule sequences number after yojan is equal with the number of schedule sequences class of equal value, thus yojan rate is, impact
After the schedule sequences number of object statement and the difference of schedule sequences class number of equal value, then with the schedule sequences number affecting object statement
Ratio.
The schedule sequences yojan result of table 2 tested program
As shown in Table 2, (1) is except program Server_client and Server_client_communication, some
Schedule sequences does not affect outside object statement, and for other programs, arbitrary schedule sequences all affects object statement.This explanation, adjusts
The impact on object statement for the degree series is very big;(2) the schedule sequences yojan degree of distinct program is different, at these
In program, that schedule sequences yojan rate is the highest is Min, up to 97%.This is because, for a lot of statements of this program, impact
The schedule sequences of this statement, can be only formed 1 schedule sequences class of equal value;For the schedule sequences of had an impact object statement, shape
The number of the average equivalent class becoming is only 3.5, causes the substantial amounts of schedule sequences of yojan;Minimum schedule sequences yojan rate also reaches
To 50%, have 5 programs, respectively Convex_quadrilateral, Server_client, Server_client_
Communication, Deposit_withdraw and Date_swich;(3) for all tested program, schedule sequences yojan rate
Mean value be 85%.
Above-mentioned test result indicate that, use method of the invention, it is possible to find the schedule sequences affecting object statement, and shape
Become schedule sequences class of equal value, thus greatly reduce the schedule sequences number needing to perform.
(2) validation problem 2
For each object statement of tested program, utilize same test data set, dispatch sequence based on yojan and not yojan
Row, investigate the program runtime that coverage goal statement needs, so that the efficiency that object statement covers to be described.In the experiment of this group, about
The schedule sequences of letter is randomly choosing from the schedule sequences of each equivalence.In experiment below, employing will be provided
The index of the present invention, from schedule sequences of equal value, the superiority of selection scheduling sequence.
When not yojan schedule sequences, for a certain test data, in a certain order, each scheduling sequence is performed successively
Row.After schedule sequences yojan, for identical test data, in a certain order, perform the tune after each yojan successively
Degree series.
The object statement of tested program covers, and required program execution time is as listed in table 3.In table, the 1st row are by ranging
Sequence;2nd is classified as not yojan schedule sequences, program execution time needed for data cover object statement for the test;Scheduling is shown in 3rd list
After sequence yojan, reach identical coverage goal, required program execution time;Last column count time speed-up ratio, be
The program execution time reducing after yojan schedule sequences, the ratio with execution time needed for not yojan schedule sequences.
Table 3 tested program object statement covers required program execution time
As shown in Table 3, (1) covers the object statement of distinct program, and the speed-up ratio of required program execution time is different,
Wherein, what time speed-up ratio was maximum is program Min, up to 98%.This is because, the considerable object statement of this program, only 1
The schedule sequences class of individual equivalence so that same test data, before schedule sequences yojan, performs 120 schedule sequences;And
After schedule sequences yojan, only perform a schedule sequences;The minimum program of time speed-up ratio is Convex_
Quadrilateral, even and if this, also reach 32%;(2) for all 10 tested program, the mesh of these programs is covered
Poster sentence, the mean value of required program execution time speed-up ratio is 81%.It means that use the method for the present invention, yojan is adjusted
Degree series, covers the object statement of tested program, and required program execution time can shorten more than 3/4ths.
Above-mentioned test result indicate that, use the method for the present invention, the schedule sequences of yojan object statement, can be greatly shortened
Program execution time needed for coverage goal statement, thus improve the efficiency that object statement covers.
(3) validation problem 3
Affect the desired value of object statement schedule sequences firstly the need of calculating.The present invention considers altogether 2 indexs, its
In, first index is average communication cost.
When calculating the average communication cost of schedule sequences, need the value of parameter σ and θ, here, use " ping-pong procedure " to obtain.
Based on the experimental situation of the present invention, parameter σ obtaining and the value of θ are respectively as follows: σ=10.2, θ=3.32 × 10-4, it may be assumed that point-to-point
The transmission delay of communication is 10.2 μ s, and the time needed for each byte of transmitting is 3.32 × 10-4μs。
As a example by the 1st schedule sequences class of equal value of program Including object statement 1, this equivalence schedule sequences class bag
The desired value of each schedule sequences containing is as listed by table 4.
The schedule sequences desired value of table 4 program Including
Owing to the less schedule sequences of desired value is better, therefore, in the schedule sequences class of this equivalence, select the 1st tune
Degree series.Schedule sequences class for other equivalences of object statement 1, it is also desirable to calculate the index of contained each schedule sequences
Value, and the schedule sequences that selective goal value is minimum.It for other object statements, is also adopted by said method, selection scheduling sequence.
Now, the reasonability of the put forward index of the present invention is evaluated.To this end, from the schedule sequences class of equal value affecting object statement
In, use the method for the present invention, select 1 schedule sequences, calculate based on this schedule sequences, the program needed for coverage goal statement
Execution time, and compare with randomly choosing a schedule sequences from above-mentioned equivalence class.
For tested program, under different schedule sequences selection modes, when object statement covers required program execution
Between mean value as listed in table 5.Tested program is shown in 1st list in table, and the object statement number of corresponding program, the 3rd row are shown in the 2nd list
For randomly choosing a schedule sequences, the program execution time needed for coverage goal statement from schedule sequences class of equal value;4th
The index selection scheduling sequence utilizing the present invention, the program execution time needed for coverage goal statement are shown in list;Last arranges meter
Evaluation time speed-up ratio, uses and calculates with above identical method.
Program execution time (all tested program) under the different schedule sequences system of selection of table 5
As shown in Table 5, (1) is for different tested program, uses the method choice schedule sequences of the present invention, coverage goal
The speed-up ratio of program execution time needed for statement is different, and wherein, what time speed-up ratio was maximum is program Server_client_
Communication, is 81%.This shows, can shorten the program execution time more than 3/4ths;Program Server_
The time speed-up ratio of client is minimum, nonetheless, also saves the program execution time of nearly 1/4th;(2) for selected
Tested program, the mean value of time speed-up ratio is 46%.It means that be suitable for the statement of system of selection of the present invention for those,
With randomly choose compared with schedule sequences, use the present invention method choice schedule sequences, the program execution time of saving nearly
Half.
Above-mentioned test result indicate that, use the index that the present invention proposes, selection scheduling sequence from schedule sequences class of equal value,
The cost that program performs can be greatly reduced.
Claims (3)
1. the schedule sequences affecting object statement determines, its feature is as follows
Message-passing parallel program comprises multiple schedule sequences, but, it is not each schedule sequences, all affect a certain target
The execution of statement;In order to cover this object statement, find and affect the schedule sequences that this object statement performs, be very important;
The execution of a certain object statement of so-called schedule sequences impact, refers at least there is a program input, according to the scheduling of this sequence
The different processes of program, are able to carry out this object statement;
The method that the present invention is combined with static analysis by Dynamic Execution, finds the schedule sequences affecting object statement;
First, it is considered to the input set of a certain program;For a certain input in this set, perform each scheduling of this program successively
Sequence;It if there is a certain schedule sequences, under this input, is able to carry out object statement, then, this sequence is and affects target
The schedule sequences that statement performs;Then, it is considered to next schedule sequences, and record the execution whether this sequence affects object statement,
Until all of schedule sequences is all performed;For not affecting the schedule sequences that object statement performs, use new program
Input, repeats said process, until all of schedule sequences all affects object statement or all of input is performed both by program;
Owing to said method is by performing tested program, finding desired schedule sequences, therefore, the method is called dynamic method;Adopt
By dynamic method, although some can be found to affect the schedule sequences that object statement performs, but, whether the method is effective, with journey
Sequence input set is closely related;If it is improper that this set is chosen, then, it may be difficult to find out all of expectation schedule sequences;
At this time, it may be necessary to pass through the static analysis control statement related to object statement, and the relation of control statement and schedule sequences, with
Determining whether certain schedule sequences affects the execution of object statement, the method is referred to as static method;
It is readily apparent that, by dynamic method, the schedule sequences needing to find further can be reduced, thus mitigate to a certain extent
Use the analysis burden that static method causes;Find desired schedule sequences by static method, can make up in dynamic method due to
The improper schedule sequences causing of Resource selection finds infull defect;The side that this Dynamic Execution combines with static analysis
Method, contributes to finding all of schedule sequences affecting object statement execution.
2. the formation of object statement schedule sequences class of equal value, its feature is as follows
For identical program input, different schedule sequences, the object statement of execution is different, but, between these statements
Execution relation is not completely self-contained, but there is certain contact;Whether the practice condition according to object statement is identical, will impact
The schedule sequences divide into several classes of object statement, the schedule sequences in every class is all of equal value;
Consider the set of concurrent program all schedule sequences composition, be designated as S, this program process PiJ-th statementFor target language
Sentence;Whether affect according to schedule sequencesExecution, set S is divided into following two classes: a class is impactThe scheduling sequence performing
The set of row composition, is designated asAnother kind of for not affectingThe set of the schedule sequences composition performing, is designated asSo,According to arbitrary input under,Can perform, willIt is further divided into following m class:
In formula, m is the number of equivalence class,It isK-th schedule sequences class of equal value;
Below, the finding method of schedule sequences class of equal value is given;When object statement is present in branch or loop structure, must deposit
Directly control the statement of dependence an object statement;Claim object statement directly to control the statement of dependence, be target-dependent language
Sentence;In view of the schedule sequences of concurrent program, corresponding uncertain communication statement and match statement reflection thereof can be passed through, because of
This, if affecting the uncertain communication statement of the corresponding target-dependent statement of object statement and match statement is all identical, then, phase
The schedule sequences answered is of equal value;The present invention passes through program dependency graph, portrays and affects the uncertain logical of this target-dependent statement
Relation between letter statement or its match statement;This dependence can be that control relies on, it is also possible to is data dependence, also may be used
To be that communication relies on;In view of the present invention is identical to the processing mode of different dependences, therefore, do not subdivide these and rely on pass
System;According to the dependence between statement, corresponding program dependency graph can be obtained;
According to the corresponding program dependency graph of a certain schedule sequences, from the summit of the corresponding target-dependent statement of object statement, edge
The contrary direction of directed edge, find the summit of the uncertain communication statement of all correspondences and match statement, obtain a summit sequence
Row;For different schedule sequences, if above-mentioned vertex sequence is identical, then, corresponding schedule sequences is equivalence
Schedule sequences;By said method, the schedule sequences of multiple equivalence can be obtained.
3. the selection of schedule sequences, its feature is as follows
In schedule sequences of equal value, as long as selecting one of them test just permissible, other can be with yojan;For tune of equal value
Degree series, although the object statement of execution is identical, but, different schedule sequences, the execution process of program is simultaneously incomplete same;
Now, how from schedule sequences of equal value, a suitable schedule sequences is selected, extremely important to improve testing efficiency;Mirror
In this, this step will provide a kind of schedule sequences system of selection;
For rational selection scheduling sequence, the present invention is by setting up an index system, under different schedule sequences, program
Executing Cost is evaluated;This index system comprises following 2 indexs, respectively: average communication cost and Halstead estimate;
For schedule sequences each in equivalence class, calculate the two performance index value, and select comprehensive index value minimum, as
Schedule sequences after yojan
Index 1: average communication cost
The communication mode of message-passing parallel program, can be divided into following 2 classes: point to point link and group communicate;If 2 processes
By the message of point-to-point communication transmission n byte, transmission delay is σ, and the time needed for each byte of transmitting is θ, then, complete
This traffic operation needs θ the unit interval of σ+n;In view of group communication realizes based on point to point link, based on point to point link operation
The time needing, by different models, can be evaluated whether the communication cost under different group communication mode;
In message-passing parallel program, completing a traffic operation, the cooperation needing 2 or multiple process communication functions could be complete
Become;In order to avoid certain communication cost computes repeatedly, perform the communication cost producing to each communication functions, do specified below:
Message sends and message sink function coordinates, and completes a point to point link, produces the communication overhead of θ unit interval of σ+n, that
, message sends the execution of function or receiver function, and the communication cost of generation isThe individual unit interval;For multiple processes
Group communication functions jointly coordinate, complete a traffic operation, each communication functions performs the communication cost producing, and is respective sets
Communication cost and the ratio of process number;
Under same schedule sequences, different program inputs, the communication functions of execution is not necessarily identical, consequent communication generation
Valency is also not necessarily identical;In consideration of it, with under this schedule sequences, go to the mean value of object statement communication cost, react this tune
The communication cost of degree series;
Below, the type according to communication functions place program structure, calculates the average communication cost of this communication functions;
If a certain communication functions is in the sequential organization of a certain process, then, it as long as performing this process, is carried out this communication
Function, and produce communication cost;But, if this communication functions is in the branched structure of a certain process, then, this process
Perform, do not ensure that this communication functions also performs;In view of the execution of this communication functions is a chance event, therefore, it can
Use probability, represent the possibility that this communication functions performs;Being readily apparent that, the execution of this communication functions, it performs with control
The true value of conditional statement predicate expressions is closely related;Note predicate expressions be genuine probability be p, if this communication functions perform
Communication cost be α unit interval, then, the execution of this communication functions, required average communication cost is α unit of p
Time;When this communication functions is in a certain course cycles structure, it is assumed that the number of times performing loop structure is n, due to
Circulation, is performed both by this communication functions, therefore, the execution of this communication functions every time, and required average communication cost is n α;
Assume the communication functions that a certain schedule sequences comprises, N1,N2,N3Individual lay respectively at process sequential organization, branched structure and
In loop structure, wherein, in sequential organization, the communication cost of i-th communication functions is αiIndividual chronomere, in branched structure,
The communication cost of j-th communication functions is βjIndividual chronomere, in loop structure, the communication cost of k-th communication functions is γk
Individual chronomere, then, the average communication cost of this schedule sequences is
Index 2: the Halstead of schedule sequences estimates
In message-passing parallel program, the statement that there is order execution relation is likely to be present in different processes, and weighing-appliance has
A series of statements that order performs relation are a statement sequence;The process more than one comprising due to concurrent program, therefore, should
One paths of program, usually contains multiple statement sequence;Being readily apparent that, the complexity of different statement sequences is different, and
The maximum statement sequence of complexity often affects the execution in path;The maximum statement sequence of our complexity is called key sentence sequence
Row;In order to reflect the complexity of a statement sequence, present invention introduces Halstead and estimate;
Remembering that a statement sequence is Sq, the operator comprising and the number of operand are respectively N1And N (Sq)2(Sq), Sq
Halstead is a length of:
L (Sq)=N1(Sq)+N2(Sq)
The all statement sequences comprising for a paths, calculate the Halstead length of each sequence, then, Halstead length
The maximum statement sequence of degree, it is simply that the key sentence sequence in this path;The mulitpath relating to for a schedule sequences, asks for
The key sentence sequence in each path, and by the maximum Halstead length of these statement sequences, as this schedule sequences
Halstead estimates;
For each schedule sequences, obtain the average communication cost of this sequence and after Halstead estimates, by normalization
Value weighted sum, the comprehensive index value of this schedule sequences can be obtained;The present invention, by certain value x of index A, is mapped to interval
Value x' of [0,1], formula is:In formula, minA and maxA is respectively the minimum and maximum value of index A;
The weight of average communication cost is taken as 0.8, and the weight that Halstead estimates is taken as 0.2;Finally, from schedule sequences of equal value
In, select the schedule sequences that comprehensive index value is minimum, as desired schedule sequences.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610390006.3A CN106095669B (en) | 2016-06-03 | 2016-06-03 | Parallel program testing method based on scheduling sequence reduction |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610390006.3A CN106095669B (en) | 2016-06-03 | 2016-06-03 | Parallel program testing method based on scheduling sequence reduction |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106095669A true CN106095669A (en) | 2016-11-09 |
CN106095669B CN106095669B (en) | 2020-09-25 |
Family
ID=57448526
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610390006.3A Expired - Fee Related CN106095669B (en) | 2016-06-03 | 2016-06-03 | Parallel program testing method based on scheduling sequence reduction |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106095669B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108549607A (en) * | 2018-04-17 | 2018-09-18 | 中国矿业大学 | Message-passing parallel program Multiple path coverage test data coevolution generation method |
CN108959062A (en) * | 2017-05-22 | 2018-12-07 | 腾讯科技(深圳)有限公司 | Web page element acquisition methods and device |
CN114675977A (en) * | 2022-05-30 | 2022-06-28 | 山东科华电力技术有限公司 | Distributed monitoring and transportation and management system based on power internet of things |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101984412A (en) * | 2010-10-13 | 2011-03-09 | 北京航空航天大学 | Method for scheduling parallel test tasks based on grouping and tabu search |
US20120158895A1 (en) * | 2010-12-17 | 2012-06-21 | Fujitsu Limited | Testing apparatus, testing method and computer-readable storage medium |
CN103257921A (en) * | 2013-04-16 | 2013-08-21 | 西安电子科技大学 | Improved random forest algorithm based system and method for software fault prediction |
CN103902457A (en) * | 2014-04-17 | 2014-07-02 | 中国矿业大学 | Method for generating test data covering parallel program paths based on coevolution |
CN104778088A (en) * | 2015-04-17 | 2015-07-15 | 华中科技大学 | Method and system for optimizing parallel I/O (input/output) by reducing inter-progress communication expense |
-
2016
- 2016-06-03 CN CN201610390006.3A patent/CN106095669B/en not_active Expired - Fee Related
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101984412A (en) * | 2010-10-13 | 2011-03-09 | 北京航空航天大学 | Method for scheduling parallel test tasks based on grouping and tabu search |
US20120158895A1 (en) * | 2010-12-17 | 2012-06-21 | Fujitsu Limited | Testing apparatus, testing method and computer-readable storage medium |
CN103257921A (en) * | 2013-04-16 | 2013-08-21 | 西安电子科技大学 | Improved random forest algorithm based system and method for software fault prediction |
CN103902457A (en) * | 2014-04-17 | 2014-07-02 | 中国矿业大学 | Method for generating test data covering parallel program paths based on coevolution |
CN104778088A (en) * | 2015-04-17 | 2015-07-15 | 华中科技大学 | Method and system for optimizing parallel I/O (input/output) by reducing inter-progress communication expense |
Non-Patent Citations (2)
Title |
---|
SINAN ESKI: "An Empirical Study on Object-Oriented Metrics and Software Evolution in Order to Reduce Testing Costs by Predicting Change-Prone Classes", 《2011 IEEE FOURTH INTERNATIONAL CONFERENCE ON SOFTWARE TESTING, VERIFICATION AND VALIDATION WORKSHOPS》 * |
田甜 等: "基于覆盖难度选择路径的测试数据进化生成", 《浙江大学学报(工学版)》 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108959062A (en) * | 2017-05-22 | 2018-12-07 | 腾讯科技(深圳)有限公司 | Web page element acquisition methods and device |
CN108549607A (en) * | 2018-04-17 | 2018-09-18 | 中国矿业大学 | Message-passing parallel program Multiple path coverage test data coevolution generation method |
CN108549607B (en) * | 2018-04-17 | 2021-05-18 | 中国矿业大学 | Message transmission parallel program multi-path coverage test data coevolution generation method |
CN114675977A (en) * | 2022-05-30 | 2022-06-28 | 山东科华电力技术有限公司 | Distributed monitoring and transportation and management system based on power internet of things |
CN114675977B (en) * | 2022-05-30 | 2022-08-23 | 山东科华电力技术有限公司 | Distributed monitoring and transportation and management system based on power internet of things |
Also Published As
Publication number | Publication date |
---|---|
CN106095669B (en) | 2020-09-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Bloom | Structural operational semantics for weak bisimulations | |
CN103502934B (en) | Vector conflict instructions | |
Al-Hajjaji et al. | Delta-oriented product prioritization for similarity-based product-line testing | |
Yuan et al. | Iterative execution-feedback model-directed GUI testing | |
CN107315889A (en) | The performance test methods and storage medium of simulation engine | |
Finkbeiner et al. | Coordination logic | |
Mala et al. | Quality improvement and optimization of test cases: a hybrid genetic algorithm based approach | |
CN106095669A (en) | Parallel program testing method based on schedule sequences yojan | |
Hillston et al. | Stochastic process algebras: From individuals to populations | |
CN109739740A (en) | A kind of AADL model combination formalization verification method | |
Surendran et al. | Evolution or revolution: the critical need in genetic algorithm based testing | |
Szpyrka et al. | Formal description of Alvis language with α 0 system layer | |
Bombarda et al. | An automata-based generation method for combinatorial sequence testing of finite state machines | |
Dhavachelvan et al. | Multi-agent-based integrated framework for intra-class testing of object-oriented software | |
Gafni et al. | Read-write memory and k-set consensus as an affine task | |
Chen et al. | Quantitative analysis of leakage for multi-threaded programs | |
Graf | On the strongly connected components of random directed graphs with given degree sequences | |
Gallos et al. | WebSnapse v3: Optimization of the Web-based Simulator of Spiking Neural P System using Matrix Representation, WebAssembly and Other Tools | |
Li et al. | Using design space exploration for finding schedules with guaranteed reaction times of synchronous programs on multi-core architecture | |
Ma et al. | carat: an R package for covariate-adaptive randomization in clinical trials | |
Lefticaru et al. | An improved test generation approach from extended finite state machines using genetic algorithms | |
Rauf et al. | Fully automated gui testing and coverage analysis using genetic algorithms | |
Bożejko et al. | Parallel genetic algorithm for the flow shop scheduling problem | |
Balbo et al. | On the computation of performance characteristics of concurrent programs using GSPNs | |
Tossou et al. | Differentially private, multi-agent multi-armed bandits |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20200925 Termination date: 20210603 |
|
CF01 | Termination of patent right due to non-payment of annual fee |