Test Case PrioritizationUsing Fuzzy Logic for GUI based Software

Testing of GUI (Graphical User Interface) applications has many challenges due to its event driven nature and infinite input domain. It is very difficult for any programmer to test for each and every possible input. When test cases are generated using automated testing tool it uses each and every possible combination to generate test cases hence generates numerous number of test case for any GUI based application. Within a defined time frame it is not possible to test every test case, that is why test cases prioritization is required. Test-case prioritization has been widely proposed and used in recent years as it can improve the rate of fault detection during the testing phase. Very few methods are defined for GUI Test case prioritization that usually consider single criteria for assigning priority for the test case which is not sufficient for the consideration of that test case as more fault revealing. In this paper we have proposed a method for assigning weight value on the basis of multiple factors as one of the criteria for test case prioritization for GUI based software. These factors are: The type of event, Event Interaction, and Parameter-value interaction coverage-based criteria. In the proposed approach priority is assigned based upon these factors using fuzzy logic model. Experimental results indicate that the proposed model is suitable for prioritizing the test cases of GUI based software.


INTRODUCTION
Testing is widely recognized as a key quality assurance (QA) activity in the software development process.Research in testing has received considerable attention in the last two decades [2,8,20,14].Testing of graphical user interfaces (GUIs) was a neglected research area till last decade [4].Graphical User Interface (GUI) constitutes as much as 45-60% of the total software code in any software, so testing of GUI is a very important concern [3,16].Most of the test case generation techniques require human involvement and are resource intensive.Many automated approaches were proposed for test case generation but in practice capture replay tools are used [17].So generation of test cases is a costly effort.Rapid prototyping model is followed for GUI development which involves continuous modifications in software versions [1].Due to event driven nature of GUI it takes sequence of events as input and after change of state generates new sequence of input as output [6,12,19].For different set of state and combination of inputs GUI generate different output [5,20].It would be difficult to manage all the combinations for testing as number of combination grows exponentially with the number of events.Running all GUI test cases and then fixing all bugs may be time consuming and delaying the project completion.This would require that the test developed for one version should be reusable across various versions [1,4].It is important to prioritize the test cases that uncover the most faults as fast as possible in the testing process.So prioritization of test suite is a challenging area [7,9,13,18].In this paper multiple factors are considered for the assignment of weight value for test suite.This paper is organized as follows: Section II describes the research background for the proposed work.Section III describes the factors affecting the fault detection capability of test suite.Section IV introduces the concept of the proposed fuzzy model.Section V discusses about the experimental design.The results are displayed in section VI and conclusion and future work is presented in section VII.

II. RESEARCH BACKGROUND
The significant work is done by Renee C. Bryce and Atif M. Memon for test suite prioritization by interaction coverage.Test suite for GUI based program is prioritized by t-way interaction coverage and rate of fault detection is compared with the fault detection by other prioritization criteria [9].Experimental results shows that test suits with the highest event interaction coverage benefit the most and test suits that has less interaction coverage does not benefit in using this prioritization technique.
In this approach only event interaction coverage criterion is taken as a measure for prioritizing test cases, there could possibly be significant effect of type of event in a test case, which will affect the rate of fault detection.
Atif M. Memon & Renee C Bryce provided a single abstract model for GUI and web application testing.In this approach test cases are prioritized by set of count based criteria, set of usage-based frequency and set of interaction based criteria [10].The results show that test case prioritization by 2-way (interaction based criteria) and PV-LtoS (Parameter count based criteria) provided best improvement in the rate of fault detection for GUI based software.The main drawback of this technique is that the combination of different prioritization criteria is used and it is said that this is more effective than a single criterion.www.ijacsa.thesai.orgHowever in order to cover web applications and GUI applications various factors need to be added and they add complexity to the process which can be avoided if specific criteria for web based application and GUI based application would be used.
In the work done by Chin-Yu Huang et al. on GUI Test case prioritization, weighted event flow graph was used for solving the non-weighted GUI test cases and ranked GUI test cases based on weight scores.In order to assign weights, events are classified based on their importance in the GUI application [11,15].In this technique weight summation of termination event and unrestricted focus event is equal to that of restricted focus event which requires further research in this area.In this approach the effect on fault detection based on event interaction with other event need to be explored further.Weight value of each interaction would also have impact on fault detection ability of test cases which was not considered in this approach.

III. FACTORS FOR TEST CASE PRIORITIZATION
Weight value will be assigned by considering following factors: In following section we will elaborate different criteria considered for assigning weight values:  Type of event Type of event, a test suite is covering has significant impact on the fault revealing capability of test case.
According to the literature survey events are classified as following five types, restricted-focus event, unrestricted-focus event, termination event, menu-open event, and systeminteraction event.Event weight has been assigned on the basis of importance of specific type of events [15].This categorization of events is given in table 1.

 Event Interaction
In event driven software event interaction makes the program to follow a different execution path that may reveal faults in the system.In our proposed method Priority is assigned to those test cases which have large number of parameter value interaction [9].

 Count-based criteria
Since the GUI is the collection of events, number of actions performed with events, set of parameters and number of windows.It is very important that test suit that provides maximum count coverage should be given higher importance then the test suit that provide low coverage.So another factor that will be considered is the count of number of windows, actions or parameter values that a test case may cover.

IV. PROPOSED FUZZY MODEL
Fuzzy logic is a convenient way to map an input space to output space.In this paper we have proposed a fuzzy model with three inputs, namely Type of event, Event Interaction, Count based criteria.Figure1 shows the fuzzy model.The proposed model consists of three inputs and provides a crisp value of priority using Rule Base.
Fuzzy Inference System (FIS) is the process of formulating the mapping from a given input to an output using fuzzy logic.This will use Mamdani's fuzzy inference method which is most commonly seen fuzzy methodology as shown in Figure 2.After the fuzzification process, there is a fuzzy set for each output variable that needs defuzzification.The input for the defuzzification process is a fuzzy set (the aggregate output fuzzy set) and the output is singleton number.Further centroid method will be used for defuzzification.Centroid method will return the centre of area under the curve.

Event type Weight Value
Restricted-focus event 5 System-interaction event 4 Termination event 3 Menu-open event 2 Unrestricted-focus event 1 www.ijacsa.thesai.orgSimilarly the input variable count has been divided into five states i.e. very low, low, medium, high and very high as shown in figure 5.
The output variable priority is classified as very low, low, medium, high and very high.Similarly priority has five membership functions as shown in figure 6:

A. Rule Base and Evaluation Process
When input data is fuzzified, processing is carried out in fuzzy domain.The model integrates the effects of multiple factors type of event, Event Interaction and Count based criteria into a single measurable parameter that will define the priority of test case, based on the following knowledge/rule base.The rule base can further be advanced by creating more ranges (fuzzy sets) for the input variables.All inputs and outputs are fuzzified as shown in figure 3 to 6.All possible combinations of inputs were considered that will create 5 3 i.e. 125 sets.The priority for all 125 combinations is classified as very low, low, medium, high & very high by expert judgment.This indicates to formulation of 125 rules for the fuzzy model and some of the rules are presented below: 1.If value assigned for Type of event is low, Event Interaction is low and Count based is low then priority will be low.www.ijacsa.thesai.org 2. If value assigned for Type of event is medium, Event Interaction is medium and Count based is medium then priority will be medium.3.If value assigned for Type of event is low, Event Interaction is high and Count based is high then priority will be medium. . . . If value assigned for Type of event high, Event Interaction is medium and Count based is high then priority will be high. …..

If value assigned for Type of event very low, Event
Interaction is high and Count based is very low then priority will be low.All 125 rules are inserted and rule base is created.A rule is fired based on the particular set of inputs.In this model Mamdani style inference has been used.
The output of test case priority has been observed using rule viewer for particular set of inputs using MATLAB fuzzy Tool Box as shown in figure 7.These inputs are provided for the fuzzification module and after fuzzification of given value we find the type of event =0.5 belongs to the fuzzy set low with membership grade 0.9 and belongs to fuzzy set medium with membership grade 0.9 and with high it has membership grade 0.72.
For event Interaction =0.3 belongs to the fuzzy set low with membership grade 0.9 and belongs to fuzzy set medium with membership grade 0.72 and with high it has membership grade 0.72.Count based criteria=0.5 belongs to the fuzzy set low with membership grade 0.9 and belongs to fuzzy set medium with membership grade 0.9 and with high it has membership grade 0.72.With these input values we find that rules given in table 2 will be considered: First rule assigns the priority low to an extent of 0.9 and second rule gives priority medium to an extent of 0.72 and the third rule gives priority high to an extent 0.72 this is shown in the figure 8.

A. Defuzzification
After getting the fuzzified output as specified in previous section, we defuzzify them to get the crisp value of the output variable priority [21].Transformation of the output from fuzzy domain to crisp domain is called defuzzification.In this model we defuzzify using centre of gravity (COG) method of the aggregate output 1, 2 and 20.X axis centroid points for all three variables are 2.9, 4.9 & 6.9 the final value for GOG is 4.84.
The effect of these rules is also observed by simulating the model using fuzzy logic tool box of MATLAB.The priority for the given input values comes out to be 0.493 which is the same as calculated from COG method.

VII. CONCLUSION
The problems of test-case prioritization have been explored in this paper to improve the rate of fault detection effectiveness for GUI based software.We have proposed a fuzzy based technique to assign priority of test case.Priority of test case will be assigned as very low, low, medium, high and very high.In this technique three factors namely Type of event, Event Interaction, Count based criteria are considered to assign weight values for test cases.Impact of these factors are categorize in five categories as very low, low, medium, high and very high.Experimental results shows that the proposed fuzzy model is proved to be an effective approach for test case prioritization for GUI based software.

Figure 3 :
Figure 3: Fuzzification of Input Variable Event Type

Figure 8 :
Figure 8: Output computation for Test Case Priority

TABLE 1 :
EVENT WEIGHT ASSIGNMENTS

TABLE 2 :
TEST SUITE PRIORITY CALCULATION FOR A GIVEN INPUT SET