【正文】
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 probability of the percentage of reachability ? / 2 events being p is ??? / 2 f? ,? ( p)dp . By adjusting the values of ? and ?, we can change the form of test profiles, as shown in Figure 3. D. Test Profile Model based onDmax Dmax is an integer value within 0 and Q, where Q is the relationship between the GUI test profiles and the fault detection in GUI testing. We show the procedure using the test profile model with a single parameter ?, as model (1), (3) and (6). Other model can also be applied on this procedure. We first study what values the parameter ? can set. A set of values of ? are then determined. For each of the value of ?, n test suites are generated following the distribution of TP(?). These test cases are executed on the m faulty versions of the GUI AUT. The average number of defected faults with respect length of the shortest path between the farthest two events in to each test profile TP(?) is collected (., N F (? ) ). At last, the bination of all the EFGs and the IT of the AUT (refer to Section ). At most time, Q is a much larger than the Dmax. Similar with model (1) and (2), we can approximately follow a Poisson distribution of Dmax to select test cases, as the following test profile model: TP(?) = { ?Dmax=k, ?k?1e??/(k?1)!?, k = 1,2,… ,Q}. (6) Note that when we use this test profile model, the value of ??should be set to much s