【正文】
the source code. Obviously, NH ? L. PR is the proportion of reachability events to all events in a This characteristic describes how “deep” a test case can reach in the GUIs of the AUT. The GUIs of an AUT consist of a set of windows. For each window w, N(w) studies how many times a test case will operate on the objects contained in w. Many other characteristics can be obtained from GUI test cases, for example, the number of events covered by a test case, the proportion of events that performs on the main window, etc. In this paper, we only study the characteristics in Table 1 for demonstration. III. GUI TEST PROFILE MODELING Test profile (or operational profiles) can be modeled in many forms. In [3], several software operational profile models based on equivalence class division of the input domain are introduced. These models can also be used as GUI test profile models. However, how to divide the input domain into equivalence classes is not concerned. In GUI testing, the test cases provide rich information, such as the characteristics presented in Section II. The information can be used as equivalence relations for dividing the input domain. With these equivalence relations, in the process of testing, we can adjust the GUI test profile to achie ve certain objectives, such as detecting more faults, or covering more code. The first step of achie ving this goal is to the model test profile. In this section, we will define several models of the test profile in GUI testing based on the characteristics of GUI test cases introduced in Section II. A basic form of test profile is uniform test profile models. That is, different test cases are used following equally probability. When no prior knowledge of the test suite is provided, a uniform test profile model may be a good choice. However, if certain subset of the test suite is more important in testing, (for example, the test cases in the subset have higher defect detection ability,) a nonuniform test profile model is better than the uniform ones. So, In this section, wetest case. Reachability events [12] are the events that open me nus or windows (modal windows or modeless windows [10]). They expand the set of available events in testing. They are important in the traversal of the GUI structures. 262 also propose some nonuniform GUI test profile models besides uniform test profile models. A. Test Profile Model based on L L (the length of a test case) is an integer value in GUI testing. In theory, L can be any positive integer. However, in practice, the length of each test case varies in a range. In GUI testing, the test cases with certain length may have higher defect detection ability. These test cases should be tested more intensively than shorter or longer test cases. So, test profiles can be modeled as a Poisson distribution of L: TP(?) = { ?L=k, ?k?1e??/(k?1)!?, k = 1,2,…}, (1) where (k?1)! is the factor of k?1. The above test profile model means that the probability of the length of a test case being k is ?k?1e??/(k?1)!, as shown in Figure 1. ? is the parameter of the test profile. This is a nonuniform test profile. By adjusting the value of ?, we can control what kinds of test cases will be more intensively used. Note that Poisson distribution is used in this model because 1) such a test profile can intensively test the test cases with certain length, and 2) it has only one parameter so that it can be adjusted easily. Similar probability distributions (such as binomial distribution) can also be used as test profile models. When we have no prior knowledge about the test suite, a uniform distribution of L can be used to model the test profile: TP = { ?L=k, 1/M?, k = 1,2,… ,M}, (2) where (k?1)! is the factor of k?1, and M is a predefined maximum length of test cases. This model means that, if k M, the probability of using a test case whose length equals k is 1/M, and no test cases longer than M will be used in the testing, as shown in Figure 2. This model has no parameter. Figure 2 A uniform distribution of L as a test profile Figure 3 ? distributions of CE1/CE2 with different parameters as a test profile B. Test Profile Model based on NH NH (the time of event handler calls) is also an integer value. Similar with the test profile models based on L, the Poisson distribution and the uniform distribution of NH can be used as test profile models: TP(?) = { ?NH=k, ?k?1e??/(k?1)!?, k = 1,2,… }, (3) or TP = { ? NH=k, 1/M?, k = 1,2,…, M}, (4) where M is a predefined maximum length of test cases. C. Test Profile Model based on PR The proportion of reachability events (PR) is a value between 0 and 1. To make the test cases with certain value of PR be more intensively tested than others, we introduce ? distribution of PR as a GUI test profile. The density function of a ? distribution is ? 1 ? ?1 ?? ? ?1 f? ,? ( x) 1 ?0 x ? ?1 (1 ? x) x ? ?1 dx (1 x) , Figure 1 A Poisson distribution of L as a test profile where ?, ? are positive parameters of the distribution. The test profile model is as follows: ? / 2 TP(?,?) = { ?p, ??? / 2 f? ,? ( p)dp ?, for p ? (0,1) }, (5) 263 where ? is a small interval whose value depends on the accuracy degree of PR we require in testing. This model means that the