Font Size: a A A

Research On Test Case Generation For Object Oriented Software Based On Clustering Technique

Posted on:2017-05-06Degree:MasterType:Thesis
Country:ChinaCandidate:Y C GuoFull Text:PDF
GTID:2308330509952546Subject:Software engineering
Abstract/Summary:PDF Full Text Request
With the development of object-oriented(OO) technology, object-oriented software(OOS) has been widely used. However, the traditional software testing technology cannot be directly applied to OOS testing due to the special features of OO languages such as encapsulation, inheritance and polymorphism. At present, due to random testing’s simplicity, random testing(RT) is commonly used in OOS testing. However, the effectiveness and efficiency of RT are influenced by the size and complexity of OOS under test. In order to improve the failure-detection effectiveness of RT, an alternative method of RT, named adaptive random testing(ART), has been proposed. The purpose of ART is to get appropriate test inputs which are evenly spread in the entire input domain by defining a distance metric for test inputs. ART has been applied to OOS testing by some researchers to enhance the failure detection effectiveness by defining a distance metric of objects, named adaptive random testing for object-oriented software(ARTOO).However, test cases generated by traditional OOS testing technologies may have similar properties, which may generate similar results. If the generated test cases have different properties, we can see that these test cases are distributed more evenly in the input domain. Hence, more failures can be detected by the same number of test cases.In addition, in ARTOO all executed test cases are put into the executed test case collection, and a fixed number of test cases are put into the candidate set. A tiny fraction of test cases are selected from the executed test case collection based on certain strategies to represent the whole executed test cases collection. The next test case can be singled out from the candidate set after calculating the distances among test cases in the candidate set and test cases in the representative set. The next test case is the test case that furthest from the executed test case collection. Nevertheless, strategies when selecting the representative set have great randomness, which is likely to affect the quality of the next test case.To solve the above issues, this paper proposed two approaches: generating test cases for OOS based on k-medoids algorithm and adaptive random testing method for OOS based on k-means algorithm. Some experiments are conducted to verify the proposed approaches, which show that our approaches can enhance the failure detection effectiveness. Meanwhile, a clustering-based OOS testing prototype system has been implemented in this paper and all experiments are done on the basis of this system. The main work of this paper is described below.1. Two test cases generating approaches for OOS based on k-medoids algorithm are proposed in this paper, namely MOClustering algorithm and DMClustering algorithm. In MOClustering algorithm, object method vectors are constructed to calculate the distance between test cases with the Euclidean distance formula. And in MOClustering test cases are clustered based on the k-mediods clustering algorithm. In DMClustering algorithm, during clustering, distances between test cases are calculated directly by a diatance metric based on k-mediods algorithm. A sampling strategy MSampling is also proposed in this paper, which can ensure the diversities of test cases. With the MSampling strategy, the final test cases are generated.2. Two adaptive random testing method for OOS based on k-means algorithm are proposed in this paper, named WClustering-ART and TFClustering-ART. In order to calculate distances between test cases, two distance measurement mechanism for OOS test cases is also offered in this paper, namely WTS and TFCS. In these metrics, distances between test cases can be calculated with the euclidean distance after all test cases have been transformed. WClustering-ART and TFClustering-ART combine the ART technology and the clustering algorithm by defining test cases distance metrics.3. A clustering-based OOS testing prototype system has been implemented in this paper, named OOSTS, which contains the system class diagram input module, distance measurement module, test case generation module, MOClustering algorithm module, DMClustering algorithm module, TFClustering-ART algorithm module, etc. OOSTS can be applied to testing some general object-oriented programs.
Keywords/Search Tags:Object oriented software, Adaptive random testing, Clustering algorithms, Test case generation, Distance metric
PDF Full Text Request
Related items