A Test Sequence Generation Method Based on Dependencies and Slices Jin-peng MO *, Jun-yi LI and Jian-wen HUANG

Similar documents
Open Access Research on the Prediction Model of Material Cost Based on Data Mining

Research on Hybrid Network Technologies of Power Line Carrier and Wireless MAC Layer Hao ZHANG 1, Jun-yu LIU 2, Yi-ying ZHANG 3 and Kun LIANG 3,*

Dynamic Balance Design of the Rotating Arc Sensor Based on PSO Algorithm

A Method and System for Thunder Traffic Online Identification

A Compatible Public Service Platform for Multi-Electronic Certification Authority

An Adaptive Threshold LBP Algorithm for Face Recognition

Research Article. Three-dimensional modeling of simulation scene in campus navigation system

A Multi-stage IPv6 Routing Lookup Algorithm Based on Hash Table and Multibit Trie Xing-ya HE * and Yun YANG

Distribution Network Reconfiguration Based on Relevance Vector Machine

DETERMINE COHESION AND COUPLING FOR CLASS DIAGRAM THROUGH SLICING TECHNIQUES

Minimal Test Cost Feature Selection with Positive Region Constraint

A 2k-Kernelization Algorithm for Vertex Cover Based on Crown Decomposition

Intuitionistic Fuzzy Petri Nets for Knowledge Representation and Reasoning

Application Research of Wavelet Fusion Algorithm in Electrical Capacitance Tomography

Research on Design and Application of Computer Database Quality Evaluation Model

Top-k Keyword Search Over Graphs Based On Backward Search

Research on Software Scheduling Technology Based on Multi-Buffered Parallel Encryption

International Conference on Information Sciences, Machinery, Materials and Energy (ICISMME 2015)

Efficient Regression Test Model for Object Oriented Software

The Research on Coding Scheme of Binary-Tree for XML

Design and Implementation of Full Text Search Engine Based on Lucene Na-na ZHANG 1,a *, Yi-song WANG 1 and Kun ZHU 1

EFFICIENT ATTRIBUTE REDUCTION ALGORITHM

A Projection Pursuit Model Optimized by Free Search: For the Regional Power Quality Evaluation

4th Annual International Conference on Material Science and Engineering (ICMSE 2016)

Research on An Electronic Map Retrieval Algorithm Based on Big Data

Research on Full-text Retrieval based on Lucene in Enterprise Content Management System Lixin Xu 1, a, XiaoLin Fu 2, b, Chunhua Zhang 1, c

A method of three-dimensional subdivision of arbitrary polyhedron by. using pyramids

A Finite State Mobile Agent Computation Model

Design on a method for interactive editing fault polygon

An Improved Frequent Pattern-growth Algorithm Based on Decomposition of the Transaction Database

The Parameters Optimization of Fusion Winglet Based on Orthogonal Experiment Yue LUO 1, *, Qi WANG 1, Qi DU 1 and Hou-An DING 1

Open Access Apriori Algorithm Research Based on Map-Reduce in Cloud Computing Environments

2008 International Conference on Apperceiving Computing and Intelligence Analysis (ICACIA 2008) Chengdu, China December 2008

Utilizing Restricted Direction Strategy and Binary Heap Technology to Optimize Dijkstra Algorithm in WebGIS

Research on Heterogeneous Communication Network for Power Distribution Automation

Organization and Retrieval Method of Multimodal Point of Interest Data Based on Geo-ontology

The principle of a fulltext searching instrument and its application research Wen Ju Gao 1, a, Yue Ou Ren 2, b and Qiu Yan Li 3,c

Citation for the original published paper (version of record):

Guangxi University, Nanning , China *Corresponding author

CHAOTIC ANT SYSTEM OPTIMIZATION FOR PATH PLANNING OF THE MOBILE ROBOTS

A Data Classification Algorithm of Internet of Things Based on Neural Network

Test Cases Generation from UML Activity Diagrams

Multi-path based Algorithms for Data Transfer in the Grid Environment

Research Article QOS Based Web Service Ranking Using Fuzzy C-means Clusters

Modeling and Analysis of the Support System of Space-based Anti-missile Information Based on UML

Low Overhead Geometric On-demand Routing Protocol for Mobile Ad Hoc Networks

The Design and Application of GIS Mathematical Model Database System with Meta-algorithm Li-Zhijiang

A Genetic Algorithm for Multiprocessor Task Scheduling

Qingdao, , China. China. Keywords: Deep sea Ultrahigh pressure, Water sound acquisition, LabVIEW, NI PXle hardware.

Research on the Knowledge Representation Method of Instance Based on Functional Surface

AN EFFICIENT DEADLOCK DETECTION AND RESOLUTION ALGORITHM FOR GENERALIZED DEADLOCKS. Wei Lu, Chengkai Yu, Weiwei Xing, Xiaoping Che and Yong Yang

Study on GA-based matching method of railway vehicle wheels

2002 International Conference on Machine Learning and Cybernetics. Proceedings Volume 1 of 4

A Power Attack Method Based on Clustering Ruo-nan ZHANG, Qi-ming ZHANG and Ji-hua CHEN

Research and implementation of search engine based on Lucene Wan Pu, Wang Lisha

Research on Improvement of Structure Optimization of Cross-type BOM and Related Traversal Algorithm

Journal of Chemical and Pharmaceutical Research, 2014, 6(5): Research Article

The application of OLAP and Data mining technology in the analysis of. book lending

Network Scheduling Model of Cloud Computing

A METRIC BASED EVALUATION OF TEST CASE PRIORITATION TECHNIQUES- HILL CLIMBING, REACTIVE GRASP AND TABUSEARCH

International Journal of Academic Research in Computer Engineering. Volume 1, Number 2, Pages 25-32, November

Research on Improvement of Structure Optimization of Cross-type BOM and Related Traversal Algorithm

Design of Coal Mine Power Supply Monitoring System

The Research of Collision Detection Algorithm Based on Separating axis Theorem

Application of Face Recognition Technology in the Exam Identity Authentication System Li-jun YU 1,a,* and Ke-feng LI 2,b

Design of student information system based on association algorithm and data mining technology. CaiYan, ChenHua

Research on Incomplete Transaction Footprints in Networked Software

Using The Heuristic Genetic Algorithm in Multi-runway Aircraft Landing Scheduling

An Information-Theoretic Approach to the Prepruning of Classification Rules

Temperature Calculation of Pellet Rotary Kiln Based on Texture

An Optimization Algorithm of Selecting Initial Clustering Center in K means

Simulating a Finite State Mobile Agent System

Fault Analysis of Distribution Network with Flexible Ring Network Control Device

Improvement and Simulation of Data Mining Algorithm Based on Association Rules

Experimentation of a 1-pixel bit reconfigurable ternary optical processor

Static Deadlock Detection in MPI Synchronization Communication

Feature-Guided K-Means Algorithm for Optimal Image Vector Quantizer Design

A TEMPORARILY-SPATIALLY CONSTRAINED MODEL BASED ON TRBAC IN WORKFLOW SYSTEM

Empirical Studies of Test Case Prioritization in a JUnit Testing Environment

Remote monitoring system based on C/S and B/S mixed mode Kaibing Song1, a, Yinsong Wang2,band Dandan Shang3,c

Man-hour Estimation Model based on Standard Operation Unit for Flexible Manufacturing System

Research of Automatic Scoring of Student Programs Based on Static Analysis

A New Encoding Scheme of Supporting Data Update Efficiently

A Low-Overhead Hybrid Routing Algorithm for ZigBee Networks. Zhi Ren, Lihua Tian, Jianling Cao, Jibi Li, Zilong Zhang

Efficient Parallel Multi-Copy Simulation of the Hybrid Atomistic-Continuum Simulation Based on Geometric Coupling

Modeling Crisis Management System With the Restricted Use Case Modeling Approach

Location of air-borne SAR imagery without GCPs and error analysis

Improving Suffix Tree Clustering Algorithm for Web Documents

An Embedded Software Testing Requirements Modeling Tool Describing Static and Dynamic Characteristics

An approach of security testing for third-party component based on state mutation

The Analysis of the Loss Rate of Information Packet of Double Queue Single Server in Bi-directional Cable TV Network

Study on Building and Applying Technology of Multi-level Data Warehouse Lihua Song, Ying Zhan, Yebai Li

Quality Assessment of Power Dispatching Data Based on Improved Cloud Model

Warship Power System Survivability Evaluation Based on Complex Network Theory Huiying He1,a, Hongjiang Li1, Shaochang Chen1 and Hao Xiong1,2,b

BRANCH COVERAGE BASED TEST CASE PRIORITIZATION

Tag Based Image Search by Social Re-ranking

manufacturing process.

FSRM Feedback Algorithm based on Learning Theory

Review of Regression Test Case Selection Techniques

A Failure Testing System with March C- Algorithm for Single Event Upset

Transcription:

2017 2nd International Conference on Advances in Management Engineering and Information Technology (AMEIT 2017) ISBN: 978-1-60595-457-8 A Test Sequence Generation Method Based on Dependencies and Slices Jin-peng MO *, Jun-yi LI and Jian-wen HUANG College of Computer Science and Electronic Engineering, Hunan University, Changsha 410082, China *Corresponding author Keywords: Test sequence, Dependence, Test case slice, Resetting of database. Abstract. Based on the incorrect test results caused by dependencies in the execution of test cases, this paper proposes a method to optimize test sequence. Extract the dependencies to construct the dependence loop set, separate with iteration method in the maximum loop-cutting way to obtain a test case slice without dependence loops, and repeat the above step to get all the test case slices. For the test case slice set, get the node dependence value of each test case and sort the values in a descending order to generate the test sequence. The algorithm analysis and experimental results show that compared with the optimization techniques considering dependencies, this method reduces the number of resetting of database. Introduction The test sequence generation is an optimization technique includes designing the test cases in accordance with the importance and correlation of the function and the precondition of data and executing the test cases in a certain order. At present, the test sequence optimization technology mainly concentrates on three aspects, i.e. selecting the test cases, minimizing the test cases and sorting the prioritization of the test cases. Rothermel et al. [1] proposed a test sequence optimization technique based on covering, and sorted the test cases according to their ability to detect faults. Briand [2] first analyzed the inter-class dependencies and circulation problems, devised the combinatorial test sequence generation method based on the coupling measurement and genetic algorithms. Do et al. [3] applied the test suite to the JUnit test framework under the Java language, significantly improved the fault-detection rate of JUnit test suite. Srikanth et al. [4][5] pointed out that the test suite prioritization depends on the code coverage information or historical data, and proposed test sequence generation by the relationship of fault-detection in order to make the examination process of the test case driven by algorithm. Mei et al. [6] sorted the test cases by analyzing the static call graph and the dynamic results and calculating the ratio of the code enforcement of each test case. Based on the protocol conformance problems caused by the dynamic state transition of the extended finite state machine model (EFSM), You et al. [7] proposed the test sequence generation algorithm in first search algorithm by edge weight. Zhao et al. [8] constructed an object-oriented complex network in the idea of inter-class integration, representing the classes with nodes and the inter-class relationship with edges, proposed a node measurement method by analyzing the influence and complexity of the nodes. As for how to sort the test cases, Chen and Gao [9] proposed a static test case sequence generation method based on the cyclomatic complexity. Zhang et al. [10] proposed a class integration testing order determination method based on particle swarm optimization (PSO), the algorithm reduces the overall complexity of structuring test piles in virtue of local optimality of PSO. The previous studies of test sequence generation method mainly focused on minimizing the test cases or sorting the test cases by giving weight to the importance. Nevertheless, there few researches on the mutual influence between the test cases, i.e. the test case dependencies. In the software testing process, the test cases mostly can interact with the database and modify the status of database, resulting in the incorrect test results[11]. In the test process of database application system, Liang et al. [12] fully considered the influence of the status of database on the test cases, analyzed the dependencies with UML class diagrams, 261

separated the test case set in slicing, and then constructed the test sequence generation algorithm. Based on the research of Liang et al. [12], Chen [13] improved the algorithm by, under the condition of the least number of slices, ensuring that no loops exist in the directional dependence diagram constructed by the test cases in the slice, and by using the reverse topological sorting for each slice to generate the test sequence. While these method preliminary solves the test conflict caused by dependencies, the loop-breaking in the process of accessing the slices results in low efficiency. Considering the above, this paper puts forward a test sequence generation method based on the dependencies and slices. This new method generates test sequence by extracting the dependencies of the test cases and by eliminating the dependencies by means of slicing. Related Theory Node Dependence Value During the execution of the test cases, some executed test cases can affect the state of database, destroying the preconditions of other test cases, and resulting in incorrect test results. Based on the dependencies between the test cases, this paper adopts the node dependence value to quantify the executive priority of the test cases. Definition 1 Dependence (D): Let and be any two elements in the test case set = {,,, }[12], when the execution of has influence on, there is a dependence between and, expressed as D=<T,T >. (1) The dependence in the above expression is expressed as: depends on, is called initial node and is called terminal node. All the dependencies in test case set constitute a dependence set (DS), expressed as DS={D i=1,2,,m}. (2) where, represents the number of dependencies. Assuming that T_DS is a subset of DS and the initial node and terminal node of all dependencies in T_DS belong to a test case set, then T_DS is called the dependence set corresponding to this test case set. For dependence, this paper specifies that <, > and <, > do not exist at the same time, that is, there is only one dependence or no dependence between two test cases. Therefore, the test case set containing elements has dependencies at most. Definition 2 Node Dependence Value (NDV): Assuming that T_DS is the dependence set corresponding to the test case set, then the node dependence value of ( ) is the accumulation of the initial node s NDV of all dependencies plus 1 (the terminal node of all dependencies being ), expressed as NDV(T )= [NDV(T )+1]. (3) where, is the number of dependencies in which is the terminal node in T_DS. The NDV of the test cases which never appear in the terminal node in T_DS, is 0. NDV can be used to characterize the priority of test cases. The higher the NDV, the higher the executive priority of the node. That is, the test case set arranged in reverse order according to NDV satisfies the executive priority of the test cases. It can be demonstrated that this executive sequence eliminates the impact of the dependencies between test cases. Given ( ) ( ) for and, then executing before can eliminate the dependence, which is proved as follows: If executing before can not eliminate the dependence, depends directly or indirectly on. The NDV of will add a positive integer on the basis of the NDV of, leading to ( )> ( ), and that is contradictory to the given condition. 262

Test Case Slice The program slice is a program decomposition technique based on the relevant characteristics of the program, dividing the program into a number of decomposed slices which will be analyzed to understand the entire program. This section introduces the test case based on the slice theory. Definition 3 Dependence Loop (DL): Assuming that DS is the dependence set corresponding to ={,,, },, and all test cases of makes up {,,, }(,,, [1,2,, ] and,,, are different). If satisfies the two conditions: (1) each pair of dependencies is visited only once; (2) the terminal node of each dependence is the only initial node for another dependence. Then {,,, } forms a dependence loop (DL), recorded as DL=<T T T >. (4) All the dependence loops of one test case set is called dependence loop set (DLS), recorded as DLS={L,L,,L }. (5) where, is the number of dependence loops for the test case set. The dependence loop can be constructed by referring to the generation method of the directional loops in the graph theory, the existing research ideas and solutions. Definition 4 Test Case Slice (TCS): Test case slice is a subset defined in ={,,, }, and there is no dependence loops in the subset. TCS can be written as TCS={T i=1,2,,k}. (6) where, represents the number of elements in the slice, and. For a test case set, it can eventually be broken into test case slices which are called test case slice set (TCSS), recorded as TCSS={TCS i=1,2,,m}. (7) where, represents the number of test case slices, and. For any and ( and, [1,2,, ]), = ; For all TCS, =. If there are dependence loops in a test case set, then all the elements in the loops will appear on the left and right sides of the NDV s equation group, and NDV is unable to be calculated. So NDV applies to the test case set having no dependence loops, and the test case slice is a special set having no loops. Test Sequence Generation Dependence-Slice Algorithm Based on the idea of slicing, the test case set can be divided into several test case slices, and taking slices as the test unit, the test cases within the slice are optimized to reduce or even eliminate the impact of the test cases. This paper proposes a method of test sequence generation based on dependence and slices (TSGDS). The algorithm flow is shown in Figure 1. 263

Start Initialize TS and DS Construct DLS Get dependence set corresponding to TS Assign largest set to TS and clear largest set Is DLS null? N Find the maximumfrequency element from DLS, put it into the largest set Y Cut TS with largest set to obtain new slice, put the slice into TCSS Is there loops in largest set? N Y Add largest set to TCSS, clear largest set Delete the loops containing largest element from DLS For each slice, get NDV of test cases and sort reversely by it End Figure 1. Algorithm flow of TSGDS. From the algorithm flow of TSGDS, when Putting TS and DS as inputs, we can get TCSS that sorted by NDV and test sequence. The algorithm mainly includes three phases: the initialization, the loops cutting to obtain slices and the sorting in the slices to generate sequence. The specific process is as follows: Phase1. Initialization Define and assign the variables of the algorithm. Put test case set and dependence set as inputs, other variables is as follows: The intermediate test case set _ =, the intermediate dependence set corresponding to _ _ =, the largest element set =, the number of slices =1, the dependence loop set =, the maximum-frequency element =, and the test case slice set =. Phase2. Loops cutting to obtain slices As a recursive process, the loops cutting to obtain slices is the core of the algorithm and achieves the maximum cut loops. The process is as follows: Step1. Construct according to _ and _ with the loops construction algorithm. Step2. If is null, break this step. If is not null, traverse to get the frequency of each test case, find and puts it into, then delete the loops containing from. If there are multiple largest elements, get the element that do not constitute loops with as. Step3. If is null, = _, put into, and break phase2. Else, make plus one, is equal to _ minus ; Since there is no loops in, put into. Step4. If there are no loops in, =, put into, clear. If not, _ =, =, obtain _ corresponding to _, and then execute Step 1, Step 2 and Step 3 again. Phase3. Sorting in the slices to generate sequence Construct dependence sets,,, corresponding to,,,, obtain the NDV of each test case of each slice, and then arrange the test cases of each slice in the reverse order according to the NDV. We can see from TSGDS that each element of satisfies the definition of TCS, and slices is ordered reversely by NDV, so the resetting of database is only performed between the slices and not in slices. Therefore, the number of slices n and the times of resetting of database have the following relationship: = 1. Case Study Assuming that ={,,,, }, ={<, >,<, >,<, >,<, >,< 264

, >,<, >,<, >,<, >,<, >,<, >}. In the initialized state, _ =, _ =, =, =1, = and =, then the process of generating test sequence is as follows: 1) The first recursion to separate loops to get slices (1) Constructing, it is {< >,< >,< >,< >,< >,< >,< >,< >}. (2) The first time to determine that is not empty, traverse to obtain the frequency of each test case, then =. Put into and delete the loops including, then ={ }, ={< >}. (3) The second time to determine that is not empty, traverse to obtain the frequency of each test case., and are the elements of largest frequency in parallel and have no loops with { }. This case makes =, then ={, }, =. (4) The third time to determine that dls is not empty, break loop-cutting, then =2, = _ ={,, }. Put into, so ={ }. 2) The second recursion Since there is no loop in {, }, the process of recursion is ended, = ={, }, put into into, so ={, }. 3) Sorting in the slice to generate sequence (1) Sort reversely the test cases in the slices according to the NDV. For ={, }, ={<, >}, then: ( )= ( )+1 ( )=0 ( )=1 ={, } For ={T,T,T }, ={<, >,<, >,<, >}, then: ( )= ( )+1 ( )=0 ( )= ( )+1 ( )=1 ={,, } ( )= ( )+1 ( )=3 (2) Generating the test sequence: The test sequence is,,,, or,,,,. Algorithm Analysis and Experiments Algorithm Complexity According to the algorithm flow, the algorithm cost is mainly reflected in the process of slicing and sorting. The Fast Sorting is used for the sorting of slices and the algorithm complexity is ( ). We can analyze the process of slicing through recursion. Assuming that the length of the test case set and dependence set are and respectively, the number of slices is, then the complexity of the algorithm is as follows: 1) In the best case. =1, i.e. no loops exist in the test case set, and the time complexity is determined by the ordering in the slices. 2) In the worst case, the time complexity is determined by slicing, which is a recursive process, we can get time complexity according to recursive equation, then time complexity is ( ). Table 1 compares the time complexity with the results in the 13th literature. Table 1 exhibits that the time complexity of TSGDS is basically at the same grade as that of Literature 13, especially for the test case set with dependence loops. Experimental Comparisons Table 1. Time complexity comparison. Programs Best case Worst case Literature 13 ( + ) ( ) TSGDS ( ) ( ) During the execution of the test cases, the time of the resetting of database is much greater than that of the execution of test cases, so the efficiency of the test sequence is characterized by the number 265

of resetting of database. The Experiments selected the following two groups of data: 1) Typical test data Typical test data [12,13] includes Example 1, Example 2 and Example 3, as shown below: Example 1: ={,,,, }, ={<, >,<, >,<, >,<, >,<, >,<, >,<, >,<, >,<, >,<, >}. Example 2: ={,,,,,,,,, }, ={<, >,<, >,<, >,<, >,<, >,<, >,<, >,<, >,<, >,<, >,<, >,<, >,<, >}. Example 3: ={,,,,,,,,,,, }, ={<, >,<, >,<, >,<, >,<, >,<, >,<, >,<, >,<, >,<, >,<, >,<, >,<, >,<, >,<, >,<, >,<, >,<, >,<, >,<, >,<, >}. 2) Test data of Halo Convenience Store Management System The system includes four functional modules: warehouse management, query management, store settings, bulletin management. The number of test cases in the system is more than 300, including 113 cases for warehouse management, 48 cases for query management, 62 cases for store settings, 35 cases for bulletin management and 57 cases for report analysis. For the experimental data, we chose 4 sequences for comparisons. The experimental results are shown in Figure 2. It can be seen from Figure 2 that the number of resetting of database for TSGDS is smaller than order sequence, reverse sequence, random sequence and the sequence generated from Literature 13. Figure 2. The number of resetting of database for typical case set and Halo system. Conclusion On the basis of the existing optimization technology of the test sequence, this paper analyzes the influence of dependencies on the execution of test cases, proposes a method to generate test sequence based on dependencies and slices. TSGDS includes three phases, eliminates the test effect caused by dependencies, improves the efficiency of the test cases. The deficiencies of this method are that recursive algorithm used in the process of separating loops increases the complexity, and the inter-loop-nest are not fully considered in constructing loops. Further research is needed In the future. Acknowledgments This project is sponsored by the Scientific Research Foundation for the Overseas Chinese Scholars. References [1] Rothermel, Gregg, et al Prioritizing test cases for regression testing. IEEE Transactions on software engineering 27.10 (2001): 929-948. 266

[2] Briand, Lionel C., Jie Feng, and Yvan Labiche Experimenting with genetic algorithms to devise optimal integration test orders. Software engineering with computational intelligence. Springer US, 2003. 204-234. [3] Do, Hyunsook, Gregg Rothermel, and Alex Kinneer Empirical studies of test case prioritization in a JUnit testing environment. Software Reliability Engineering, 2004. ISSRE 2004. 15th International Symposium on. IEEE, 2004. [4] Srikanth, Hema, Laurie Williams, and Jason Osborne System test case prioritization of new and regression test cases. Empirical Software Engineering, 2005. 2005 International Symposium on. IEEE, 2005. [5] Yu, Yuen Tak, and Man Fai Lau Fault-based test suite prioritization for specification-based testing. Information and Software Technology 54.2 (2012): 179-202. [6] Mei, Hong, et al A static approach to prioritizing junit test cases. IEEE Transactions on Software Engineering 38.6 (2012): 1258-1275. [7] You, Juan, Jun-Quan Li, and Song Xia Algorithm for generating test sequences based on branch and bound in EFSM model. Application Research of Computers 30.5 (2013): 016. [8] Zhao Yu Li, Wang Ying, Yu Hai and Zhu ZiLian. An inter-class integration test order generation method based on complex networks. Journal of Northeastern University (Natural Science) 36.12 (2015): 1696-1700. [9] Chen Meng Yun, Gao Jian Hua Static test cases sorting method based on cyclomatic complexity. Computer Application and Software 33.1(2016): 1-3. [10] Zhang Yuan Mei, Jiang Shu Juan, Chen Ruo Yu, Wang Xing Ya and Zhang Miao Class integration test order determination method based on particle swarm optimization algorithm. Chinese journal of computers 39.55(2016): 7-10. [11] Anand, Saswat, et al. An orchestrated survey of methodologies for automated software test case generation. Journal of Systems and Software 86.8 (2013): 1978-2001. [12] Liang Yan. The research on batabase application system parallel testing technology based on data dependencies. ChangSha: Hunan University, 2009: 32-38. [13] Chen Tao. The research on test case sequence optimization of database application System. ChangSha: Hunan University, 2016, 38-4. 267