Combined test priority ranking method and system based on railway signal software
Through the combined test priority sorting method based on railway signal software, the concept of solute particles and stock solution is used to optimize the execution order of test cases, solving the problem of inefficient combination tests of railway signal software, and achieving efficient and economical testing coverage.
Patent Information
- Application Number
- CN202411522096.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-02-18
AI Technical Summary
When the combined test cases of railway signal software are executed in a natural order, the test efficiency is inefficient and it is difficult to effectively check potential errors in the system software for a limited time.
Through a combined test priority sorting method based on railway signal software, the execution order of test cases is optimized using the concept of solute particles and stock solution, based on the preset C-APCC value calculation formula and motion update strategy.
Improves testing efficiency, reduces unnecessary testing costs, and ensures high coverage test results within a limited time.
Smart Images

Figure CN119473883A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of test sequencing, and in particular to a method and system for sequencing combined test priorities based on railway signal software. Background Art
[0002] The railway signal system is a key technical equipment to ensure the safe and efficient operation of trains under high-speed and high-density tracking conditions. The safety of its software is of vital importance. Once a dangerous failure occurs, it may lead to a catastrophic traffic accident. Therefore, the railway signal system software is called safety-critical software, which needs to pass rigorous testing to ensure its safe and reliable operation.
[0003] Typically, after the combination test cases of railway signal software are generated, they are executed one by one in the order in which they naturally appear in the set. This execution method causes the test execution cost to increase as the test progresses, but the test coverage rate increases relatively slowly, resulting in low test efficiency and difficulty in effectively troubleshooting potential errors in the system software within a limited time.
[0004] Based on this, there is an urgent need for a combination test priority sorting method and system based on railway signal software, which can reasonably optimize the execution order of combination test cases of railway signal software, improve test efficiency, and provide guidance for efficient testing of railway signal software. Summary of the invention
[0005] One of the purposes of the present invention is to provide a combination test priority sorting method and system based on railway signal software, which can reasonably optimize the execution order of combination test cases of railway signal software, improve test efficiency, and provide guidance for efficient testing of railway signal software.
[0006] In order to achieve the above object, a combined test priority sorting method based on railway signal software is provided, comprising the following steps:
[0007] S1. Get the combined test case set to be sorted T = {τ1, τ2,…, τ n}, and according to the obtained combined test case set, a number of solute particles S are randomly generated, and according to the number of solute particles, a corresponding stock solution R = {S1, S2, ..., S N}, the S N S is the Nth test execution sequence in the combined test case set; N ={τ N1 ,τ N2 ,…,τ Nn};
[0008] S2. According to the formed stock solution R, the C-APCC value calculation formula of the execution sequence based on the preset test case is calculated to calculate the C-APCC value corresponding to each solute particle in the stock solution;
[0009] S3. According to the C-APCC values corresponding to each solute particle in the original solution, the solute particle with the largest C-APCC value is selected as the current optimal particle S b , and according to the current optimal particle S b , and each solute particle in the original solution, based on the preset solute particle movement update strategy, each solute particle in the original solution is moved toward the particle direction with the optimal solution in the current original solution, and each solute particle in the original solution is updated;
[0010] S4. According to each updated solute particle, based on the preset solute particle filtering strategy, the corresponding filtering threshold fr is calculated, and according to the filtering threshold, each solute particle in the original solution is filtered into a filtrate B and a waste liquid W;
[0011] S5. Based on the preset solute particle movement update strategy, the solute particles in the waste liquid W are updated for the second time. After the solute particles in the waste liquid are updated, it is determined whether the C-APCC value corresponding to each solute particle is lower than the filtration threshold fr. If so, the corresponding solute particles are excreted and removed, and new individuals are reintroduced for replacement;
[0012] If not, determine whether the C-APCC value of the solute particle is higher than that of the solute particle S with the smallest C-APCC value in filtrate B. w If so, the corresponding solute particles are reabsorbed into the filtrate B, and S w Secreted into waste fluid W;
[0013] S6: Determine whether the current number of iterations reaches the preset number of iterations. If not, execute S2 to S5 in a loop. Otherwise, search for the optimal test execution sequence S. best .
[0014] Technical principles and effects of this solution: In this solution, the first step is to obtain a combination test case set T to be sorted. Based on the combination test case set, a number of solute particles are randomly generated to form a corresponding stock solution. The specific stock solution includes multiple solute particles. Each solute particle is a set formed by the sorting of each test case in a set of combination test case sets. Subsequently, each solute particle in the stock solution will be processed to find the best solute particle, thereby completing the sorting of the combination test case set.
[0015] Specifically, in the current iteration, the C-APCC value corresponding to each solute particle in the stock solution is calculated, so as to select the solute particle with the largest C-APCC value in the stock solution in the current iteration, and use the solute particle as the current optimal particle S corresponding to the current iteration. b Then, a preset solute particle movement update strategy can be given to move each solute particle in the original solution under the current iteration toward the direction of the particle with the optimal solution in the current original solution, that is, toward the current optimal particle, so as to update each solute particle in the original solution and update the test case sequence corresponding to each solute particle.
[0016] Then, for each updated solute particle in the original solution, the corresponding filtering threshold is calculated based on the preset solute particle filtering strategy, and each solute particle in the original solution is filtered through the filtering threshold, and each solute particle in the original solution is filtered into filtrate B and waste liquid W. Based on the preset solute particle movement update strategy, after the solute particles in the waste liquid are updated twice, the C-APCC value of the solute particles after the second update is calculated and judged to determine whether the C-APCC value corresponding to each solute particle is lower than the filtering threshold fr. If so, the corresponding solute particles are excreted and removed, and new individuals are reintroduced for replacement;
[0017] If not, determine whether the C-APCC value of the solute particle is higher than that of the solute particle S with the smallest C-APCC value in filtrate B. w If so, the corresponding solute particles are reabsorbed into the filtrate B, and S w Secreted into the waste liquid W. This completes the processing steps corresponding to the current iteration.
[0018] Finally, determine whether the current number of iterations reaches the preset number of iterations. If not, loop through S2 to S5. Otherwise, search for the optimal test execution sequence S. best .
[0019] In this scheme, the sorting optimization of test cases in each solute particle in the original solution is achieved by calculating the C-APCC value of each solute particle in the original solution, and performing the steps of movement, update, filtration, excretion, reabsorption and secretion of the solute particles. Since the corresponding solute particle movement update strategy and solute particle filtration strategy are set, the sorting optimization efficiency of the test cases corresponding to each solute particle in the original solution is greatly improved, and at the same time, the reasonable and efficient sorting of test cases is achieved, and the coordinated growth of test cost and coverage is achieved, which provides a guiding basis for the efficient implementation of the combination test of railway signal software.
[0020] Furthermore, the C-APCC value calculation formula of the preset test case execution sequence is:
[0021]
[0022] In the formula, Solute particle S N The corresponding C-APCC value, τ Ni is the i-th test case executed by the N-th test execution sequence in the combined test case set, i = 1, 2, 3, ..., n, τ Ni ∈T; cost(τ Ni ) is τ Ni The execution cost of Nj ) is τ Nj The set of all t-value patterns covered, Π(T) is the set of all t-value patterns corresponding to the combined test set T.
[0023] Beneficial effects: By calculating the C-APCC value, the optimal test case execution sequence can be identified, thereby reducing unnecessary testing costs while ensuring coverage. This means that the test task can be completed in a shorter time and the test efficiency can be improved. Through the C-APCC value, the effect of the test execution sequence can be predicted in advance, making the test plan more scientific and reasonable, and reducing the uncertainty in the test process.
[0024] Furthermore, the preset solute particle movement update strategy includes the following steps:
[0025] Create a first sequence and initialize the first sequence S′. The execution order of the test cases corresponding to the first sequence S′ is to be determined. The first sequence S′ is a 1×n matrix, where n=|T|.
[0026] According to the current optimal particle S b , in the current optimal particle S b Randomly select the test cases corresponding to the columns 0∽n in the sequence S′, and fill the test cases of the selected columns into the columns corresponding to the first sequence S′;
[0027] According to each solute particle in the original solution, the corresponding selected test case is marked in each solute particle, and the occupied position of the selected test case is marked in the first sequence;
[0028] According to the original test execution order in each solute particle, the remaining unmarked test cases are merged into the unmarked columns in the first sequence S′ in turn to form the first sequence S′ corresponding to each solute particle, and the first sequence S′ corresponding to each solute particle is assigned as a whole to the corresponding solute particle to complete the update of each solute particle.
[0029] Beneficial effects: In this scheme, an initial first sequence S' is created, whose length is equal to the size n of the test case set T (i.e. |T|), representing a 1×n matrix, in which each element represents the execution position of a test case. At this time, the execution order of the test cases in S' has not been determined, and all positions are empty.
[0030] Then, a part of the test cases is randomly selected from the current optimal particle, and the corresponding test cases are filled into the corresponding positions of the first sequence. This step ensures that the new sequence inherits some characteristics of the current optimal particle, thereby retaining certain excellent genes, which can speed up the convergence speed, avoid blind search, and make the algorithm tend to the global optimal solution faster. Randomly selecting some test cases, rather than all, retains the diversity of the original particles, helps avoid falling into the local optimum too early, and increases the robustness of the algorithm.
[0031] In the stock solution (i.e. the current set of test cases), mark the selected test cases and mark the positions of these test cases in the first sequence to indicate that these positions are occupied. This step is to avoid repeated selection of the same test cases and ensure the uniqueness of the sequence. By marking the selected test cases, repeated selection of the same test cases is avoided, unnecessary computational overhead is reduced, and algorithm efficiency is improved.
[0032] According to the original test execution order in each solute particle, the remaining unmarked test cases are merged into the unmarked positions in the first sequence in turn. This is done to make full use of the existing information and maintain the coherence and rationality of the sequence. By gradually filling the sequence, the update process is simplified, so that each step of the update has a clear purpose and logic, which is easy to understand and implement.
[0033] The first sequence corresponding to each solute particle formed after the update is assigned to the corresponding solute particle as a whole, completing the update of each solute particle. Through this process, each solute particle obtains a new test case execution sequence, which is generated based on the inheritance of the current optimal particle characteristics.
[0034] Furthermore, the preset solute particle filtering strategy includes the following steps:
[0035] Set the corresponding filtering percentage α; 0<α≤1;
[0036] According to the solute particles after the original solution is updated, calculate the solute particle S i The corresponding C-APCC value, i = 1, 2, ..., N;
[0037] According to each solute particle S iThe corresponding C-APCC value is used to sort the solute particles in descending order to obtain the sorted stock solution R′={S r1 ,S r2 ,…,S rN};
[0038] Based on the preset filter particle number calculation formula, the number of particles retained after filtration l is calculated;
[0039] The calculation formula for the number of filtered particles is:
[0040]
[0041] In the formula, represents the smallest positive integer greater than N×(1-α);
[0042] According to the number of particles retained after filtering, the corresponding filtering threshold fr is calculated based on the preset filtering threshold calculation formula;
[0043] The filtering threshold calculation formula is:
[0044]
[0045] According to the calculated filtration threshold, each solute particle after the original solution is updated is filtered, and each solute particle in the original solution is filtered into filtrate B and waste liquid W, where the filtrate Waste liquid W = R\B.
[0046] Beneficial effects: In this solution, the solute particle filtration strategy mainly separates excellent solute particles, namely the solute particles in the filtrate, from the original solution by setting the filtration percentage and calculating the filtration threshold. By setting the filtration percentage and calculating the filtration threshold, it is possible to predict in advance which test case execution sequences are more likely to be optimal, making the test plan more scientific and reasonable.
[0047] Retaining the test case execution sequence with a higher C-APCC value ensures that more t-value patterns are covered, thereby improving the comprehensiveness and reliability of the test, and removing those solute particles with a lower C-APCC value to retain the optimal test case execution sequence, thereby improving test efficiency. This means that while ensuring coverage, unnecessary test costs are reduced.
[0048] Ensure that resources are spent on the most critical and effective test cases, rather than wasting them on those that are costly but have low contribution.
[0049] The present invention also provides a combination test priority sorting system based on railway signal software, using the above-mentioned combination test priority sorting method based on railway signal software, comprising:
[0050] The data acquisition module is used to obtain the corresponding combination test case set T = {τ1, τ2, ..., τ n}, and according to the obtained combined test case set, a number of solute particles S are randomly generated, and according to the number of solute particles, a corresponding stock solution R = {S1, S2, ..., S N}, the S N S is the Nth test execution sequence in the combined test case set; N ={τ N1 ,τ N2 ,…,τ Nn};
[0051] A calculation module is used to calculate the C-APCC value corresponding to each solute particle in the stock solution according to the formed stock solution R and the C-APCC value calculation formula of the execution sequence based on a preset test case;
[0052] The solute particle movement module is used to select the solute particle with the largest C-APCC value as the current optimal particle S according to the C-APCC value corresponding to each solute particle in the original solution. b , and according to the current optimal particle S b , and each solute particle in the original solution, based on the preset solute particle movement update strategy, each solute particle in the original solution is moved toward the particle direction with the optimal solution in the current original solution, and each solute particle in the original solution is updated;
[0053] A filtering module is used to calculate the corresponding filtering threshold fr according to each updated solute particle based on a preset solute particle filtering strategy, and filter each solute particle in the original solution into a filtrate B and a waste liquid W according to the filtering threshold;
[0054] The excretion and secretion module is used to perform a secondary update on the solute particles in the waste liquid W based on a preset solute particle movement update strategy, and after the solute particles in the waste liquid are updated, determine whether the C-APCC value corresponding to each solute particle is lower than the filtration threshold fr. If so, the corresponding solute particles are excreted and removed, and new individuals are reintroduced for replacement;
[0055] If not, determine whether the C-APCC value of the solute particle is higher than that of the solute particle S with the smallest C-APCC value in filtrate B. w If so, the corresponding solute particles are reabsorbed into the filtrate B, and S w Secreted into waste fluid W;
[0056] The loop output module is used to determine whether the current number of iterations reaches the preset number of iterations. If not, the calculation module continues to execute. Otherwise, the optimal test execution sequence S is searched. best . BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 This is a flow chart of a method for prioritizing combined tests based on railway signal software in Embodiment 1 of the present invention;
[0058] Figure 2 This is a block diagram of the software simulation test environment of the ZPW-2000 track circuit receiver in the first embodiment of the present invention;
[0059] Figure 3 The receiver software driver outputs the FSM model diagram in the first embodiment of the present invention;
[0060] Figure 4 is a cost-coverage curve diagram corresponding to different sequences in Example 1 of the present invention;
[0061] Figure 5 It is a C-APCC value variation curve diagram of different algorithms in Example 1 of the present invention;
[0062] Figure 6 is a cost-test coverage growth curve of the test set T in the first embodiment of the present invention;
[0063] Figure 7 The present invention is a logic block diagram of a combined test priority sorting system based on railway signal software in the first embodiment of the present invention. DETAILED DESCRIPTION
[0064] The following is further described in detail through specific implementation methods:
[0065] Embodiment 1
[0066] The combination test priority sorting method based on railway signal software is basically as follows Figure 1 As shown, the following steps are included:
[0067] S1. Get the combined test case set to be sorted T = {τ1, τ2,…, τ n}, and according to the obtained combined test case set, a number of solute particles S are randomly generated, and according to the number of solute particles, a corresponding stock solution R = {S1, S2, ..., S N}, the S N S is the Nth test execution sequence in the combined test case set; N ={τ N1 ,τ N2 ,…,τ Nn}; In this embodiment, the input corresponds to the combination test case set T to be sorted, and the preset number of iterations K, the total number of particles N and the filtering percentage α are set according to the needs. For example, step S1 sets the number of iterations K = 1000, the number of particles N = 200, and the filtering percentage α = 0.3. The test case set T is a 2-dimensional combination test suite generated by a laboratory simulation test environment based on the drive output function of the receiver of the ZPW-2000 track circuit. The drive output function of the receiver software judges the validity and legality of the signal based on the voltage, low frequency and carrier frequency characteristics of the input frequency-shifted signal. When a valid signal is input, after a delay of 2s, the track relay is driven to be energized, indicating that the current track section is not occupied. A solute particle represents a combination test case execution order.
[0068] The laboratory simulation test environment built for the receiver software is as follows Figure 2 As shown. The test environment includes a PC control machine, a signal generator, a configuration line board, a receiver (test object), a relay and an electronic stopwatch. The test case is represented by a combination of values of three signal parameters: carrier frequency, low frequency and voltage. The main control PC sends the corresponding parameters to the signal generator through the serial port in a timely manner according to the stored test cases and their execution time, and generates a frequency-shifted signal for testing. The receiver software receives and processes the test signal, and outputs the control signal to the relay according to the main rail / minor rail carrier frequency configuration of the configuration line board. The tester judges the execution result of the test case based on the relay action and the electronic stopwatch timing.
[0069] The FSM model for the software output function of a receiver based on the ZPW-2000 track circuit is as follows Figure 3 In this FSM model, the execution cost of an event is the time it takes to execute the event. The number of event values and their execution costs are shown in Table 1.
[0070] Input Events Execution cost / s Value / piece Valid signal 1 3 9 Valid signal 2 3 9 Valid signal 3 3 9 Invalid frequency 1 24 Invalid voltage 1 20 The frequency is invalid within 2s 1 24 The voltage is invalid within 2s. 1 20 Invalid frequency-voltage 2 24 Invalid voltage-frequency 1 20
[0071] Table 1 Number of event values and their execution costs
[0072] The 2-dimensional combinatorial test suite T obtained according to the FSM model is shown in Table 2. In Table 2, the test case set is the 2-dimensional combinatorial test case set generated according to the corresponding path, and the cost of the test case is the execution time. T contains a total of 8 test sets, 3028 test cases, and the total execution cost is 27106 seconds.
[0073] Test Set Number of test cases Cost / item <![CDATA[T1]]> 480 6s <![CDATA[T2]]> 480 9s <![CDATA[T3]]> 576 11s <![CDATA[T4]]> 180 7s <![CDATA[T5]]> 9 3s <![CDATA[T6]]> 216 7s <![CDATA[T7]]> 607 13s <![CDATA[T8]]> 480 6s
[0074] Table 2 Related information of combined test suite T
[0075] S2. According to the formed stock solution R, the C-APCC value calculation formula of the execution sequence based on the preset test case is calculated to calculate the C-APCC value corresponding to each solute particle in the stock solution;
[0076] The C-APCC value calculation formula of the preset test case execution sequence is:
[0077]
[0078] In the formula, Solute particle S N The corresponding C-APCC value, τ Ni is the i-th test case executed by the N-th test execution sequence in the combined test case set, i = 1, 2, 3, ..., n, τ Ni ∈T; cost(τ Ni ) is τ Ni The execution cost of Nj ) is τ Nj The set of all t-value patterns covered, Π(T) is the set of all t-value patterns corresponding to the combined test set T.
[0079] For example, the initialization will randomly initialize 200 solute particles as the stock solution R = {S1, S2, ..., S 200}, that is, 200 test execution sequences, and the execution order of test cases in each test execution sequence is different.
[0080] Calculate the C-APCC value for each solute particle.
[0081] Assume that S is one of the execution sequences, S = {τ c1 ,τ c2 ,…,τ cn}, then the C-APCC corresponding to S is calculated as follows.
[0082]
[0083] S3. According to the C-APCC values corresponding to each solute particle in the original solution, the solute particle with the largest C-APCC value is selected as the current optimal particle S b , and according to the current optimal particle S b , and each solute particle in the original solution, based on the preset solute particle movement update strategy, each solute particle in the original solution is moved toward the particle direction with the optimal solution in the current original solution, and each solute particle in the original solution is updated;
[0084] The preset solute particle movement update strategy includes the following steps:
[0085] A first sequence is set and the first sequence S′ is initialized. The execution order of the test cases corresponding to the first sequence S′ is to be determined. The first sequence S′ is a 1×n matrix, where n=|T|.
[0086] According to the current optimal particle S b , in the current optimal particle S b Randomly select the test cases corresponding to the columns 0∽n in the sequence S′, and fill the test cases of the selected columns into the columns corresponding to the first sequence S′;
[0087] According to each solute particle in the original solution, the corresponding selected test case is marked in each solute particle, and the occupied position of the selected test case is marked in the first sequence;
[0088] According to the original test execution order in each solute particle, the remaining unmarked test cases are merged into the unmarked columns in the first sequence S′ in turn to form the first sequence S′ corresponding to each solute particle, and the first sequence S′ corresponding to each solute particle is assigned as a whole to the corresponding solute particle to complete the update of each solute particle.
[0089] S4. According to each updated solute particle, based on the preset solute particle filtering strategy, the corresponding filtering threshold fr is calculated, and according to the filtering threshold, each solute particle in the original solution is filtered into a filtrate B and a waste liquid W;
[0090] S5. Based on the preset solute particle movement update strategy, the solute particles in the waste liquid W are updated for the second time. After the solute particles in the waste liquid are updated, it is determined whether the C-APCC value corresponding to each solute particle is lower than the filtration threshold fr. If so, the corresponding solute particles are excreted and removed, and new individuals are reintroduced for replacement;
[0091] If not, determine whether the C-APCC value of the solute particle is higher than that of the solute particle S with the smallest C-APCC value in filtrate B. w If so, the corresponding solute particles are reabsorbed into the filtrate B, and S w Secreted into waste fluid W;
[0092] The preset solute particle filtering strategy includes the following steps:
[0093] Set the corresponding filtering percentage α; 0<α≤1;
[0094] According to the solute particles after the original solution is updated, calculate the solute particle S i The corresponding C-APCC value, i = 1, 2, ..., N;
[0095] According to each solute particle S iThe corresponding C-APCC value is used to sort the solute particles in descending order to obtain the sorted stock solution R′={S r1 ,S r2 ,…,S rN};
[0096] Based on the preset filter particle number calculation formula, the number of particles retained after filtration l is calculated;
[0097] The calculation formula for the number of filtered particles is:
[0098]
[0099] In the formula, represents the smallest positive integer greater than N×(1-α);
[0100] According to the number of particles retained after filtering, the corresponding filtering threshold fr is calculated based on the preset filtering threshold calculation formula;
[0101] The filtering threshold calculation formula is:
[0102]
[0103] According to the calculated filtration threshold, each solute particle after the original solution is updated is filtered, and each solute particle in the original solution is filtered into filtrate B and waste liquid W, where the filtrate Waste liquid W = R\B.
[0104] is the C-APCC value of the lth particle in the sorted raw solution R'. In this embodiment, if l = 140, each iterative filtering step makes the number of retained particles l = 141. fr is the average C-APCC value of the 141th particle and the 142nd particle. The raw solution will be filtered into filtrate B and waste liquid W based on the value of fr.
[0105] S6: Determine whether the current number of iterations reaches the preset number of iterations. If not, execute S2 to S5 in a loop. Otherwise, search for the optimal test execution sequence S. best In this embodiment, before looping through S2 to S5, the filtered filtrate B and the waste liquid W need to be combined to update the stock solution. For example, looping through S2 to S5 1000 times, we can finally obtain several optimized test execution sequences {S1, S2, ..., S N}, where the test execution sequence with the largest C-APCC value is the S obtained by this method. best Based on α = 0.3 and α = 0.8, the corresponding S best , respectively denoted as S 本方法1 , S 本方法2 .
[0106] In this embodiment, in order to better illustrate the effect of the system, three test execution sequences are collected as controls for analysis, wherein the first one is the sequence S before sorting. 未排序 The second one uses the improved basic KA algorithm to obtain the sequence S 对照1 , where α = 0.3; the third sequence S obtained by using the improved basic KA algorithm 对照2 , where α=0.8.
[0107] The improved basic KA algorithm for comparison adopts the solute particle movement operator SoluteMovement for particle iterative update improved by this method on the basis of the basic KA algorithm, and the solute particle filtering operator SoluteFiltration retains the calculation method of the filtering threshold fr in the original KA algorithm.
[0108]
[0109] In the formula, α is a preset constant value, and |R| is the total number of particles in R. f(S) is the objective function value of particle S. After the calculation is completed, the algorithm filters R according to fr and divides it into two parts: filtrate and waste liquid. Among them, the filtrate contains solute particles with better solutions, and its objective function value is higher than fr; the waste liquid is composed of solute particles with worse solutions, and its objective function value is lower than fr.
[0110] As shown in Table 3, the C-APCC values corresponding to the above test execution sequences are calculated and displayed. 对照1 and S 对照2 The C-APCC value relative to S 未排序 There is a significant improvement. 本方法1 , S 本方法2 The C-APCC value in S 对照1 and S 对照2 It is further improved on the basis of , and the maximum value reaches 0.782, which is about 32.77% higher than before sorting.
[0111]
[0112] Table 3 Example of 2-dimensional combination kit T
[0113] like Figure 4 As shown, the test cost-coverage curve corresponding to the execution of the above sequence is shown, reflecting the execution efficiency of the sequence. Figure 4 It shows that using S 本方法2 When executing the test case, the test coverage increases faster than other sequences. When the test cost increases to 10,000 seconds, S 本方法2The corresponding test coverage has increased to about 80%, and its execution efficiency is higher, which is conducive to detecting potential software problems earlier. Combined with Table 4, the rationality of the C-APCC indicator can be verified.
[0114]
[0115] Table 4 C-APCC values of different test execution sequences
[0116] Figure 5 The optimal C-APCC value change curves of this method and the KA algorithm during the iteration process are shown, characterizing the optimization capabilities of several algorithms. Figure 5 It shows that when α=0.3, the KA algorithm falls into the local optimum after about 28 iterations, and the C-APCC value is maintained at 0.669. When α=0.8, the optimization ability of the KA algorithm is enhanced. Different from the KA algorithm, this method adopts an improved filtering operator. When α=0.3 and 0.8, the C-APCC values after iteration reach 0.775 and 0.782 respectively. The optimization ability of the method is significantly improved, which is about 15.73% (=0.3) and 6.23% (=0.8) higher than the KA algorithm, verifying the effectiveness of the method.
[0117] In this embodiment, the number of test cases included in the 2-dimensional combined test suite T is too large, and the calculation method of the C-APCC value of the corresponding solute particles is specifically as follows:
[0118] The example test suite is shown in Table 3. Assume that there is a combined test suite T = T1∪T2, where T1 and T2 are test sets. The parameters of T1 are P1 = {p1, p2, p3, p4}, and the parameters of T2 are P2 = {p1, p2, p3, p5, p6}. The parameter values are p1 = {11, 12}, p2 = {21, 22, 23}, p3 = {31, 32, 33}, p4 = {41, 42}, p5 = {51, 52}, and p6 = {61}.
[0119] Assume that the execution cost of T1 is 4s / item and the execution cost of T2 is 5s / item. There are test execution sequences S0 and S1. S0 = [τ1, τ2, τ3, τ4, τ5, τ6, τ7, τ8, τ9, τ 10 ,τ 11 ,τ 12 ,τ 13 ,τ 14 ,τ 15 ]; S1 = [τ9, τ 10 ,τ 13 ,τ5,τ8,τ4,τ 14 ,τ 15 ,τ3,τ6,τ1,τ2,τ7,τ 11 ,τ12 ].
[0120] For test execution sequence S0, introduce How to calculate the numerator and denominator of .
[0121] The numerator of is the sum of the rectangular areas of the test cost-coverage number. When i=1, the execution cost of the i-th use case is 4s, and the number of t-value patterns covered by the first i use cases is 6. When i=2, the execution cost of the i-th use case is 4s, and the number of t-value patterns covered by the first i use cases is 12. And so on.
[0122] The denominator of is the total cost minus the coverage number. The total execution cost of S0 is 67 seconds, and the total t-value pattern = ∏(T) = 63.
[0123] From this we can calculate Similarly,
[0124] like Figure 6 As shown in the figure, it is the corresponding cost-test coverage growth curve of executing the test set according to S0 and S1. The cost-test coverage of S1 grows faster than that of S0. For example, after executing the first three test cases [τ1, τ2, τ3] according to S0, the cost reaches 12s, the number of 2-value patterns covered is 16, and the test coverage is only 25.39%. While executing the first three test cases [τ9, τ10, τ11, τ12, τ13] according to S1, the cost reaches 12s, the number of 2-value patterns covered is 16, and the test coverage is only 25.39%. 10 ,τ 13 ], although the cost is 15s, the number of 2-value patterns covered is 27, the test coverage rate increases to 42.85%, and the test efficiency is significantly improved. Therefore, priority sorting is performed, that is, an optimization method is used to find a test execution sequence with a high C-APCC value similar to S1, so that test cases that can cover more t-value patterns and have lower costs in the sequence can be executed first.
[0125] like Figure 7 As shown, this embodiment also discloses a combination test priority sorting system based on railway signal software, using the above-mentioned combination test priority sorting method based on railway signal software, including:
[0126] The data acquisition module is used to obtain the corresponding combination test case set T = {τ1, τ2, ..., τ n}, and according to the obtained combined test case set, a number of solute particles S are randomly generated, and according to the number of solute particles, a corresponding stock solution R = {S1, S2, ..., S N}, the S N S is the Nth test execution sequence in the combined test case set; N ={τ N1 ,τ N2 ,…,τ Nn};
[0127] A calculation module is used to calculate the C-APCC value corresponding to each solute particle in the stock solution according to the formed stock solution R and the C-APCC value calculation formula of the execution sequence based on a preset test case;
[0128] The solute particle movement module is used to select the solute particle with the largest C-APCC value as the current optimal particle S according to the C-APCC value corresponding to each solute particle in the original solution. n , and according to the current optimal particle S n , and each solute particle in the original solution, based on the preset solute particle movement update strategy, each solute particle in the original solution is moved toward the particle direction with the optimal solution in the current original solution, and each solute particle in the original solution is updated;
[0129] A filtering module is used to calculate the corresponding filtering threshold fr according to each updated solute particle based on a preset solute particle filtering strategy, and filter each solute particle in the original solution into a filtrate B and a waste liquid W according to the filtering threshold;
[0130] The excretion and secretion module is used to perform a secondary update on the solute particles in the waste liquid W based on a preset solute particle movement update strategy, and after the solute particles in the waste liquid are updated, determine whether the C-APCC value corresponding to each solute particle is lower than the filtration threshold fr. If so, the corresponding solute particles are excreted and removed, and new individuals are reintroduced for replacement;
[0131] If not, determine whether the C-APCC value of the solute particle is higher than that of the solute particle S with the smallest C-APCC value in filtrate B. w If so, the corresponding solute particles are reabsorbed into the filtrate B, and S w Secreted into waste fluid W;
[0132] The loop output module is used to determine whether the current number of iterations reaches the preset number of iterations. If not, the calculation module continues to execute. Otherwise, the optimal test execution sequence S is searched. best .
[0133] The above is only an embodiment of the present invention. The common sense such as the known specific structure and characteristics in the scheme is described too much here. The ordinary technicians in the relevant field know all the common technical knowledge in the technical field of the invention before the application date or priority date, can know all the existing technologies in the field, and have the ability to apply the conventional experimental means before that date. The ordinary technicians in the relevant field can improve and implement this scheme in combination with their own abilities under the enlightenment given by this application. Some typical known structures or known methods should not become obstacles for ordinary technicians in the relevant field to implement this application. It should be pointed out that for those skilled in the art, without departing from the structure of the present invention, several deformations and improvements can be made, which should also be regarded as the protection scope of the present invention, which will not affect the effect of the implementation of the present invention and the practicality of the patent. The protection scope required by this application shall be based on the content of its claims, and the specific implementation methods and other records in the specification can be used to interpret the content of the claims.
Claims
1. A combination test priority sorting method based on railway signal software, characterized by: The following steps are involved: S1. Get the combined test case set to be sorted T = {τ1, τ2,…, τ n }, and according to the obtained combined test case set, a number of solute particles S are randomly generated, and according to the number of solute particles, a corresponding stock solution R = {S1, S2, ..., S N }, the S N S is the Nth test execution sequence in the combined test case set; N ={τ N1 ,τ N2 ,…,τ Nn }; S2. According to the formed stock solution R, the C-APCC value calculation formula of the execution sequence based on the preset test case is calculated to calculate the C-APCC value corresponding to each solute particle in the stock solution; S3. According to the C-APCC values corresponding to each solute particle in the original solution, the solute particle with the largest C-APCC value is selected as the current optimal particle S b , and according to the current optimal particle S b , and each solute particle in the original solution, based on the preset solute particle movement update strategy, each solute particle in the original solution is moved toward the particle direction with the optimal solution in the current original solution, and each solute particle in the original solution is updated; S4. According to each updated solute particle, based on the preset solute particle filtering strategy, the corresponding filtering threshold fr is calculated, and according to the filtering threshold, each solute particle in the original solution is filtered into a filtrate B and a waste liquid W; S5. Based on the preset solute particle movement update strategy, the solute particles in the waste liquid W are updated for the second time. After the solute particles in the waste liquid are updated, it is determined whether the C-APCC value corresponding to each solute particle is lower than the filtration threshold fr. If so, the corresponding solute particles are excreted and removed, and new individuals are reintroduced for replacement; If not, determine whether the C-APCC value of the solute particle is higher than that of the solute particle S with the smallest C-APCC value in filtrate B. w If so, the corresponding solute particles are reabsorbed into the filtrate B, and S w Secreted into waste fluid W; S6: Determine whether the current number of iterations reaches the preset number of iterations. If not, execute S2 to S5 in a loop. Otherwise, search for the optimal test execution sequence S. best .
2. The method for prioritizing combined tests based on railway signal software according to claim 1, characterized in that: The C-APCC value calculation formula of the preset test case execution sequence is: In the formula, C-APCC| SN Solute particle S N The corresponding C-APCC value, τ Ni is the i-th test case executed by the N-th test execution sequence in the combined test case set, i = 1, 2, 3, ..., n, τ Ni ∈T; cost(τ Ni ) is τ Ni The execution cost of Nj ) is τ Nj The set of all t-value patterns covered, Π(T) is the set of all t-value patterns corresponding to the combined test set T.
3. The method for prioritizing combined tests based on railway signal software according to claim 2, characterized in that: The preset solute particle movement update strategy includes the following steps: Create a first sequence and initialize the first sequence S′. The execution order of the test cases corresponding to the first sequence S′ is to be determined. The first sequence S′ is a 1×n matrix, where n=|T|. According to the current optimal particle S b , in the current optimal particle S b Randomly select the test cases corresponding to the columns 0∽n in the sequence S′, and fill the test cases of the selected columns into the columns corresponding to the first sequence S′; According to each solute particle in the original solution, the corresponding selected test case is marked in each solute particle, and the occupied position of the selected test case is marked in the first sequence; According to the original test execution order in each solute particle, the remaining unmarked test cases are merged into the unmarked columns in the first sequence S′ in turn to form the first sequence S′ corresponding to each solute particle, and the first sequence S′ corresponding to each solute particle is assigned as a whole to the corresponding solute particle to complete the update of each solute particle.
4. The method for prioritizing combined tests based on railway signal software according to claim 3 is characterized in that: The preset solute particle filtering strategy includes the following steps: Set the corresponding filtering percentage α; 0<α≤1; According to the solute particles after the original solution is updated, calculate the solute particle S i The corresponding C-APCC value, i = 1, 2, ..., N; According to each solute particle S i The corresponding C-APCC value is used to sort the solute particles in descending order to obtain the sorted stock solution R′={S r1 ,S r2 ,…,S rN }; Based on the preset filter particle number calculation formula, the number of particles retained after filtration l is calculated; The calculation formula for the number of filtered particles is: In the formula, represents the smallest positive integer greater than N×(1-α); According to the number of particles retained after filtering, the corresponding filtering threshold fr is calculated based on the preset filtering threshold calculation formula; The filtering threshold calculation formula is: According to the calculated filtration threshold, each solute particle after the original solution is updated is filtered, and each solute particle in the original solution is filtered into filtrate B and waste liquid W, where the filtrate Waste liquid W = R\B.
5. A combination test priority sorting system based on railway signal software, using the combination test priority sorting method based on railway signal software according to any one of claims 1 to 4 above, characterized in that: include: The data acquisition module is used to obtain the corresponding combination test case set T = {τ1, τ2, ..., τ n }, and according to the obtained combined test case set, a number of solute particles S are randomly generated, and according to the number of solute particles, a corresponding stock solution R = {S1, S2, ..., S N }, the S N S is the Nth test execution sequence in the combined test case set; N ={τ N1 ,τ N2 ,…,τ Nn }; A calculation module is used to calculate the C-APCC value corresponding to each solute particle in the stock solution according to the formed stock solution R and the C-APCC value calculation formula of the execution sequence based on a preset test case; The solute particle movement module is used to select the solute particle with the largest C-APCC value as the current optimal particle S according to the C-APCC value corresponding to each solute particle in the original solution. b , and according to the current optimal particle S b , and each solute particle in the original solution, based on the preset solute particle movement update strategy, each solute particle in the original solution is moved toward the particle direction with the optimal solution in the current original solution, and each solute particle in the original solution is updated; A filtering module is used to calculate the corresponding filtering threshold fr according to each updated solute particle based on a preset solute particle filtering strategy, and filter each solute particle in the original solution into a filtrate B and a waste liquid W according to the filtering threshold; The excretion and secretion module is used to perform a secondary update on the solute particles in the waste liquid W based on a preset solute particle movement update strategy, and after the solute particles in the waste liquid are updated, determine whether the C-APCC value corresponding to each solute particle is lower than the filtration threshold fr. If so, the corresponding solute particles are excreted and removed, and new individuals are reintroduced for replacement; If not, determine whether the C-APCC value of the solute particle is higher than that of the solute particle S with the smallest C-APCC value in filtrate B. w If so, the corresponding solute particles are reabsorbed into the filtrate B, and S w Secreted into waste fluid W; The loop output module is used to determine whether the current number of iterations reaches the preset number of iterations. If not, the calculation module continues to execute. Otherwise, the optimal test execution sequence S is searched. best .