Statistical Testing Statistical Testing n n n Statistical

  • Slides: 34
Download presentation
Statistical Testing

Statistical Testing

Statistical Testing n n n Statistical testing randomly selects test cases from the input

Statistical Testing n n n Statistical testing randomly selects test cases from the input domain according to the intended usage distribution. Statistical domain testing. Statistical finite state machine (or Markov chain) testing. Statistical control flow testing. Statistical data flow testing.

Uses of Usage Distributions n n Productivity improvement and schedule gains could be achieved

Uses of Usage Distributions n n Productivity improvement and schedule gains could be achieved by reducing testing effort for lesser-used parts. New products can be introduced by implementing highly used features quickly to capture market share and then gradually adding lesser-used features in subsequent releases.

Uses of Usage Distributions n n High return on investment: the cost-benefit ratio is

Uses of Usage Distributions n n High return on investment: the cost-benefit ratio is reported to be about 1: 10. The use of usage distribution can foster better communications with target customers and help establish and maintain better customer relations.

Better Communications and Relations with Customers n The construction of usage distribution needs the

Better Communications and Relations with Customers n The construction of usage distribution needs the direct or indirect involvement of customers. It is more likely for the software development organization and the customers to appreciate each other’s views and efforts in such a collaborative instead of adversarial environment.

Better Communications and Relations with Customers n n The use of usage distribution can

Better Communications and Relations with Customers n n The use of usage distribution can help develop more precise product requirements and specifications, which are more likely to satisfy customers’ needs. Customer and user training can be better focused on those features that the customers use the most instead of esoteric ones more likely to be used by internal users.

Operational Profiles n n n Proportional domain testing uses operational profiles to maintain usage

Operational Profiles n n n Proportional domain testing uses operational profiles to maintain usage distributions. An operational profile is a list of disjoint set of operations and their associated probabilities of occurrence. It is a quantitative characterization of the way a software system is or will be used.

File type. gif. html directory Usage frequencies (hits) and probabilities. jpg. pdf (% of

File type. gif. html directory Usage frequencies (hits) and probabilities. jpg. pdf (% of total) for different file types for. class. ps SMU/SEAS. . ppt. css. txt. doc. c. ico Cumulative Total An Example Hits 438536 128869 87067 65876 10784 10055 2737 2510 2008 1597 1567 1254 849 753709 763021 % of total 57. 47% 16. 89% 11. 41% 8. 63% 1. 41% 1. 32% 0. 36% 0. 33% 0. 26% 0. 21% 0. 16% 0. 11% 98. 78% 100%

Representation of Operational Profiles n It is customary to sort the operations by n

Representation of Operational Profiles n It is customary to sort the operations by n n descending probabilities of usage. It is common to have quite uneven distribution of usage probabilities, with a few frequently used ones account for most of the usage frequencies. Related to the uneven distribution of usage probabilities is the probability threshold for individual operations. If some operations have very low probability of usage, we could omit them in the operational profile.

Constructing Operational Profiles n n How many operational profiles are enough? This depends on

Constructing Operational Profiles n n How many operational profiles are enough? This depends on the homogeneity or similarity of product usage by different customers. If there are no fundamental differences, one operational profile would be appropriate. If substantial differences exist, then one operational profile for each individual group of customers would be appropriate.

Generic Methods n n n Actual measurement of usage at customer installations. Survey of

Generic Methods n n n Actual measurement of usage at customer installations. Survey of target customers. Usage estimation based on expert opinions.

Limitations of Actual Measurement n n n For new products or new applications, there

Limitations of Actual Measurement n n n For new products or new applications, there won’t be in-field customer installations. Therefore, actual measurement would not be possible. Even if there are in-field customer installations for products, the actual usage information and the environment may contain a substantial amount of business sensitive and proprietary data. Therefore, the customers would not be willing to share the data. Expensive to implement.

Customer Surveys n n n Customer surveys can provide more objective and potentially more

Customer Surveys n n n Customer surveys can provide more objective and potentially more accurate information than expert opinions. For products with limited number of customers, the survey might be more manageable. For mass-market products, the massive user population requires careful planning to reduce the survey cost while maintaining result accuracy.

Expert Opinions n n The main advantages of using expert opinions to construct operational

Expert Opinions n n The main advantages of using expert opinions to construct operational profiles are the ready availability of these mostly internal experts and the much lower cost. Other information sources include many of the existing product and system documentations, and product specifications and relevant standards.

Participants of Operational Profiles n n The operational profile should be developed by a

Participants of Operational Profiles n n The operational profile should be developed by a combination of system engineers, highlevel designers, and test planners, with strong participation from product planning and marketing functions. The involvement of customers is implicitly assumed here as a primary source of information.

Operational Profile Development Procedure: Musa-1 n n n One OP is developed for each

Operational Profile Development Procedure: Musa-1 n n n One OP is developed for each homogeneous group of users or operations by following five basic steps: Find the customer profile by defining a complete set of customer categories weighted per a usage factor. Establish the user profile by defining user types weighted in relation to the customer groups and relative usage rates.

Operational Profile Development Procedure: Musa-1 n n Define the system modes and related profile

Operational Profile Development Procedure: Musa-1 n n Define the system modes and related profile by identifying the sets of operations commonly used together and obtaining their related weights. Determine the functional profile by identifying individual (high-level) functions and obtaining their related weights based on analysis of the system modes and environment variables.

Operational Profile Development Procedure: Musa-1 n Determine the operational profile by refining high-level functions

Operational Profile Development Procedure: Musa-1 n Determine the operational profile by refining high-level functions into detailed operations and obtaining their usage probabilities.

An Example: Customer Profile Customer Type corporation government education other Weight 0. 5 0.

An Example: Customer Profile Customer Type corporation government education other Weight 0. 5 0. 4 0. 05

An Example: User Profile by Customer Type Overall Type ctype com gov edu etc

An Example: User Profile by Customer Type Overall Type ctype com gov edu etc User weight 0. 5 0. 4 0. 05 Profile end user 0. 8 0. 9 0. 7 0. 84 dba 0. 02 programmer 0. 18 _ _ 0. 28 0. 104 third party _ 0. 08 _ 0. 036

Operational Profile Development Procedure: Musa-2 n n Musa-1 is suitable for large software systems.

Operational Profile Development Procedure: Musa-2 n n Musa-1 is suitable for large software systems. Musa-2 is suitable for smaller products or ones with more homogeneous user population. One operational profile is constructed for each operational mode, similar to the system mode in Musa-1. There are 5 generic steps.

Operational Profile Development Procedure: Musa-2 n n n Identify initiators of operations. Determine tabular

Operational Profile Development Procedure: Musa-2 n n n Identify initiators of operations. Determine tabular or graphical representation. Create operations lists. Determine the occurrence rate. Determine the occurrence probability.

Identify Initiators of Operations n n n These initiators include human users as well

Identify Initiators of Operations n n n These initiators include human users as well as other software, hardware, network, etc. Customer types and user types. External systems and system under study.

Create Operations Lists n n Generate an operations list for each initiator type. These

Create Operations Lists n n Generate an operations list for each initiator type. These lists can consolidated into a comprehensive list.

Determine the Occurrence Rate n Actual measurement is typically used to obtain data about

Determine the Occurrence Rate n Actual measurement is typically used to obtain data about the occurrence rate or frequency for individual operations in the above consolidated operations list and tabulated.

Determine the Occurrence Probability n n The occurrence rates are normalized to obtain the

Determine the Occurrence Probability n n The occurrence rates are normalized to obtain the occurrence probabilities. The occurrence probabilities satisfy 0 pi 1 and i pi = 1.

An Example n n n Web usage by a group of users. Stage 1:

An Example n n n Web usage by a group of users. Stage 1: Starting the browser with two choices: either on the default starting page or a customized starting page. Stage 2: All subsequent usage is modeled as one stage, with three choices: following links in visited pages, following bookmarked pages, or a mixture of the two.

An Example Stage 1: Start up 200/1000=0. 2 default customized 800/1000=0. 8 Stage 2:

An Example Stage 1: Start up 200/1000=0. 2 default customized 800/1000=0. 8 Stage 2: Other use X Operation sequence Probability 160/200=0. 8 linked default linked 0. 16 bookmarked 30/200=0. 15 mixture 10/200=0. 05 default bookmarked 0. 03 default mixture 0. 01 customized linked 0. 08 customized bookmarked 0. 16 customized mixture 0. 56 80/800=0. 1 linked bookmarked Y 160/800=0. 2 mixture 560/800=0. 7

Markov Chains n n n A Markov chain is a finite state machine with

Markov Chains n n n A Markov chain is a finite state machine with each transition associated with a probability and the set of probabilities satisfies the following two properties: The probability pij for the transition from state i to state j only depends on the state i, i. e. , is history independent. 0 pij 1 and j pij = 1.

An Example B A Power-up p(A, B) = 1 Mobile Station Initialization p(E, B)

An Example B A Power-up p(A, B) = 1 Mobile Station Initialization p(E, B) = 1 C p(B, C) = 1 p(C, B) = 0. 01 Mobile Station Idle p(C, D) = 0. 99 Mobile Station Control on Traffic Channel E p(D, C) = 0. 3 System p(D, E) = 0. 7 Access D

Unified Markov Models n n A unified Markov model is a set of hierarchical

Unified Markov Models n n A unified Markov model is a set of hierarchical Markov chains. A state in a unified Markov model may represent a Markov chain.

An Example E 1 Traffic Channel Initialization Arc T_i p(1, 4) = 0. 5

An Example E 1 Traffic Channel Initialization Arc T_i p(1, 4) = 0. 5 p(1, 2) = 0. 5 E 2 E 3 Waiting for Order p(2, 5) = 0. 1 p(2, 3) = 0. 9 ) , 5 3 p( = 05. 0 Waiting for Mobile Station Answer p(3, 4) = 0. 95 p(4, 3) = 0. 5 p(5, 3) = 0. 2 Release Conversation p(4, 5) = 0. 5 Arc T_o E 5 E 4

Thresholds n n n Overall probability threshold: for complete end -to-end operations to ensure

Thresholds n n n Overall probability threshold: for complete end -to-end operations to ensure that commonly used complete operation sequences are covered and adequately tested. State probability threshold: to ensure that frequently visited states are covered and adequately tested. Transition probability threshold: to ensure that commonly used operation pairs are covered and adequately tested.

An Example B A Power-up p(A, B) = 1 Mobile Station Initialization p(E, B)

An Example B A Power-up p(A, B) = 1 Mobile Station Initialization p(E, B) = 1 C p(B, C) = 1 p(C, B) = 0. 01 p(C, D) = 0. 99 Mobile Station Control on Traffic Channel p(D, C) = 0. 3 System p(D, E) = 0. 7 Access E ABCDE Mobile Station Idle D 1 1 0. 99 0. 7 = 0. 693 ABCDEBCDC 1 1 0. 99 0. 7 1 1 0. 99 0. 3 = 0. 205821