Article Preview
TopIntroduction
During software testing, actual output produced by software is compared with software’s expected output against various conditions (Ammann & Offutt, 2008; Kansomkeat et al., 2010). Testing of software is done in three phases: i) generation of test cases ii) execution of test cases against various conditions (Wang et al. 2015) and iii) evolution of results (Boghdady et al., 2011). .Out of these three phases, first phase is the most complex which includes generation and optimization of test cases. Therefore, now a day’s testers prefer model based testing approach which generates test cases at designing phase before the testing phase, decrementing the time and effort of designing test cases. Unified Modeling Language (UML) is used to represent the structural behaviour of software systems. Model-based testing allows testers to code and test the programs in software to be designed (Li et al. 2010; Rathee & Chhillar, 2018). Proposed approach discussed in this paper uses UML activity diagram and sequence diagram to represent structure of the system. Various approaches have been used to generate test cases of the system but testing of each and every test case is very difficult and time consuming therefore bio inspired meta heuristic algorithms have been used by testers to optimize the test cases. In this way, a tester can find out most critical test cases in advance at design phase of SDLC.
This paper has used meta heuristic Natural River System (NRS), algorithm to generate and optimize test path sequences. NRS algorithm also called as Intelligent Water Drop (IWD) and is based upon natural process of flowing of water drops in river. Each and every water drop takes the optimal path in search of the solution of given problem in search space. The proposed algorithm is applied on adjacency matrix generated from UML activity diagram of library management system for the optimization of test path sequences. We have also applied the proposed approach over a number of case studies related to UML activity diagram and UML sequence diagram and the results shows that the proposed approach is beneficial for optimization of test paths in model based testing as well as in structural testing. Cost of each test path which is generated by NRS algorithm has been calculated. The test path with greatest cost of traversing is the most error prone, critical and optimised path with maximum number of decision nodes. The proposed approach results have been compared with approach given by Agarwal et al. (2012) and genetic algorithm.
Natural River System Approach
Natural river system is similar as intelligent water drop algorithm. The origin of proposed approach came from the applications of Intelligent Water Drop algorithm given by Agarwal et al. (2012) for code coverage using test paths. NRS and Intelligent water drop algorithm given by Agarwal K. et al. (2012) and Shah-Hosseni (2009) is based upon the basic concept of flowing of water drops in rivers. In Natural River System, water drops flows in rivers with two basic properties soil and velocity, and both these values can vary in environment whenever there is a transition from one location to another location (Agarwal et al. 2012).. Whenever water drop flows in the river, it always follows a path in which every water drop carries some amount of soil with it and flows in path with some velocity. While flowing in river, the velocity of a particular water drop removes some amount of soil from the riverbeds and the removed soil is added to the soil of the water drop. When water drop moves from one riverbed to another riverbed it gains speed and therefore, higher the velocity of water drop, higher the amount of soil removed from riverbed. While flowing in river, water drop always selects the easy path which is having less amount of soil in it. In this manner, the concept of water drop helps in finding optimal paths. In this paper, NRS is used for the generation and optimization of test path sequences at early stage that is at design phase of SDLC. This helps the developer and tester to identify errors at an early stage therefore reducing in time, cost and effort of testing.
The paper is organized as follows: Section 2 describes the related work done to optimize test path sequences. Proposed methodology is described in section 3. Implementation of proposed NRS algorithm using case study of library management system is explained in section 4. Section 5 describes the results of proposed approach and its comparison with other met heuristic algorithms. Conclusion is drawn in last section of the paper.