A Code Profiling Model for StART

: Test case selection in software testing is one of the process that support to quality in finding bug. Decreasing number of bug may increase quality of software. Many strategies have been proposed by researcher for software testing. Specially to avoid exhausted testing which all the testers take into account which may increase time and performance. One of the strategy is StART. The code profiling is a part of StART, which is a selection test cases strategy using code profiling. The strategy is based on the adaptive random testing and support with code profiling in the strategy. The aim of this paper is to show the code profiling model. The selection of domain area to test is based on the highest probability in the code profiling result. The probability of in the code profiling is calculated and the highest value to be chosen as the first area to test. The value to be chosen as a domain area for the first to be tested in SUT. This model used AspectJ as case study to show the model can be implemented for a new programming paradigm. Tetris selected as case study to show the model flow. From the case study of Tetris, the model shows the area to be tested first is in the package Gui, for aspect menu and advice after the probability value shows the highest result. For future study, this model need to test their efficiency of their strategy.


Introduction
There are many strategies in selection test case in testing phase such as random and systematic approach. The test cases are the essence of software testing which need clarification of information should be tested. Random approach [1], [2] selects the test cases without consider any information behind the software under test (SUT). Random testing is very simple and easy strategy to apply due to unbiased [3] in a way of selection normally happened from human mistake. This reason random testing is very popular testing strategy to be used in selection the test cases when to test software. Meanwhile, systematic approach [4], [5] will use certain strategy to get the best test cases to find the error or bug [6]. The information behind the software in systematic approach is considered to select which part that need to test to get potential error. Nevertheless, both approaches have similar objectives which are to avoid more effort to test all test cases known are known as exhausted testing. Test cases is a set of conditions or a specification of the input, condition or variables under which a tester will determine whether a system under test satisfies requirements or works correctly. Test cases underlie testing that is methodical rather than haphazard. A battery of test cases can be built to produce the desired coverage of the software being tested. Formally defined test cases allow the same tests to be run repeatedly against successive versions of the software, allowing for effective and consistent. In testing, to test all test cases is impossible. The problem is to test all combination of input is time consuming [7]. Such as, if test Internet Explore shows in [7] for Advance Option which have 53 condition produce 108,086,391,056,891,904 possible combinations of conditions.
Selection test cases using model [8] can be used random or systematic approach and even combination of both random and systematic. Actually, no standard for test case selection. Thus, selection is depending on strategy that tester try to apply during testing. Offering many strategies may support the testing process more option to be chosen and give more testing to find bug.
In this study, code profiling had been chosen as strategy that tester need to be considered. This proposed model uses AspectJ as a code to be tested. The code involved consists of core concern and crosscutting concern. The crosscutting concern is the area of study. Basically, source code can be many package, module and line of code such as [9] measuring the time spent on each line of code, code coverage or memory usage during its execution, [10] using probability calculation and focus on line of code, and package used. [11] gathered profiling information is structured in line with the application structure in terms of packages, classes, and methods. In this paper, the elementary of code is the advice. The advice consists of after, before and around.
Detail explanation for the model in code profile with the probability calculation organized according to the sections. Section 2 discuss about related work, section 3 research background, section 4 proposed model and section 5 is about discussion and section 6 conclusion and future work.

Related Work
In this study, code profile used to help in selection test case in software testing especially to avoid biasness [12], [10], [11]. In [12] , the author used the profiling in forecasting model selection and the accuracy. Performance has been assessed in terms of a model's ability to generate both unbiased and accurate forecasts, and accuracy has been examined using both error magnitude and directional change error criteria. In [10], the author generate code profile using statistical testing to increase the reliability of test case selection. [11] code profile generated to easily build profilers and visualize profiling information. It is also can be used to help in many areas such as to show usage model [13]. It provides the most cost-effective use of the testing budget and the only direct statistical method for making inferences concerning reliability of software in operational use.

Research Background
Test case selection in aspect-oriented domain still need more strategy especially in random approach. [14] researcher said the exclusive random testing may to cater this testing strategy. As a software tester to test all (known as exhausted testing) is impossible due to time limitation and expensive. That is the reason test cases to be selected wisely to be test to minimize the cost.

StART Strategy
StART is a strategy to select the test cases [10]. The strategy is implemented in aspect-oriented program domain area. So, the process model based on AspectJ code. The process code profiling involved with AspectJ code and focus on advice: after; before and around [10]. In this paper, model proposed only for code profiling in the strategy. StART also consider about the distance between test cases [15]. The whole strategy discusses in different research paper. been discussed in [10]. If the code is object-oriented the classes and the method will take as code profile with using operational profile. Operational profile is to determine the execution frequencies of various thread and to use this information to select thread for system testing. One way to determine the operational profile of a system is to use decision tree. The decision tree shows the transition probabilities value. The value for any state need is to be found or estimated of each going transition. The sum of these must be 1. The example of operational profile shown in [16].

Probability.
There two type of probability theory in the study of software testing: the probability that a particular path of statements executes; and the other generalized to a popular industrial concept called operational profile [17]. It is a tool for the design and analysis of probabilistic and randomized algorithms.
The probability concept explain detail in [6]. It is defined as a sample space S, which is a set of elements called elementary events. The elementary event can be viewed as a possible outcome this study. The element in this study are packages, aspects and advices.

Proposed Models
According to the subject program as data set used throughout this paper, the main requirements are code profiling at the first step of the proposed method. This operation already discussed in [10].
Definition in this step are provided as follows: A: the number of aspect; a: the elements of A; F(a): the set of aspect in A. Given a program, let ܽ ߳ ‫ܣ‬ be an aspect. Denote that A(a) the set of aspect in A and ‫ܣ(ܨ‬ ଵ ) =∪ ఢ భ ‫,)ܽ(ܨ‬ ‫ܽ(ܨ‬ ) contain aspects which are in ܽ . Suppose that P is a probability of aspect from 0 to 1; equivalent there is a distribution of aspect. Then the aspect size of ܽ ଵ is defined as The highest of value will select as the first domain to be tested. Figure 1 shows the Code Profiling process model. Firstly, read the input source code. In this process, aspect is counted. Certain program has package. The package also need to be list down and counted. If the aspect found, then check whether there is advice or not. Thus, advice can be after or before or around. If more than one of each advice such as after. The name for after is after 1, after 2 until after n. Same case to other advice. The process continues until finish the code. Then, probability calculation needed. In this calculation, line of code need to consider. In this study, tool used to ensure the number is correct. From this calculation the value for each of advices are determined.

A. Code profiling
According to the subject program as data set used throughout this paper, the code profiling is the first step of the proposed methods. Tetris code used as a sample in this research as case study. The Tetris code is a benchmark code from eclipse [18]. After analyzing the code using tool, there are three packages named: AspectLogic; Gui; and HighScore. For AspectLogic, two aspect involved: nextBlock with two advices; and newBlock with five advices. Package Gui, consists of two aspects: Levels with four advices; and Counters with 6 advices. Meanwhile, package HighScore consists of two aspects: Menu with two advices; and TestAspect with single advice. In Figure 2. shows the tree of Tetris code. This tree to show the profile of the code graphically. This method easy to calculate the probability for each element inside the code. The elementary of code can see clearly with package, aspect and advices.

B. Calculate the Probability
Then, probability calculation based on the profile analysis for the code. The calculation needed to get the highest value. The value will be used as the first domain to be tested in the software under test. The probability value shown in Table 1.

Discussion
One of the issues in code profiling is the elementary of profile. This work focus on advice part in AspectJ code. Advice is the part that execute the and can change the operation of code. The advice consists of after, before and around. In this strategy, object also is one of the factor will affected to the value of profile. Thus, calculation from the whole code that refer to the aspect should take into consideration for next study.
The result in Figure below shows the highest is gui.menu.after with 17% from the aspect code. This code will be selected as the first area to be tested. If core concern or object involved in this profiling, the value may affect to the test cases selection.

Conclusion and Future Work
StART is a testing strategy for test case selection. In this strategy, information from source code is taken into account called code profiling. In this paper, shows the code profiling model support the tester to test which part the need to be test first. The model applies probability calculation to calculate elementary in AspectJ code profile. Future work, the model can be applied to next phase of StART strategy and can be implemented to any real case study.