Presentation is loading. Please wait.

Presentation is loading. Please wait.

Handouts Software Testing and Quality Assurance Theory and Practice Chapter 1 Basic Concepts and Preliminaries ------------------------------------------------------------------

Similar presentations


Presentation on theme: "Handouts Software Testing and Quality Assurance Theory and Practice Chapter 1 Basic Concepts and Preliminaries ------------------------------------------------------------------"— Presentation transcript:

1 Handouts Software Testing and Quality Assurance Theory and Practice Chapter 1 Basic Concepts and Preliminaries 1

2 Outline of the Chapter The Quality Revolution Software Quality
Handouts The Quality Revolution Software Quality Role of Testing Verification and Validation Failure, Error, Fault and Defect The Notion of Software Reliability The Objectives of Testing What is a Test Case? Expected Outcome The Concept of Complete Testing The Central Issue in Testing Testing Activities Testing Level Source of Information for Test Selection White-box and Black-box Testing Test Planning and Design Monitoring and Measuring Test Execution Test Tools and Automation Test Team Organization and Management

3 The Quality Revolution
Handouts Started in Japan by Deming, Juran, and Ishikawa during 1940s In 1950s, Deming introduced statistical quality control to Japanese engineers Statistical quality control (SQC) is a discipline based on measurement and statistics SQC methods use seven basic quality management tool Pareto analysis, Trend Chart, Flow chart, Histogram, Scatter diagram, Control chart, Cause and effect diagram “Lean principle” was developed by Taiichi Ohno of Toyota “A systematic approach to identifying and eliminating waste through continuous improvement, flowing the product at the pull of the customer in pursuit of perfection.”

4 The Quality Revolution
Handouts The Quality Revolution Figure 1.1: The Shewhart cycle Deming introduced Shewhart’s PDCA cycle to Japanese researchers It illustrate the activity sequence: Setting goals Assigning them to measurable milestones Assessing the progress against the milestones Take action to improve the process in the next cycle

5 The Quality Revolution
Handouts In 1954, Juran spurred the move from SQC to TQC (Total Quality Control) Key Elements of TQC: Quality comes first, not short-term profits The customer comes first, not the producer Decisions are based on facts and data Management is participatory and respectful of all employees Management is driven by cross-functional committees An innovative methodology developed by Ishikawa called cause- and-effect diagram Figure 1.2: Ishikawa diagram

6 The Quality Revolution
Handouts National Broadcasting Corporation (NBC) of United States broadcast a documentary “If Japan Can ... Why Can’t We?” on June 24th, 1980 Leaders in United States started emphasizing on quality In 1987 Malcolm Baldrige National Quality Award was introduced in U.S.A Similar to the Deming prize in Japan In Baldrige National Award the quality is viewed as: Something defined by the customer In Deming prize, the quality is viewed as: Something defined by the producer by conformance to specifications

7 Software Quality Five Views of Software Quality:
Handouts Five Views of Software Quality: Transcendental view User’s view Manufacturing view Product view Value-based view Software Quality in terms of quality factors and criteria A quality factor represents behavioral characteristic of a system Examples: correctness, reliability, efficiency, and testability A quality criterion is an attribute of a quality factor that is related to software development Example: modularity is an attribute of software architecture Quality Models Examples: ISO 9126, CMM, TPI, and TMM

8 Role of Testing Handouts Software quality assessment divide into two categories: Static analysis It examines the code and reasons over all behaviors that might arise during run time Examples: Code review, inspection, and algorithm analysis Dynamic analysis Actual program execution to expose possible program failure One observe some representative program behavior, and reach conclusion about the quality of the system Static and Dynamic Analysis are complementary in nature Focus is to combines the strengths of both approaches

9 Verification and Validation
Handouts Verification Evaluation of software system that help in determining whether the product of a given development phase satisfy the requirements established before the start of that phase Building the product correctly Validation Evaluation of software system that help in determining whether the product meets its intended use Building the correct product

10 Failure, Error, Fault and Defect
Handouts Failure A failure is said to occur whenever the external behavior of a system does not conform to that prescribed in the system specification Error An error is a state of the system. An error state could lead to a failure in the absence of any corrective action by the system Fault A fault is the adjudged cause of an error Defect It is synonymous of fault It a.k.a. bug

11 The Notion of Software Reliability
Handouts It is defined as the probability of failure-free operation of a software system for a specified time in a specified environment It can be estimated via random testing Test data must be drawn from the input distribution to closely resemble the future usage of the system Future usage pattern of a system is described in a form called operational profile

12 The Objectives of Testing
Handouts It does work It does not work Reduce the risk of failures Reduce the cost of testing

13 What is a Test Case? Test Case is a simple pair of
Handouts Test Case is a simple pair of <input, expected outcome> State-less systems: A compiler is a stateless system Test cases are very simple Outcome depends solely on the current input State-oriented: ATM is a state oriented system Test cases are not that simple. A test case may consist of a sequences of <input, expected outcome> The outcome depends both on the current state of the system and the current input ATM example: < check balance, $ >, < withdraw, “amount?” >, < $200.00, “$200.00” >, < check balance, $ >

14 Expected Outcome An outcome of program execution may include
Handouts An outcome of program execution may include Value produced by the program State Change A sequence of values which must be interpreted together for the outcome to be valid A test oracle is a mechanism that verifies the correctness of program outputs Generate expected results for the test inputs Compare the expected results with the actual results of execution of the IUT

15 The Concept of Complete Testing
Handouts Complete or exhaustive testing means “There are no undisclosed faults at the end of test phase” Complete testing is near impossible for most of the system The domain of possible inputs of a program is too large Valid inputs Invalid inputs The design issues may be too complex to completely test It may not be possible to create all possible execution environments of the system

16 The Central Issue in Testing
Handouts The Central Issue in Testing Figure 1.5: A subset of the input domain exercising a subset of the program behavior Divide the input domain D into D1 and D2 Select a subset D1 of D to test program P It is possible that D1 exercise only a part P1 of P

17 Testing Activities Figure 1.6: Different activities in process testing
Handouts Testing Activities Figure 1.6: Different activities in process testing Identify the objective to be tested Select inputs Compute the expected outcome Set up the execution environment of the program Execute the program Analyze the test results

18 Testing Level Unit testing Integration testing System testing
Handouts Unit testing Individual program units, such as procedure, methods in isolation Integration testing Modules are assembled to construct larger subsystem and tested System testing Includes wide spectrum of testing such as functionality, and load Acceptance testing Customer’s expectations from the system Two types of acceptance testing UAT BAT UAT: System satisfies the contractual acceptance criteria BAT: System will eventually pass the user acceptance test Figure 1.7: Development and testing phases in the V model

19 Handouts Testing Level Figure 1.8: Regression testing at different software testing levels New test cases are not designed Test are selected, prioritized and executed To ensure that nothing is broken in the new version of the software

20 Source of Information for Test Selection
Handouts Requirement and Functional Specifications Source Code Input and output Domain Operational Profile Fault Model Error Guessing Fault Seeding Mutation Analysis

21 White-box and Black-box Testing
Handouts White-box testing a.k.a. structural testing Examines source code with focus on: Control flow Data flow Control flow refers to flow of control from one instruction to another Data flow refers to propagation of values from one variable or constant to another variable It is applied to individual units of a program Software developers perform structural testing on the individual program units they write Black-box testing a.k.a. functional testing Examines the program that is accessible from outside Applies the input to a program and observe the externally visible outcome It is applied to both an entire program as well as to individual program units It is performed at the external interface level of a system It is conducted by a separate software quality assurance group

22 Test Planning and Design
Handouts The purpose is to get ready and organized for test execution A test plan provides a: Framework A set of ideas, facts or circumstances within which the tests will be conducted Scope The domain or extent of the test activities Details of resource needed Effort required Schedule of activities Budget Test objectives are identified from different sources Each test case is designed as a combination of modular test components called test steps Test steps are combined together to create more complex tests

23 Monitoring and Measuring Test Execution
Handouts Metrics for monitoring test execution Metrics for monitoring defects Test case effectiveness metrics Measure the “defect revealing ability” of the test suite Use the metric to improve the test design process Test-effort effectiveness metrics Number of defects found by the customers that were not found by the test engineers

24 Test Tools and Automation
Handouts Increased productivity of the testers Better coverage of regression testing Reduced durations of the testing phases Reduced cost of software maintenance Increased effectiveness of test cases The test cases to be automated are well defined Test tools and an infrastructure are in place The test automation professionals have prior successful experience in automation Adequate budget have been allocation for the procurement of software tools

25 Test Team Organization and Management
Handouts Test Team Organization and Management Figure 16.1: Structure of test groups Hiring and retaining test engineers is a challenging task Interview is the primary mechanism for evaluating applicants Interviewing is a skills that improves with practice To retain test engineers management must recognize the importance of testing efforts at par with development effort

26 Handouts Software Testing and Quality Assurance Theory and Practice Chapter 2 Theory of Program Testing 26

27 Outline of the Chapter Basic Concepts in Testing Theory
Handouts Basic Concepts in Testing Theory Theory of Goodenough and Gerhart Theory of Weyuker and Ostrand Theory of Gourlay Adequacy of Testing Limitations of Testing Summary

28 Basic Concepts in Testing Theory
Handouts Testing theory puts emphasis on Detecting defects through program execution Designing test cases from different sources: requirement specification, source code, and input and output domains of programs Selecting a subset of tests cases from the entire input domain Effectiveness of test selection strategies Test oracles used during testing Prioritizing the execution of test cases Adequacy analysis of test cases

29 Theory of Goodenough and Gerhart
Handouts Fundamental Concepts Let P be a program, and D be its input domain. Let T  D. P(d) is the result of executing P with input d. Figure 2.1: Executing a program with a subset of the input domain. OK(d): Represents the acceptability of P(d). OK(d) = true iff P(d) is acceptable. SUCCESSFUL(T): T is a successful test iff t  T, OK(t). Ideal Test: T is an ideal test if OK(t), t  T => OK(d), d  D.

30 Theory of Goodenough and Gerhart
Handouts Fundamental Concepts (Contd.) Reliable Criterion: A test selection criterion C is reliable iff either every test selected by C is successful, or no test selected is successful. Valid Criterion: A test selection criterion C is valid iff whenever P is incorrect, C selects at least one test set T which is not successful for P. Let C denote a set of test predicates. If d  D satisfies test predicate c  C, then c(d) is said to be true. COMPLETE(T, C) ≡ (c  C)(t  T) c(t)  (t  T)(c  C) c(t) Fundamental Theorem (T D) (COMPLETE(T,C)  RELIABLE(C)  VALID(C)  SUCCESSFUL(T)) => (d  D) OK(d)

31 Theory of Goodenough and Gerhart
Handouts Program faults occur due to our inadequate understanding of all conditions that a program must deal with. failure to realize that certain combinations of conditions require special care. Kinds of program faults Logic fault Requirement fault Design fault Construction fault Performance fault Missing control-flow paths Inappropriate path selection Inappropriate or missing action Test predicate: It is a description of conditions and combinations of conditions relevant to correct operation of the program.

32 Theory of Goodenough and Gerhart
Handouts Conditions for Reliability of a set of test predicates C Every branching condition must be represented by a condition in C. Every potential termination condition must be represented in C. Every condition relevant to the correct operation of the program must be represented in C. Drawbacks of the Theory Difficulty in assessing the reliability and validity of a criterion. The concepts of reliability and validity are defined w.r.t. to a program. The goodness of a test should be independent of individual programs. Neither reliability nor validity is preserved throughout the debugging process.

33 Theory of Weyuker and Ostrand
Handouts d  D, the input domain of program P and T  D. OK(P, d) = true iff P(d) is acceptable. SUCC(P, T): T is a successful test for P iff forall t  T, OK(P, t). Uniformly valid criterion: Criterion C is uniformly valid iff (P) [ (d  D)(OK(P,d)) => (T  D) (C(T)  SUCC(P, T)) ]. Uniformly reliable criterion: Criterion C is uniformly reliable iff (P) (T1, T2  D) [ (C(T1)  C(T2)) => (SUCC(P, T1) <==> SUCC(P,T2)) ]. Uniformly Ideal Test Selection A uniformly ideal test selection criterion for a given specification is both uniformly valid and uniformly reliable. A subdomain S is a subset of D. Criterion C is revealing for a subdomain S if whenever S contains an input which is processed incorrectly, then every test set which satisfies C is unsuccessful. REVEALING(C, S) iff (d  S) (OK(d)) => (T S)(C(T) => SUCC(T)) .

34 Theory of Gourlay Handouts The theory establishes a relationship between three sets of entities specifications, programs and tests. Notation P: The set of all programs (p  P P) S: The set of all specifications (s  S S) T: The set of all tests (t  T T) “p ok(t) s” means the result of testing p with t is judged to be acceptable by s. “p ok(T) s” means “p ok(t) s,” t  T. “p corr s” means p is correct w.r.t. s. A testing system is a collection < P, S, T, corr, ok>, where corr P x S and ok T x P x S, and pst(p corr s => p ok(t) s). A test method is a function M: P x S T Program dependent: T = M(P) Specification dependent: T = M(S) Expectation dependent

35 Figure 2.3: Different ways of comparing the power of test methods.
Theory of Gourlay Handouts Power of test methods: Let M and N be two test methods. For M to be at least as good as N, we want the following to occur: Whenever N finds an error, so does M. (FM and FN are sets of faults discovered by test sets produced by test methods M and N, respectively.) (TM and TN are test sets produced by test methods M and N, respectively.) Two cases: (a) TN  TM and (b) TM and TN overlap Figure 2.3: Different ways of comparing the power of test methods.

36 Adequacy of Testing Handouts Reality: New test cases, in addition to the planned test cases, are designed while performing testing. Let the test set be T. If a test set T does not reveal any more faults, we face a dilemma: P is fault-free. OR T is not good enough to reveal (more) faults.  Need for evaluating the adequacy (i.e. goodness) of T. Some ad hoc stopping criteria Allocated time for testing is over. It is time to release the product. Test cases no more reveal faults.

37 Figure 2.4: Context of applying test adequacy.
Adequacy of Testing Handouts Figure 2.4: Context of applying test adequacy.

38 Adequacy of Testing Two practical methods for evaluating test adequacy
Handouts Two practical methods for evaluating test adequacy Fault seeding Program mutation Implant a certain number (say, X) of known faults in P, and test P with T. If k% of the X faults are revealed, T has revealed k% of the unknown faults. (More in Chapter 13) A mutation of P is obtained by making a small change to P. Some mutations are faulty, whereas the others are equivalent to P. T is said to be adequate if it causes every faulty mutations to produce unexpected results. (More in Chapter 3)

39 Limitations of Testing
Handouts Dijkstra’s famous observation Testing can reveal the presence of faults, but not their absence. Faults are detected by running P with a small test set T, where |T| << |D|, where |.| denotes the “size-of” function and “<<“ denoted “much smaller.” Testing with a small test set raises the concern of testing efficacy. Testing with a small test set is less expensive. The result of each test must be verified with a test oracle. Verifying a program output is not a trivial task. There are non-testable programs. A program is non-testable if There is no test oracle for the program. It is too difficult to determine the correct output.

40 Summary Theory of Goodenough and Gerhart Theory of Weyuker and Ostrand
Handouts Theory of Goodenough and Gerhart Ideal test, Test selection criteria, Program faults, Test predicates Theory of Weyuker and Ostrand Uniformly ideal test selection Revealing subdomain Theory of Gourlay Testing system Power of test methods (“at least as good as” relation) Adequacy of Testing Need for evaluating adequacy Methods for evaluating adequacy: fault seeding and program mutation Limitations of Testing Testing is performed with a test set T, s.t. |T| << |D|. Dijkstra’s observation Test oracle problem

41 Handouts Software Testing and Quality Assurance Theory and Practice Chapter 3 Unit Testing 41

42 Outline of the Chapter Concept of Unit Testing Static Unit Testing
Handouts Concept of Unit Testing Static Unit Testing Defect Prevention Dynamic Unit Testing Mutation Testing Debugging Unit Testing in eXtreme Programming Tools For Unit Testing

43 Concept of Unit Testing
Handouts Static Unit Testing Code is examined over all possible behaviors that might arise during run time Code of each unit is validated against requirements of the unit by reviewing the code Dynamic Unit Testing A program unit is actually executed and its outcomes are observed One observe some representative program behavior, and reach conclusion about the quality of the system Static unit testing is not an alternative to dynamic unit testing Static and Dynamic analysis are complementary in nature In practice, partial dynamic unit testing is performed concurrently with static unit testing It is recommended that static unit testing be performed prior to the dynamic unit testing

44 Static Unit Testing Handouts In static unit testing code is reviewed by applying techniques: Inspection: It is a step by step peer group review of a work product, with each step checked against pre-determined criteria Walkthrough: It is review where the author leads the team through a manual or simulated executed of the product using pre-defined scenarios The idea here is to examine source code in detail in a systematic manner The objective of code review is to review the code, and not to evaluate the author of the code Code review must be planned and managed in a professional manner The key to the success of code is to divide and conquer An examiner inspect small parts of the unit in isolation nothing is overlooked the correctness of all examined parts of the module implies the correctness of the whole module

45 Static Unit Testing (Code Review)
Handouts Step 1: Readiness Criteria Completeness Minimal functionality Readability Complexity Requirements and design documents Roles Moderator Author Presenter Record keeper Reviewers Observer Step 2: Preparation List of questions Potential Change Request (CR) Suggested improvement opportunities Figure 3.1: Steps in the code review process

46 Static Unit Testing (Code Review)
Handouts Step 3: Examination The author makes a presentation The presenter reads the code The record keeper documents the CR Moderator ensures the review is on track Step 4: Re-work Make the list of all the CRs Make a list of improvements Record the minutes meeting Author works on the CRs to fix the issue Step 5: Validation CRs are independently validated Step 6: Exit A summary report of the meeting minutes is distributes A Change Request (CR) includes the following details: Give a brief description of the issue Assign a priority level (major or minor) to a CR Assign a person to follow it up Set a deadline for addressing a CR

47 Static Unit Testing (Code Review)
Handouts Static Unit Testing (Code Review) The following metrics can be collected from a code review: The number of lines of code (LOC) reviewed per hour The number of CRs generated per thousand lines of code (KLOC) The number of CRs generated per hour The total number of hours spend on code review process

48 Static Unit Testing (Code Review)
Handouts The code review methodology can be applicable to review other documents Five different types of system documents are generated by engineering department Requirement Functional Specification High-level Design Low-level Design code In addition installation, user, and trouble shooting guides are developed by technical documentation group Table 3.1: System documents

49 Defect Prevention Build instrumentation code into the code
Handouts Build instrumentation code into the code Use standard control to detect possible occurrences of error conditions Ensure that code exists for all return values Ensure that counter data fields and buffer overflow/underflow are appropriately handled Provide error messages and help texts from a common source Validate input data Use assertions to detect impossible conditions Leave assertions in the code. Fully document the assertions that appears to be unclear After every major computation reverse-compute the input(s) from the results in the code itself Include a loop counter within each loop

50 Dynamic Unit Testing Handouts The environment of a unit is emulated and tested in isolation The caller unit is known as test driver A test driver is a program that invokes the unit under test (UUT) It provides input data to unit under test and report the test result The emulation of the units called by the UUT are called stubs It is a dummy program The test driver and the stubs are together called scaffolding The low-level design document provides guidance for selection of input test data Figure 3.2: Dynamic unit test environment

51 Handouts Dynamic Unit Testing Selection of test data is broadly based on the following techniques: Control flow testing Draw a control flow graph (CFG) from a program unit Select a few control flow testing criteria Identify a path in the CFG to satisfy the selection criteria Derive the path predicate expression from the selection paths By solving the path predicate expression for a path, one can generate the data Data flow testing Draw a data flow graph (DFG) from a program unit and then follow the procedure described in control flow testing. Domain testing Domain errors are defined and then test data are selected to catch those faults Functional program testing Input/output domains are defined to compute the input values that will cause the unit to produce expected output values

52 Mutation Testing Handouts Modify a program by introducing a single small change to the code A modified program is called mutant A mutant is said to be killed when the execution of test case cause it to fail. The mutant is considered to be dead A mutant is an equivalent tot the given program if it always produce the same output as the original program A mutant is called killable or stubborn, if the existing set of test cases is insufficient to kill it A mutation score for a set of test cases is the percentage of non- equivalent mutants killed by the test suite The test suite is said to be mutation-adequate if its mutation score is 100%

53 Mutation testing Mutant 1: Change line 5 to for i = 1 to 3 do
Handouts Mutation testing Consider the following program P main(argc,argv) int argc, r, i; char *argv[]; { r = 1; for i = 2 to 3 do if (atoi(argv[i]) > atoi(argv[r])) r = i; printf(“Value of the rank is %d \n”, r); exit(0); } Test Case 1: input: 1 2 3 output: Value of the rank is 3 Test Case 2: input: 1 2 1 output: Values of the rank is 2 Test Case 3: input: 3 1 2 output: Value of the rank is 1 Mutant 1: Change line 5 to for i = 1 to 3 do Mutant 2: Change line 6 to if (i > atoi(argv[r])) r = i; Mutant 3: Change line 6 to if (atoi(argv[i]) >= atoi(argv[r])) r = i; Mutant 4: Change line 6 to if (atoi(argv[r]) > atoi(argv[r])) r = i; Execute modified programs against the test suite, you will get the results: Mutants 1 & 3: Programs will pass the test suite, i.e., mutants 1 & 3 are not killable Mutant 2: Program will fail test cases 2 Mutant 1: Program will fail test case 1 and test cases 2 Mutation score is 50%, assuming mutants 1 & 3 non-equivalent

54 Mutation testing Handouts The score is found to be low because we assumed mutants 1 & 3 are nonequivalent We need to show that mutants 1 and 3 are equivalent mutants or those are killable To show that those are killable, we need to add new test cases to kill these two mutants First, let us analyze mutant 1 in order to derive a “killer” test. The difference between P and mutant 1 is the starting point Mutant 1 starts with i = 1, whereas P starts with i = 2. There is no impact on the result r. Therefore, we conclude that mutant 1 is an equivalent mutant Second, if we add a fourth test case as follows: Test Case 4: input: 2 2 1 Program P will produce the output “Value of the rank is 1” and mutant 3 will produce the output “Value of the rank is 2” Thus, this test data kills mutant 3, which give us a mutation score 100%

55 Mutation Testing Mutation testing makes two major assumptions:
Handouts Mutation testing makes two major assumptions: Competent Programmer hypothesis Programmers are generally competent and they do not create random programs Coupling effects Complex faults are coupled to simple faults in such a way that a test suite detecting simple faults in a program will detect most of the complex faults

56 Debugging Handouts The process of determining the cause of a failure is known as debugging It is a time consuming and error-prone process Debugging involves a combination of systematic evaluation, intuition and a little bit of luck The purpose is to isolate and determine its specific cause, given a symptom of a problem There are three approaches to debugging Brute force Cause elimination Induction Deduction Backtracking

57 Unit Testing in eXtreme Programming
Handouts Pick a requirement, i.e., a story Write a test case that will verify a small part of the story and assign a fail verdict to it Write the code that implement particular part of the story to pass the test Execute all test Rework on the code, and test the code until all tests pass Repeat step 2 to step 5 until the story is fully implemented Figure 3.3: Test-first process in XP

58 Unit Testing in eXtreme Programming
Handouts Three laws of Test Driven development (TDD) One may not write production code unless the first failing unit test is written One may not write more of a unit test than is sufficient to fail One may not write more production code than is sufficient to make the failing unit test pass Pair programming: In XP code is being developed by two programmers working side by side One person develops the code tactically and the other one inspects it methodically by keeping in mind the story they are implementing

59 JUnit – A Framework for Unit Testing
Handouts JUnit: It is a framework for performing unit testing of Java programs. Other frameworks: NUnit (C#), CPPUnit (C++), fUnit (Fortran) Intuitive steps to test a method in Java (Ex. Move() method of PlanetClass) Create an object instance of PlanetClass. Call it Mars. Select values of all input parameters of Move(). Compute the expected value to be returned by Move(). Let it be y. Execute method Move() on Mars with the selected input values. Let Move() return a value called z. Compare the actual output (z) returned by Move() with the expected value (y). If (z == y), Move() passes the test; otherwise it fails.  Report the result. JUnit makes writing of test cases easier.  Next slide …

60 JUnit – A Framework for Unit Testing
Handouts JUnit provides a basic class called TestCase. The tester Extends the TestCase class for each test case. 10 extensions for 10 test cases. Alternatively, extend TestCase to have 10 methods for 10 test cases. The TestCase class provides methods to make assertions. assertTrue(Boolean condition) assertFalse(Boolean condition) assertEquals(Object expected, Object actual) assertEquals(int expected, int actual) assertEquals(double expected, double actual, double tolerance) assertSame(Object expected, Object actual) assertNull(Object testobject) The tester can have her own assertions.

61 JUnit – A Framework for Unit Testing
Handouts Each assertion accepts an optional first parameter of type String; if the assertion fails, the string is displayed.  Help for the tester… The assertEquals() method displays a message upon failure. junit.framework.AssertionFailedError: expected: <x> but was: <y> Note that only failed tests are reported. The following shows how assertTrue() works. static public void assertTrue(Boolean condition) { if (!condition) throw new AssertionFailedError(); } Figure 3.5: The assertTrue() assertion throws an exception

62 JUnit – A Framework for Unit Testing
Handouts import TestMe; // TestMe is the class whose methods are going to be tested. import junit.framework.*; // This contains the TestCase class. public class MyTestSuite extends TestCase { // Create a subclass of TestCase public void MyTest1() { // This method is the first test case TestMe object1 = new TestMe( ... ); // Create an instance of TestMe with desired params int x = object1.Method1(...); // invoke Method1 on object1 assertEquals(365, x); // 365 and x are expected and actual values, respectively. } public void MyTest2() { // This method is the second test case TestMe object2 = new TestMe( ... ); // Create another instance of // TestMe with desired parameters double y = object2.Method2(...); // invoke Method2 on object2 assertEquals(2.99, y, d); // 2.99 is the expected value; // y is the actual value; // is tolerance level Figure 3.5: An example test suite

63 Tools For Unit Testing Code auditor Bound checker Documenters
Handouts Code auditor This tool is used to check the quality of the software to ensure that it meets some minimum coding standard Bound checker This tool can check for accidental writes into the instruction areas of memory, or to other memory location outside the data storage area of the application Documenters These tools read the source code and automatically generate descriptions and caller/callee tree diagram or data model from the source code Interactive debuggers These tools assist software developers in implementing different debugging techniques Examples: Breakpoint and Omniscient debuggers In-circuit emulators It provides a high-speed Ethernet connection between a host debugger and a target microprocessor, enabling developers to perform source-level debugging

64 Tools for Unit Testing Memory leak detectors
Handouts Memory leak detectors These tools test the allocation of memory to an application which request for memory and fail to de-allocate memory Static code (path) analyzer These tool identify paths to test based on the structure of code such as McCabe’s cyclomatic complexity measure Table 3.3: McCabe complexity measure

65 Tools for Unit Testing Software inspection support
Handouts Software inspection support Tools can help schedule group inspection Test coverage analyzer These tools measure internal test coverage, often expressed in terms of control structure of the test object, and report the coverage metric Test data generator These tools assist programmers in selecting test data that cause program to behave in a desired manner Test harness This class of tools support the execution of dynamic unit tests Performance monitors The timing characteristics of the software components be monitored and evaluate by these tools Network analyzers These tools have the ability to analyze the traffic and identify problem areas

66 Tools for Unit Testing Simulators and emulators Traffic generators
Handouts Simulators and emulators These tools are used to replace the real software and hardware that are not currently available. Both the kinds of tools are used for training, safety, and economy purpose Traffic generators These produces streams of transactions or data packets. Version control A version control system provides functionalities to store a sequence of revisions of the software and associated information files under development

67 Handouts Software Testing and Quality Assurance Theory and Practice Chapter 4 Control Flow Testing 67

68 Outline of the Chapter Basic Idea Outline of Control Flow Testing
Handouts Basic Idea Outline of Control Flow Testing Control Flow Graph Paths in a Control Flow Graph Path Selection Criteria Generating Test Input Containing Infeasible Paths Summary

69 Basic Idea Two kinds of basic program statements: Control flow
Handouts Two kinds of basic program statements: Assignment statements (Ex. x = 2*y; ) Conditional statements (Ex. if(), for(), while(), …) Control flow Successive execution of program statements is viewed as flow of control. Conditional statements alter the default flow. Program path A program path is a sequence of statements from entry to exit. There can be a large number of paths in a program. There is an (input, expected output) pair for each path. Executing a path requires invoking the program unit with the right test input. Paths are chosen by using the concepts of path selection criteria. Tools: Automatically generate test inputs from program paths.

70 Outline of Control Flow Testing
Handouts Figure 4.1: The process of generating test input data for control flow testing.

71 Outline of Control Flow Testing
Handouts Inputs to the test generation process Source code Path selection criteria: statement, branch, … Generation of control flow graph (CFG) A CFG is a graphical representation of a program unit. Compilers are modified to produce CFGs. (You can draw one by hand.) Selection of paths Enough entry/exit paths are selected to satisfy path selection criteria. Generation of test input data Two kinds of paths Executable path: There exists input so that the path is executed. Infeasible path: There is no input to execute the path. Solve the path conditions to produce test input for each path.

72 Figure 4.2: Symbols in a control flow graph
Handouts Symbols in a CFG Figure 4.2: Symbols in a control flow graph

73 Figure 4.3: A function to open three files.
Control Flow Graph Handouts Example code: openfiles() FILE *fptr1, *fptr2, *fptr3; /* These are global variables. */ int openfiles(){ /* This function tries to open files "file1", "file2", and "file3" for read access, and returns the number of files successfully opened. The file pointers of the opened files are put in the global variables. */ int i = 0; if( ((( fptr1 = fopen("file1", "r")) != NULL) && (i++) && (0)) || ((( fptr2 = fopen("file2", "r")) != NULL) && (i++) && (0)) || ((( fptr3 = fopen("file3", "r")) != NULL) && (i++)) ); return(i); } Figure 4.3: A function to open three files.

74 Figure 4.4: A high-level CFG representation of openfiles().
Control Flow Graph Handouts Figure 4.4: A high-level CFG representation of openfiles().

75 Figure 4.5: A detailed CFG representation of openfiles().
Control Flow Graph Handouts Figure 4.5: A detailed CFG representation of openfiles().

76 Control Flow Graph Example code: ReturnAverage()
Handouts Example code: ReturnAverage() public static double ReturnAverage(int value[], int AS, int MIN, int MAX){ /* Function: ReturnAverage Computes the average of all those numbers in the input array in the positive range [MIN, MAX]. The maximum size of the array is AS. But, the array size could be smaller than AS in which case the end of input is represented by */ int i, ti, tv, sum; double av; i = 0; ti = 0; tv = 0; sum = 0; while (ti < AS && value[i] != -999) { ti++; if (value[i] >= MIN && value[i] <= MAX) { tv++; sum = sum + value[i]; } i++; if (tv > 0) av = (double)sum/tv; else av = (double) -999; return (av); Figure 4.6: A function to compute the average of selected integers in an array.

77 Figure 4.7: A CFG representation of ReturnAverage().
Control Flow Graph Handouts Figure 4.7: A CFG representation of ReturnAverage().

78 Paths in a Control Flow Graph
Handouts A few paths in Figure 4.7. (Table 4.1) Path 1: 1-2-3(F)-10(T)-12-13 Path 2: 1-2-3(F)-10(F)-11-13 Path 3: 1-2-3(T)-4(T)-5-6(T)-7(T)-8-9-3(F)-10(T)-12-13 Path 4: 1-2-3(T)-4(T)-5-6-7(T)-8-9-3(T)-4(T)-5-6(T)-7(T)-8-9-3(F)-10(T)

79 Path Selection Criteria
Handouts Program paths are selectively executed. Question: What paths do I select for testing? The concept of path selection criteria is used to answer the question. Advantages of selecting paths based on defined criteria: Ensure that all program constructs are executed at least once. Repeated selection of the same path is avoided. One can easily identify what features have been tested and what not. Path selection criteria Select all paths. Select paths to achieve complete statement coverage. Select paths to achieve complete branch coverage. Select paths to achieve predicate coverage.

80 Path Selection Criteria
Handouts All-path coverage criterion: Select all the paths in the program unit under consideration. The openfiles() unit has 25+ paths. Table 4.2: The input domain of openfiles() Selecting all the inputs will exercise all the program paths. Existence of “file1” Existence of “file2” Existence of “file3” No Yes

81 Path Selection Criteria
Handouts Table 4.3 Inputs and paths in openfiles() Input Path <No, No, No> 1-2-3(F)-8-9(F)-14-15(F)-19-21 <Yes, No, No> 1-2-3(T)-4(F)-6-8-9(F)-14-15(F)-19-21 <Yes, Yes, Yes> 1-2-3(T)-4(F)-6-8-9(T)-10(T)-11-13(F) (T) - 16(T)

82 Path Selection Criteria
Handouts Statement coverage criterion Statement coverage means executing individual program statements and observing the output. 100% statement coverage means all the statements have been executed at least once. Cover all assignment statements. Cover all conditional statements. Less than 100% statement coverage is unacceptable. Table 4.4: Paths for statement coverage of the CFG of Figure 4.7. SCPath1 1-2-3(F)-10(F)-11-13 SCPath2 1-2-3(T)-4(T)-5-6(T)-7(T)-8-9-3(F)-10(T)-12-13

83 Path Selection Criteria
Handouts Branch coverage criterion A branch is an outgoing edge from a node in a CFG. A condition node has two outgoing branches – corresponding to the True and False values of the condition. Covering a branch means executing a path that contains the branch. 100% branch coverage means selecting a set of paths such that each branch is included on some path.

84 Path Selection Criteria
Handouts Figure 4.8: The dotted arrows represent the branches not covered by the statement covering in Table 4.4.

85 Path Selection Criteria
Handouts Branch coverage criterion A branch is an outgoing branch (edge) from a node in a CFG. A condition node has two outgoing branches – corresponding to the True and False values of the condition. Covering a branch means executing a path that contains the branch. 100% branch coverage means selecting a set of paths such that each branch is included on some path. Table 4.5: Paths for branch coverage of the flow graph of Figure 4.7. BCPath 1 1-2-3(F)-10(F)-11-13 BCPath 2 1-2-3(T)-4(T)-5-6(T)-7(T)-8-9-3(F)-10(T)-12-13 BCPath 3 1-2-3(T)-4(F)-10(F)-11-13 BCPath 4 1-2-3(T)-4(T)-5-6(F)-9-3(F)-10(F)-11-13 BCPath 5 1-2-3(T)-4(T)-5-6(T)-7(F)-9-3(F)-10(F)-11-13

86 Path Selection Criteria
Handouts Predicate coverage criterion If all possible combinations of truth values of the conditions affecting a path have been explored under some tests, then we say that predicate coverage has been achieved.

87 Path Selection Criteria
Handouts Figure 4.9: Partial control flow graph with (a) OR operation and (b) AND operation.

88 Generating Test Input Handouts Having identified a path, a key question is how to make the path execute, if possible. Generate input data that satisfy all the conditions on the path. Key concepts in generating test input data Input vector Predicate Path condition Predicate interpretation Path predicate expression Generating test input from path predicate expression

89 Generating Test Input Input vector
Handouts Input vector An input vector is a collection of all data entities read by the routine whose values must be fixed prior to entering the routine. Members of an input vector can be as follows. Input arguments to the routine Global variables and constants Files Contents of registers (in Assembly language programming) Network connections Timers Example: An input vector for openfiles() consists of individual presence or absence of the files “files1,” “file2,” and “file3.” Example: The input vector of ReturnAverega() shown in Figure 4.6 is <value[], AS, MIN, MAX>.

90 Generating Test Input Predicate Path predicate
Handouts Predicate A predicate is a logical function evaluated at a decision point. Example: ti < AS is a predicate in node 3 of Figure 4.7. Example: The construct OB is a predicate in node 5 in Figure 4.9. Path predicate A path predicate is the set of predicates associated with a path. Figure 4.10: An example path from Fig. 4.7: 1-2-3(T)-4(T)-5-6(T)-7(T)-8-9-3(F)-10(T) Figure 4.11: The path predicate for the path shown in Figure 4.10. ti < AS ≡ True value[i] != ≡ True value[i] >= MIN ≡ True value[i] <= MAX ≡ True ti < AS ≡ False tv > 0 ≡ True

91 Generating Test Input Predicate interpretation
Handouts Predicate interpretation A path predicate may contain local variables. Example: <i, ti, tv> in Figure 4.11 are local variables. Local variables play no role in selecting inputs that force a path to execute. Local variables can be eliminated by a process called symbolic execution. Predicate interpretation is defined as the process of symbolically substituting operations along a path in order to express the predicate solely in terms of the input vector and a constant vector. A predicate may have different interpretations depending on how control reaches the predicate.

92 Generating Test Input Path predicate expression
Handouts Path predicate expression An interpreted path predicate is called a path predicate expression. A path predicate expression has the following attributes. It is void of local variables. It is a set of constraints in terms of the input vector, and, maybe, constants. Path forcing inputs can be generated by solving the constraints. If a path predicate expression has no solution, the path is infeasible. Figure 4.13: Path predicate expression for the path shown in Figure 4.10. 0 < AS ≡ True …… (1) value[0] != ≡ True …… (2) value[0] >= MIN ≡ True …… (3) value[0] <= MAX ≡ True …… (4) 1 < AS ≡ False …… (5) 1 > 0 ≡ True …… (6)

93 Generating Test Input Path predicate expression
Handouts Path predicate expression An example of infeasible path Figure 4.14: Another example of path from Figure 4.7. 1-2-3(T)-4(F)-10(T)-12-13 Figure 4.15: Path predicate expression for the path shown in Figure 4.14. 0 < AS ≡ True …… (1) value[0] != ≡ True …… (2) 0 > 0 ≡ True …… (3)

94 Generating Test Input Handouts Generating input data from a path predicate expression Consider the path predicate expression of Figure 4.13 (reproduced below.) 0 < AS ≡ True …… (1) value[0] != ≡ True …… (2) value[0] >= MIN ≡ True …… (3) value[0] <= MAX ≡ True …… (4) 1 < AS ≡ False …… (5) 1 > 0 ≡ True …… (6) One can solve the above equations to obtain the following test input data AS = 1 MIN = 25 MAX = 35 Value[0] = 30 Note: The above set is not unique.

95 Containing Infeasible Paths
Handouts A program unit may contain a large number of paths. Path selection becomes a problem. Some selected paths may be infeasible. Apply a path selection strategy: Select as many short paths as possible. Choose longer paths. There are efforts to write code with fewer/no infeasible paths.

96 Summary Control flow is a fundamental concept in program execution.
Handouts Control flow is a fundamental concept in program execution. A program path is an instance of execution of a program unit. Select a set of paths by considering path selection criteria. Statement coverage Branch coverage Predicate coverage All paths From source code, derive a CFG (compilers are modified for this.) Select paths from a CFG based on path selection criteria. Extract path predicates from each path. Solve the path predicate expression to generate test input data. There are two kinds of paths. feasible infeasible

97 Handouts Software Testing and Quality Assurance Theory and Practice Chapter 5 Data Flow Testing 97

98 Outline of the Chapter The General Idea Data Flow Anomaly
Handouts The General Idea Data Flow Anomaly Overview of Dynamic Data Flow Testing Data Flow Graph Data Flow Terms Data Flow Testing Criteria Comparison of Data Flow Testing Criteria Feasible Paths and Test Selection Criteria Comparison of Testing Techniques Summary

99 The General Idea Handouts A program unit accepts inputs, performs computations, assigns new values to variables, and returns results. One can visualize of “flow” of data values from one statement to another. A data value produced in one statement is expected to be used later. Example Obtain a file pointer ……. use it later. If the later use is never verified, we do not know if the earlier assignment is acceptable. Two motivations of data flow testing The memory location for a variable is accessed in a “desirable” way. Verify the correctness of data values “defined” (i.e. generated) – observe that all the “uses” of the value produce the desired results. Idea: A programmer can perform a number of tests on data values. These tests are collectively known as data flow testing.

100 The General Idea Handouts Data flow testing can be performed at two conceptual levels. Static data flow testing Dynamic data flow testing Identify potential defects, commonly known as data flow anomaly. Analyze source code. Do not execute code. Involves actual program execution. Bears similarity with control flow testing. Identify paths to execute them. Paths are identified based on data flow testing criteria.

101 Data Flow Anomaly Anomaly: It is an abnormal way of doing something.
Handouts Anomaly: It is an abnormal way of doing something. Example 1: The second definition of x overrides the first. x = f1(y); x = f2(z); Three types of abnormal situations with using variable. Type 1: Defined and then defined again Type 2: Undefined but referenced Type 3: Defined but not referenced

102 Data Flow Anomaly Handouts Type 1: Defined and then defined again (Example 1 above) Four interpretations of Example 1 The first statement is redundant. The first statement has a fault -- the intended one might be: w = f1(y). The second statement has a fault – the intended one might be: v = f2(z). There is a missing statement in between the two: v = f3(x). Note: It is for the programmer to make the desired interpretation. Type 2: Undefined but referenced Example: x = x – y – w; /* w has not been defined by the programmer. */ Two interpretations The programmer made a mistake in using w. The programmer wants to use the compiler assigned value of w. Type 3: Defined but not referenced Example: Consider x = f(x, y). If x is not used subsequently, we have a Type 3 anomaly.

103 Data Flow Anomaly Handouts The concept of a state-transition diagram is used to model a program variable to identify data flow anomaly. Components of the state-transition diagrams The states U: Undefined D: Defined but not referenced R: Defined and referenced A: Abnormal The actions d: define the variable r: reference (or, read) the variable u: undefine the variable

104 Data Flow Anomaly Handouts Figure 5.2: State transition diagram of a program variable [10] (©[1979] IEEE).

105 Data Flow Anomaly Handouts Obvious question: What is the relationship between the Type 1, Type 2, and Type 3 anomalies and Figure 5.2? The three types of anomalies (Type 1, Type 2, and Type 3) are found in the diagram in the form of action sequences: Type 1: dd Type 2: ur Type 3: du Detection of data flow anomaly via program instrumentation Program instrumentation: Insert new code to monitor the states of variables. If the state sequence contains dd, ur, or du sequence, a data flow anomaly is said to occur. Bottom line: What to do after detecting a data flow anomaly? Investigate the cause of the anomaly. To fix an anomaly, write new code or modify the existing code.

106 Overview of Dynamic Data Flow Testing
Handouts A programmer manipulates/uses variables in several ways. Initialization, assignment, using in a computation, using in a condition Motivation for data flow testing? One should not feel confident that a variable has been assigned the correct value, if no test causes the execution of a path from the point of assignment to a point where the value is used. Note Assignment of correct value means whether or not a value has been correctly generated. Use of a variable means If new values of the same variable or other variables are generated. If the variable is used in a conditional statement to alter the flow of control. The above motivation indicates that certain kinds of paths are executed in data flow testing.

107 Overview of Dynamic Data Flow Testing
Handouts Data flow testing is outlined as follows: Draw a data flow graph from a program. Select one or more data flow testing criteria. Identify paths in the data flow graph satisfying the selection criteria. Derive path predicate expressions from the selected paths (See Chapter 4.) Solve the path predicate expressions to derive test inputs (See Chapter 4.)

108 Data Flow Graph Occurrences of variables
Handouts Occurrences of variables Definition: A variable gets a new value. i = x; /* The variable i gets a new value. */ Undefinition or kill: This occurs if the value and the location become unbound. Use: This occurs when the value is fetched from the memory location of the variable. There are two forms of uses of a variable. Computation use (c-use) Example: x = 2*y; /* y has been used to compute a value of x. */ Predicate use (p-use) Example: if (y > 100) { …} /* y has been used in a condition. */

109 Data Flow Graph Handouts A data flow graph is a directed graph constructed as follows. A sequence of definitions and c-uses is associated with each node of the graph. A set of p-uses is associated with each edge of the graph. The entry node has a definition of each edge parameter and each nonlocal variable used in the program. The exit node has an undefinition of each local variable.

110 Data Flow Graph Example code: ReturnAverage() from Chapter 4
Handouts Example code: ReturnAverage() from Chapter 4 public static double ReturnAverage(int value[], int AS, int MIN, int MAX){ /* Function: ReturnAverage Computes the average of all those numbers in the input array in the positive range [MIN, MAX]. The maximum size of the array is AS. But, the array size could be smaller than AS in which case the end of input is represented by */ int i, ti, tv, sum; double av; i = 0; ti = 0; tv = 0; sum = 0; while (ti < AS && value[i] != -999) { ti++; if (value[i] >= MIN && value[i] <= MAX) { tv++; sum = sum + value[i]; } i++; if (tv > 0) av = (double)sum/tv; else av = (double) -999; return (av); Figure 4.6: A function to compute the average of selected integers in an array.

111 Figure 5.4: A data flow graph of ReturnAverage() example.
Handouts Figure 5.4: A data flow graph of ReturnAverage() example.

112 Data Flow Graph Handouts A data flow graph is a directed graph constructed as follows. A sequence of definitions and c-uses is associated with each node of the graph. A set of p-uses is associated with each edge of the graph. The entry node has a definition of each edge parameter and each nonlocal variable used in the program. The exit node has an undefinition of each local variable.

113 Data Flow Terms Handouts Global c-use: A c-use of a variable x in node i is said to be a global c-use if x has been defined before in a node other than node i. Example: The c-use of variable tv in node 9 (Figure 5.4) is a global c-use. Definition clear path: A path (i – n1 – … nm – j), m ≥ 0, is called a definition clear path (def-clear path) with respect to variable x from node i to node j, and from node i to edge (nm, j), if x has been neither defined nor undefined in nodes n1 – … nm. Example: (2 – 3 – 4 – 6 – 3 – 4 – 6 – 3 – 4 – 5) is a def-clear path w.r.t. tv in Fig. 5.4. Example: (2 – 3 – 4 – 5) and (2 – 3 – 4 – 6) are def-clear paths w.r.t. variable tv from node 2 to 5 and from node 2 to 6, respectively, in Fig. 5.4.

114 Data Flow Terms Handouts Global definition: A node i has a global definition of variable x if node i has a definition of x and there is a def-clear path w.r.t. x from node i to some node containing a global c-use, or edge containing a p-use of variable x. Simple path: A simple path is a path in which all nodes, except possibly the first and the last, are distinct. Example: Paths (2 – 3 – 4 – 5) and (3 – 4 – 6 – 3) are simple paths. Loop-free paths: A loop-free path is a path in which all nodes are distinct. Complete path: A complete path is a path from the entry node to the exit node.

115 Data Flow Terms Handouts Du-path: A path (n1 – n2 – … – nj – nk) is a du-path path w.r.t. variable x if node n1 has a global definition of x and either node nk has a global c-use of x and (n1 – n2 – … – nj – nk) is a def-clear simple path w.r.t. x, or Edge (nj, nk) has a p-use of x and (n1 – n2 – … – nj – nk) is a def-clear, loop-free path w.r.t. x. Example: Considering the global definition and global c-use of variable tv in nodes 2 and 5, respectively, (2 – 3 – 4 – 5) is a du-path. Example: Considering the global definition and p-use of variable tv in nodes 2 and on edge (7, 9), respectively, (2 – 3 – 7 – 9) is a du-path.

116 Data Flow Testing Criteria
Handouts Seven data flow testing criteria All-defs All-c-uses All-p-uses All-p-uses/some-c-uses All-c-uses/some-p-uses All-uses All-du-paths

117 Data Flow Testing Criteria
Handouts All-defs For each variable x and each node i, such that x has a global definition in node i, select a complete path which includes a def-clear path from node i to node j having a global c-use of x, or edge (j, k) having a p-use of x. Example (partial): Consider tv with its global definition in node 2. Variable tv has a global c-use in node 5, and there is a def-clear path (2 – 3 – 4 – 5) from node 2 to node 5. Choose a complete path (1 – 2 – 3 – 4 – 5 – 6 – 3 – 7 – 9 – 10) that includes the def-clear path (2 – 3 – 4 – 5) to satisfy the all-defs criterion.

118 Data Flow Testing Criteria
Handouts All-c-uses For each variable x and each node i, such that x has a global definition in node i, select complete paths which include def-clear paths from node i to all nodes j such that there is a global c-use of x in j. Example (partial): Consider variable ti, which has a global definition in 2 and a global c-use in node 4. From node 2, the def-clear path to 4 is (2 – 3 – 4). One may choose the complete path (1 – 2 – 3 – 4 – 6 – 3 – 7 – 8 – 10). (There three other complete paths.) All-p-uses For each variable x and each node i, such that x has a global definition in node i, select complete paths which include def-clear paths from node i to all edges (j, k) such that there is a p-use of x on (j, k). Example (partial): Consider variable tv, which has a global definition in 2 and p-uses on edges (7, 8) and (7, 9). From node 2, there are def-clear paths to (7, 8) and (7, 9), namely (2 – 3 – 7 – 8) and (2 – 3 – 7 – 9). The two complete paths are: (1 – 2 – 3 – 7 – 8 – 10) and (1 – 2 – 3 – 7 – 9 – 10).

119 Data Flow Testing Criteria
Handouts All-p-uses/some-c-uses This criterion is identical to the all-p-uses criterion except when a variable x has no p-use. If x has no p-use, then this criterion reduces to the some-c-uses criterion. Some-c-uses: For each variable x and each node i, such that x has a global definition in node i, select complete paths which include def-clear paths from node i to some nodes j such that there is a global c-use of x in j. Example (partial): Consider variable i, which has a global definition in 2. There is no p-use of i. Corresponding to the global definition of I in 2, there is a global c-use of I in 6. The def-clear path from node 2 to 6 is (2 – 3 – 4 – 5 – 6). A complete path that includes the above def-clear path is (1 – 2 – 3 – 4 – 5 – 6 – 7 – 9 – 10).

120 Data Flow Testing Criteria
Handouts All-c-uses/some-p-uses This criterion is identical to the all-c-uses criterion except when a variable x has no c-use. If x has no global c-use, then this criterion reduces to the some-p- uses criterion. Some-p-uses: For each variable x and each node i, such that x has a global definition in node i, select complete paths which include def-clear paths from node i to some edges (j, k) such that there is a p-use of x on (j, k). All-uses: This criterion produces a set of paths due to the all-p-uses criterion and the all-c-uses criterion. All-du-paths: For each variable x and for each node i, such that x has a global definition in node i, select complete paths which include all du-paths from node i To all nodes j such that there is a global c-use of x in j, and To all edges (j, k) such that there is a p-use of x on (j, k).

121 Comparison of Data Flow Testing Criteria
Handouts Comparison of two testing criteria c1 and c2 We need a way to compare the two. Includes relationship: Given two test selection criteria c1 and c2, c1 includes c2 if for every def/use graph, any set of complete paths of the graph that satisfies c1 also satisfies c2. Strictly includes relationship: Given two test selection criteria c1 and c2, c1 strictly includes c2 provided c1 includes c2 and for some def/use graph, there is a set of complete paths of the graph that satisfies c2 but not c1.

122 Comparison of Data Flow Testing Criteria
Handouts Figure 5.5: The relationship among DF (data flow) testing criteria [6] (©[1988] IEEE).

123 Feasible Paths and Test Selection Criteria
Handouts Executable (feasible) path A complete path is executable if there exists an assignment of values to input variables and global variables such that all the path predicates evaluate to true. Consideing the feasibility of paths, the “includes” relatipnships of Fig. 5.5 change to Fig. 5.6.

124 Comparison of Testing Techniques
Handouts Figure 5.6: The relationship among the FDF (feasible data flow) testing criteria [6] (©[1988] IEEE).

125 Comparison of Testing Techniques
Handouts Figure 5.7: Limitations of different fault detection techniques.

126 Summary Data flow is a readily identifiable concept in a program unit.
Handouts Data flow is a readily identifiable concept in a program unit. Data flow testing Static Dynamic Static data flow analysis Data flow anomaly can occur due to programming errors. Three types of data flow anomalies (Type 1: dd), (Type 2: ur), (Type 3, du) Analyze the code to identify and remove data flow anomalies. Dynamic data flow analysis Obtain a data flow graph from a program unit. Select paths based on DF criteria: all-defs, all-c-uses, all-p-uses, all- uses, all-c-uses/some-p-uses, all-p-uses/some-c-uses, all-du-paths. The includes relationship is useful in comparing selection criteria.

127 Handouts Software Testing and Quality Assurance Theory and Practice Chapter 6 Domain Testing 127

128 Outline of the Chapter Domain Error Testing for Domain Errors
Handouts Domain Error Testing for Domain Errors Sources of Domains Types of Domain Errors ON and OFF Points Test Selection Criterion Summary

129 Domain Error Two fundamental elements of a program
Handouts Two fundamental elements of a program Input domain: The set of all input data to the program Program path: A sequence of instructions from entry to exit Feasible path: If there exists input data which causes the path to execute. Infeasible path: No input data exists to cause the path to execute. Howden identified 2 classes of errors by combining input domain and program paths. Computation error Domain error A computation error occurs when a specific input data causes the correct path to execute, but the output value is wrong. A domain error occurs when a specific input data causes the program to execute a wrong (i.e. undesired) path.

130 Domain Error Idea An input causes a path to execute.
Handouts Idea An input causes a path to execute. Different input data (i.e. a set of inputs) cause the same path to execute. Domain: A domain is a set of input values for which the program performs the same computation for every member of the set. We are interested in maximal domains such that the program performs different computations in different domains.

131 Domain Error Handouts Figure 6.1: Illustration of the concept of program domains.

132 Domain Error A program is considered as an input classifier.
Handouts A program is considered as an input classifier. A program is said to have a domain error if it incorrectly performs input classification. Wrong classification: This means a wrong path is executed for a specific input data.

133 Testing for Domain Errors
Handouts The idea of domain testing was first studied by White and Cohen. Domain testing differs from control/data flow testing. Flashback: control/data flow testing Note: No assumption is made about any kind of error in the program. Draw a graph – control flow or data flow. Select paths based on path selection criteria: statement, branch, all-use ... Generate input data from the selected paths. In contrast, in domain testing One identifies a category of faults, known as domain errors. We will discuss the following. Sources of domain Types of domain errors Selecting test data to reveal domain errors

134 Sources of Domains int codedomain(int x, int y){ int c, d, k
Handouts int codedomain(int x, int y){ int c, d, k c = x + y; if (c > 5) d = c - x/2; else d = c + x/2; if (d >= c + 2) k = x + d/2; else k = y + d/4; return(k); } Fig. 6.2: A function to explain program domains.

135 Domain Error Handouts Figure 6.3: Control flow graph rep. of the function in Fig. 6.2.

136 Domain Error Handouts Figure 6.3: Control flow graph rep. of the function in Fig. 6.2.

137 Types of Domain Errors Recall that
Handouts Recall that A domain is a set of values for which the program performs identical computations. A domain can be represented by a set of predicates. Individual elements of a domain satisfy the corresponding predicates. From a geometrical perspective, a domain is defined by a set of constraints, called boundary inequalities. The properties of a domain are discussed in terms of the properties of its boundaries. Closed boundary Open boundary Closed domain Open domain Extreme point Adjacent domain

138 Types of Domain Errors Closed boundary Open boundary Closed domain
Handouts Closed boundary A boundary is said to be closed if the points on the boundary are included in the domain of interest. Example: Consider the TT domain in Fig. 6.4 and the boundary defined by the inequality P2: x ≤ -4. This is a closed boundary of domain TT. Open boundary A boundary is said to be open if the points of the boundary do not belong to the domain of interest. Example: Consider the domain TT in Fig. 6.4 and its boundary defined by the inequality P1: x + y > 5. This is an open boundary of the domain TT. Closed domain A domain is said to be closed if all of its boundaries are closed. Open domain A domain is said to be open if some of its boundaries are open.

139 Types of Domain Errors Extreme point Adjacent domains
Handouts Extreme point An extreme point is a point where two or more boundaries cross. Adjacent domains Two domains are said to be adjacent if they have a boundary inequality in common.

140 Types of Domain Errors Note A domain error can be caused by
Handouts Note A program path will have a domain error if there is incorrect formulation of a path predicate. An incorrect predicate expression causes a boundary segment to be shifted from its correct position, or have an incorrect relational operator A domain error can be caused by An incorrectly specified predicate, or An incorrect assignment which affects a variable used in the predicate. We focus on the following kinds of boundary errors. Closure error Shifted-boundary error Tilted-boundary error

141 Types of Domain Errors Closure error Shifted-boundary error
Handouts Closure error A closure error occurs if a boundary is open when the intention is to have a closed boundary, or vice versa. Example: The relational operator ≤ is implemented as <. Shifted-boundary error A shifted boundary error occurs when the implemented boundary is parallel to the intended boundary. Example: Let the intended boundary be x + y > 4, whereas the actual boundary is x + y > 5. Tilted-boundary error A tilted-boundary error occurs if the constant coefficients of the variables in a predicate defining a boundary take up wrong values. Example: Let the intended boundary be x + 0.5*y > 5, whereas the actual boundary is x + y > 5.

142 ON and OFF Points Idea ON point OFF point
Handouts Idea Data points on or near a boundary are most sensitive to domain errors. Sensitive means a data point falling in the wrong domain. The objective is to identify the data points most sensitive to domain errors so that errors can be detected by examining the program with those input values. Based on the above idea, we define two kinds of data points: ON and OFF. ON point It is a point on the boundary or very close to the boundary. If a point can be chosen to lie exactly on the boundary, then choose it. This requires the boundary inequality to have an exact solution. If an inequality leads to an approximate solution, choose a point very close to the boundary. OFF point

143 ON and OFF Points ON point
Handouts ON point It is a point on the boundary or very close to the boundary. If a point can be chosen to lie exactly on the boundary, then choose it. This requires the boundary inequality to have an exact solution. If an inequality leads to an approximate solution, choose a point very close to the boundary. Example: Consider the boundary x + 7*y ≥ 6. For x = -1, the predicate gives us an exact solution of y = 1. Therefore the point (-1, 1) lies on the boundary. For x = 0, the predicate leads us to an approximate solution y = … . Since y does not have an exact solution, we can truncate it to or round it off to Notice that (0, 0.857) does not satisfy the predicate, whereas (0, 0.858) does satisfy. Thus, (0, 0.858) is an ON point which lies very close to the boundary. And, the on point lies outside the domain.

144 ON and OFF Points OFF point
Handouts OFF point An OFF point of a boundary lies away from the boundary. While choosing an OFF point, we must consider whether the boundary is open or closed w.r.t. the domain of interest. Open: An OFF point of the boundary is an interior point inside the domain within an ε-distance from the boundary. (ε ≡ small) Closed: An OFF point of that boundary is an exterior point outside the boundary with an ε-distance. Example (Closed): Consider a domain D1 with a boundary x + 7*y ≥ 6. An OFF point lies outside the domain. (-1, 0.99) lies outside D1. Example (Open): Consider a domain D2 that is adjacent to D1 above with an open boundary x + 7*y < 6. (-1, 0.99) lies inside D2.

145 ON and OFF Points Summary of ON and OFF points
Handouts Summary of ON and OFF points For a closed boundary: an ON point lies within the domain of interest, whereas an OFF point lies in an adjacent domain. For an open boundary, an ON point lies in an adjacent domain, whereas an OFF point lies within the domain of interest.

146 Figure 6.6: ON and OFF points.
Handouts Figure 6.6: ON and OFF points.

147 Test Selection Criterion
Handouts Selection criterion: For each domain and for each boundary select three points A, C, and B in an ON-OFF-ON sequence. We will consider the following kinds of errors. Closed inequality boundary 1.a Boundary shift resulting in a reduced domain 1.b Boundary shift resulting in an enlarged domain 1.c Boundary tilt 1.d Closure error Open inequality boundary 2.a Boundary shift resulting in a reduced domain 2.b Boundary shift resulting in an enlarged domain 2.c Boundary tilt 2.d Closure error Equality boundary

148 Test Selection Criterion
Handouts Test Selection Criterion Closed inequality boundary 1.a Boundary shift resulting in a reduced domain Figure 6.7: Boundary shift resulting in a reduced domain (closed inequality). Test data Actual output Expecte d output Fault detected A f1(A) No B f1(B) C f2(C) f1(C) Yes Table 6.2: Detection of boundary shift resulting in a reduced domain (closed inequality).

149 Test Selection Criterion
Handouts Test Selection Criterion Closed inequality boundary 1.b Boundary shift resulting in an enlarged domain Figure 6.8: Boundary shift resulting in an enlarged domain (closed inequality). Test data Actual output Expected output Fault detected A f1(A) f2(A) Yes B f1(B) f2(B) C f2(C) No Table 6.3: Detection of boundary shift resulting in an enlarged domain (closed inequality).

150 Test Selection Criterion
Handouts Test Selection Criterion Closed inequality boundary 1.c Tilted boundary Figure 6.9: Tilted boundary (closed inequality). Test data Actual output Expected output Fault detected A f1(A) No B f1(B) f2(B) Yes C f2(C) Table 6.4: Detection of tilted boundary (closed inequality).

151 Test Selection Criterion
Handouts Test Selection Criterion Closed inequality boundary 1.d Closure error Figure 6.10: Closure error (closed inequality). Test data Actual output Expected output Fault detected A f2(A) f1(A) Yes B f2(B) f1(B) C f1(C) No Table 6.5: Detection of closure error (closed inequality).

152 Test Selection Criterion
Handouts Test Selection Criterion Open inequality boundary 2.a Boundary shift resulting in a reduced domain Figure 6.11: Boundary shift resulting in a reduced domain (open inequality). Test data Actual output Expected output Fault detected A f2(A) f1(A) Yes B f2(B) f1(B) C f1(C) No Table 6.6: Detection of boundary shift resulting in a reduced domain (open inequality).

153 Test Selection Criterion
Handouts Test Selection Criterion Open inequality boundary 2.b Boundary shift resulting in an enlarged domain Figure 6.12: Boundary shift resulting in an enlarged domain (open inequality). Test data Actual output Expected output Fault detected A f2(A) No B f2(B) C f1(C) f2(C) Yes Table 6.7: Detection of boundary shift resulting in an enlarged domain (open inequality).

154 Test Selection Criterion
Handouts Test Selection Criterion Open inequality boundary 2.c Tilted boundary Figure 6.13: Tilted boundary (open inequality). Test data Actual output Expected output Fault detected A f2(A) f1(A) Yes B f2(B) No C f1(C) Table 6.8: Detection of tilted boundary (open inequality).

155 Test Selection Criterion
Handouts Test Selection Criterion Open inequality boundary 2.d Closure error Figure 6.14: Closure error (open inequality). Test data Actual output Expected output Fault detected A f1(A) f2(A) Yes B f1(B) f2(B) C f2(C) No Table 6.9: Detection of closure error (open inequality).

156 Test Selection Criterion
Handouts Equality border Figure 6.15: Equality border

157 Summary Handouts Concepts Two kinds of program error: computation errors and domain errors Domain: A set of inputs for which the program executes the same path. Domain error: A domain error occurs when an input value causes the program to execute the wrong path. A program is viewed as an input classifier. It classifies the input into a set of (sub)domains such that the program executes a different path for each domain. Each domain is identified by a set of boundaries, and each boundary is expressed as a boundary condition. Properties of boundaries: closed, open, closed domain, … Three kinds of boundary errors were identified. closure error, shifted boundary, tilted boundary ON and OFF points Test selection criterion: For each domain and for each boundary, select three points A, C, and B in an ON-OFF-ON sequence.

158 Handouts Software Testing and Quality Assurance Theory and Practice Chapter 7 System Integration Testing 158

159 Outline of the Chapter The Concept of Integration Testing
Handouts The Concept of Integration Testing Different Types of Interfaces Different Types of Interface Errors Granularity of System Integration Testing System Integration Techniques: Incremental, Top-down, Bottom-up, and Sandwich and Big-bang Software and Hardware Integration Hardware Design Verification Tests Hardware and Software Compatibility Matrix Test Plan for System Integration Off-the-self Component Integration Off-the-shelf Component Testing Built-in Testing

160 The Concept of Integration Testing
Handouts A software module is a self-contained element of a system Modules are individually tested commonly known as unit testing Next major task is to put the modules, i.e., pieces together to construct the complete system Construction of a working system from the pieces is not a straightforward task because of numerous interface errors The objective of system integration testing (SIT) is to build a “working” version of the system Putting modules together in an incremental manner Ensuring that the additional modules work as expected without disturbing the functionalities of the modules already put together Integration testing is said to be complete when The system is fully integrated togethr All the test cases have been executed All the severe and moderated defects found have been fixed

161 The Concept of Integration Testing
Handouts The major advantages of conducting SIT are as follows: Defects are detected early It is easier to fix defects detected earlier We get earlier feedback on the health and acceptability of the individual modules and on the overall system Scheduling of defect fixes is flexible, and it can overlap with development

162 Different Types of Interfaces
Handouts Three common paradigms for interfacing modules: Procedure call interface Shared memory interface Message passing interface The problem arises when we “put modules together” because of interface errors Interface errors Interface errors are those that are associated with structures existing outside the local environment of a module, but which the module uses

163 Different Types of Interface Errors
Handouts Different Types of Interface Errors Inadequate error processing Additions to error processing Inadequate post-processing Inadequate interface support Initialization/value errors Validation od data constraints Timing/performance problems Coordination changes Hardware/software interfaces Construction Inadequate functionality Location of functionality Changes in functionality Added functionality Misuse of interface Misunderstanding of interface Data structure alteration

164 Granularity of System Integration Testing
Handouts System Integration testing is performed at different levels of granularity Intra-system testing This form of testing constitutes low-level integration testing with the objective of combining the modules together to build a cohesive system Inter-system testing It is a high-level testing phase which requires interfacing independently tested systems Pairwise testing In pairwise integration, only two interconnected systems in an overall system are tested at a time The purpose of pairwise testing is to ensure that two systems under consideration can function together, assuming that the other systems within the overall environment behave as expected

165 System Integration Techniques
Handouts Common approaches to perform system integration testing Incremental Top-down Bottom-up Sandwich Big-bang Pre-requisite A module must be available to be integrated A module is said to available for combining with other modules when the module’s check-in request form is ready

166 Check-in Request Form Handouts

167 Incremental A software image is a compiled software binary
Handouts A software image is a compiled software binary A build is an interim software image for internal testing within an organization Constructing a build is a process by which individual modules are integrated to form am interim software image. The final build is a candidate for system testing Constructing a software image involves the following activities Gathering the latest unit tested, authorized versions of modules Compiling the source code of those modules Checking in the compiled code to the repository Linking the compiled modules into subassemblies Verifying that the subassemblies are correct Exercising version control

168 Incremental Handouts Integration testing is conducted in an incremental manner as a series of test cycles In each test cycle, a few more modules are integrated with an existing and tested build to generated larger builds The complete system is built, cycle by cycle until the whole system is operational for system-level testing. The number of SIT cycles and the total integration time are determined by the following parameters: Number of modules in the system Relative complexity of the module (cyclomatic complexity) Relative complexity of the interfaces between the modules Number of modules needed to be clustered together in each test cycle Whether the modules to be integrated have boon adequately tested before Turnaround time for each test-debug-fix cycle

169 Incremental Handouts A release note containing the following information accompanies a build. What has changed since the last build? What outstanding defects have been fixed? What are the outstanding defects in the build? What new modules, or features, have been added? What existing modules, or features, have been enhanced, modified, or deleted? Are there any areas where unknown changes may have occurred? A test strategy is created for each new build and the following issues are addressed while planning a test strategy What test cases need to be selected from the SIT test plan? What previously failed test cases should now be re-executed in order to test the fixes in the new build? How to determine the scope of a partial regression tests? What are the estimated time, resource deman, and cost to test this build?

170 Incremental Handouts Creating a daily build is very popular among many organization It facilitates to a faster delivery of the system It puts emphasis on small incremental testing It steadily increases number of test cases The system is tested using automated, re-usable test cases An effort is made to fix the defects that were found within 24 hours Prior version of the build are retained for references and rollback A typical practice is to retain the past 7-10 builds

171 Top-down Module A has been decomposed into modules B, C, and D
Handouts Top-down Module A has been decomposed into modules B, C, and D Modules B, D, E, F, and G are terminal modules First integrate modules A and B using stubs C` and D` (represented by grey boxes) Next stub D` has been replaced with its actual instance D Two kinds of tests are performed: Test the interface between A and D Regression tests to look for interface defects between A and B in the presence of module D Figure 7.1: A module hierarchy with three levels and seven modules Figure 7.2: Top-down integration of modules A and B Figure 7.3: Top-down integration of modules A, B and D

172 Handouts Top-down Stub C` has been replaced with the actual module C, and new stubs E`, F`, and G` Perform tests as follows: first, test the interface between A and C; second, test the combined modules A, B, and D in the presence of C The rest of the process depicted in the right hand side figures. Figure 7.5: Top-down integration of modules A, B, C, D and E Figure 7.6: Top-down integration of modules A, B, C, D, E and F Figure 7.4: Top-down integration of modules A, B, D and C

173 Top-down Handouts Advantages The SIT engineers continually observe system-level functions as the integration process continue Isolation of interface errors becomes easier because of the incremental nature of the top-down integration Test cases designed to test the integration of a module M are reused during the regression tests performed after integrating other modules Disadvantages It may not be possible to observe meaningful system functions because of an absence of lower level modules and the presence of stubs. Test case selection and stub design become increasingly difficult when stubs lie far away from the top-level module.

174 Handouts Bottom-up We design a test driver to integrate lowest-level modules E, F, and G Return values generated by one module is likely to be used in another module The test driver mimics module C to integrate E, F, and G in a limited way. The test driver is replaced with actual module , i.e., C. A new test driver is used At this moment, more modules such as B and D are integrated The new test driver mimics the behavior of module A Finally, the test driver is replaced with module A and further test are performed Figure 7.8: Bottom-up integration of module E, F, and G Figure 7.9: Bottom-up integration of module B, C, and D with F, F, and G

175 Bottom-up Handouts Advantages One designs the behavior of a test driver by simplifying the behavior of the actual module If the low-level modules and their combined functions are often invoked by other modules, then it is more useful to test them first so that meaningful effective integration of other modules can be done Disadvantages Discovery of major faults are detected towards the end of the integration process, because major design decision are embodied in the top-level modules Test engineers can not observe system-level functions from a partly integrated system. In fact, they can not observe system-level functions until the top-level test driver is in place

176 Big-bang and Sandwich Big-bang Approach
Handouts Big-bang Approach First all the modules are individually tested Next all those modules are put together to construct the entire system which is tested as a whole Sandwich Approach In this approach a system is integrated using a mix of top-down, bottom-up, and big-bang approaches A hierarchical system is viewed as consisting of three layers The bottom-up approach is applied to integrate the modules in the bottom-layer The top layer modules are integrated by using top-down approach The middle layer is integrated by using the big-bang approach after the top and the bottom layers have been integrated

177 Software and Hardware Integration
Handouts Integration is often done in an iterative manner A software image with a minimal number of core modules is loaded on a prototype hardware A small number of tests are performed to ensure that all the desired software modules are present in the build Next, additional tests are run to verify the essential functionalities The process of assembling the build, loading on the target hardware, and testing the build continues until the entire product has been integrated

178 Hardware Design Verification Tests
Handouts A hardware engineering process consists of four phases Planning and specification Design, prototype implementation, and testing Integration with the software system Manufacturing, distribution and field service A hardware Design Verification Test (DVT) plan is prepared and executed by the hardware group before the integration with software system

179 Hardware Design Verification Tests
Handouts The main hardware tests are aa follows: Diagnostic Test Electrostatic Discharge Test Electromagnetic Emission Test Electrical Test Thermal Test Environment Test Equipment Handling and Packaging Test Acoustic Test Safety Test Reliability Test

180 Hardware and Software Compatibility Matrix
Handouts H/W and s/w compatibility information is maintained in the form of a compatibility matrix It documents different revisions of the h/w and s/w that will be used for official release of the product An Engineering Change Order (ECO) is a formal document that describes a change to the hardware and software An ECO document includes the hardware software compatible matrix It is distributed to the operation, customer support and sales teams of the organization

181 Test Plan for System Integration
Handouts

182 Test Plan for System Integration
Handouts Table 7.4: A framework for system integration entry criteria

183 Test Plan for System Integration
Handouts Table 7.5: A framework for system integration exit criteria

184 Test Plan for System Integration
Handouts Categories of System Integration Tests: Interface integrity Internal and external interfaces are tested as each module is integrated Functional validity Tests to uncover functional errors in each module after it is integrated End-to-end validity Tests are designed to ensure that a completely integrated system works together from end-to-end Pairwise validity Tests are designed to ensure that any two systems work properly when connected by a network Interface stress Tests are designed to ensure that the interfaces can sustain the load System endurance Tests are designed to ensure that the integrated system stay up for weeks

185 Off-the-self Component Integration
Handouts Organization occasionally purchase off-the-self (OTS) components from vendors and integrate them with their own components Useful set of components that assists in integrating actual components: Wrapper: It is a piece of code that one builds to isolate the underlying components from other components of the system Glue: A glue component provides the functionality to combine different components Tailoring: Components tailoring refers to the ability to enhance the functionality of a component Tailoring is done by adding some elements to a component to enrich it with a functionality not provided by the vendor Tailoring does not involve modifying the source code of the component

186 Off-the-shelf Component Testing
Handouts OTS components produced by the vendor organizations are known as commercial off-the-shelf (COTS) components A COTS component is defined as: A unit of composition with contractually specified interfaces and explicit context dependencies only. A software component can be deployed independently and is subject to composition by third parties Three types of testing techniques are use to determine the suitability of a COTS component: Black-box component testing: This is used to determine the quality of the component System-level fault injection testing: This is used to determine how well a system will tolerate a failing component Operational system testing: This kind of tests are used to determine the tolerance of a software system when the COTS component is functioning correctly

187 Built-in Testing Testability is incorporated into software components
Handouts Testability is incorporated into software components Testing and maintenance can be self-contained Normal mode The built-in test capabilities are transparent to the component user The component does not differ from other non-built-in testing enabled components Maintenance mode The component user can test the component with the help of its built-in testing features The component user can invoke the respective methods of the component, which execute the test, evaluate autonomously its results, and output the test summary

188 Handouts Software Testing and Quality Assurance Theory and Practice Chapter 8 System Test Categories 188

189 Outline of the Chapter Taxonomy of System Tests Basic Tests
Handouts Taxonomy of System Tests Basic Tests Functionality Tests Robustness Tests Interoperability Tests Performance Tests Scalability Tests Stress Tests Load and Stability Tests Regression Tests Documentation Tests Regulatory Tests Software Safety Safety Assurance

190 Taxonomy of System Tests
Handouts Figure 8.1: Types of system tests

191 Taxonomy of System Tests
Handouts Basic tests provide an evidence that the system can be installed, configured and be brought to an operational state Functionality tests provide comprehensive testing over the full range of the requirements, within the capabilities of the system Robustness tests determine how well the system recovers from various input errors and other failure situations Inter-operability tests determine whether the system can inter- operate with other third party products Performance tests measure the performance characteristics of the system, e.g., throughput and response time, under various conditions

192 Taxonomy of System Tests
Handouts Scalability tests determine the scaling limits of the system, in terms of user scaling, geographic scaling, and resource scaling Stress tests put a system under stress in order to determine the limitations of a system and, when it fails, to determine the manner in which the failure occurs Load and Stability tests provide evidence that the system remains stable for a long period of time under full load Reliability tests measure the ability of the system to keep operating for a long time without developing failures Regression tests determine that the system remains stable as it cycles through the integration of other subsystems and through maintenance tasks Documentation tests ensure that the system’s user guides are accurate and usable

193 Basic Tests Figure 8.2: Types of basic tests
Handouts Basic Tests Figure 8.2: Types of basic tests Boot: Boot tests are designed to verify that the system can boot up its software image (or, build) from the supported boot options Upgrade/Downgrade: Upgrade/downgrade tests are designed to verify that the system software can be upgraded or downgraded (rollback) in a graceful manner

194 Basic Tests Handouts Light Emitting Diode: The LED (Light Emitting Diode) tests are designed to verify that the system LED status indicators functioning as desired Diagnostic: Diagnostic tests are designed to verify that the hardware components (or, modules) of the system are functioning as desired Power-On Self Test Ethernet Loop Back Test Bit Error Test Command line Interface: Command Line Interface (CLI) tests are designed to verify that the system can be configured

195 Functionality Tests Handouts Figure 8.3: Types of functionality tests

196 Functionality Tests Communication Systems Tests Module Tests
Handouts Communication Systems Tests These tests are designed to verify the implementation of the communication systems as specified in the customer requirements specification Four types of communication systems tests are recommended Basis interconnection tests Capability tests Behavior tests System resolution tests Module Tests Module Tests are designed to verify that all the modules function individually as desired within the systems The idea here is to ensure that individual modules function correctly within the whole system. For example, an Internet router contains modules such as line cards, system controller, power supply, and fan tray. Tests are designed to verify each of the functionalities

197 Functionality Tests Logging and Tracing Tests
Handouts Logging and Tracing Tests Logging and Tracing Tests are designed to verify the configurations and operations of logging and tracing This also includes verification of “flight data recorder: non-volatile Flash memory” logs when the system crashes Element Management Systems (EMS) Tests EMS tests verifies the main functionalities, which are to manage, monitor and upgrade the communication systems network elements It includes both EMS client and EMS servers functionalities Note: Read the SNMP example described in the book Management Information Base (MIB) Tests MIB tests are designed to verify Standard MIBs including MIB II Enterprise MIBs specific to the system

198 Functionality Tests Graphical User Interface Tests
Handouts Graphical User Interface Tests Tests are designed to look-and-feel the interface to the users of an application system Tests are designed to verify different components such as icons, menu bars, dialog boxes, scroll bars, list boxes, and radio buttons The GUI can be utilized to test the functionality behind the interface, such as accurate response to database queries Tests the usefulness of the on-line help, error messages, tutorials, and user manuals The usability characteristics of the GUI is tested, which includes the following Accessibility: Can users enter, navigate, and exit with relative ease? Responsiveness: Can users do what they want and when they want in a way that is clear? Efficiency: Can users do what they want to with minimum number of steps and time? Comprehensibility: Do users understand the product structure with a minimum amount of effort?

199 Functionality Tests Security Tests
Handouts Security Tests Security tests are designed to verify that the system meets the security requirements Confidentiality It is the requirement that data and the processes be protected from unauthorized disclosure Integrity It is the requirement that data and process be protected from unauthorized modification Availability It is the requirement that data and processes be protected form the denial of service to authorized users Security test scenarios should include negative scenarios such as misuse and abuse of the software system

200 Functionality Tests Handouts Security Tests (cont’d) : useful types of security tests includes the following: Verify that only authorized accesses to the system are permitted Verify the correctness of both encryption and decryption algorithms for systems where data/messages are encoded. Verify that illegal reading of files, to which the perpetrator is not authorized, is not allowed Ensure that virus checkers prevent or curtail entry of viruses into the system Ensure that the system is available to authorized users when a zero-day attack occurs Try to identify any “backdoors” in the system usually left open by the software developers

201 Functionality Tests Feature Tests
Handouts Feature Tests These tests are designed to verify any additional functionalities which are defined in requirement specification but not covered in the functional category discussed Examples Data conversion testing Cross-functionality testing

202 Robustness Tests Handouts Robustness means how much sensitive a system is to erroneous input and changes its operational environment Tests in this category are designed to verify how gracefully the system behaves in error situations and ina a changed operational environment Figure 8.4: Types of robustness tests

203 Robustness Tests Boundary value Power cycling
Handouts Boundary value Boundary value tests are designed to cover boundary conditions, special values, and system defaults The tests include providing invalid input data to the system and observing how the system reacts to the invalid input. Power cycling Power cycling tests are executed to ensure that, when there is a power glitch in a deployment environment, the system can recover from the glitch to be back in normal operation after power is restored On-line insertion and removal On-line Insertion and Removal (OIR) tests are designed to ensure that on-line insertion and removal of modules, incurred during both idle and heavy load operations, are gracefully handled and recovered

204 Robustness Tests High Availability Degraded Node
Handouts High Availability The concept of high availability is also known as fault tolerance High availability tests are designed to verify the redundancy of individual modules, including the software that controls these modules. The goal is to verify that the system gracefully and quickly recovers from hardware and software failures without adversely impacting the operation of the system High availability is realized by means of proactive methods to maximize service up-time, and to minimize the downtime Degraded Node Degraded node (also known as failure containment) tests verify the operation of a system after a portion of the system becomes non-operational It is a useful test for all mission-critical applications.

205 Interoperability Tests
Handouts Tests are designed to verify the ability of the system to inter-operate with third party products Note: Read the 1xEV-DO example described in the book The re-configuration activities during interoperability tests is known as configuration testing Another kind of inter-operability tests is called (backward) compatibility tests Compatibility tests verify that the system works the same way across different platforms, operating systems, data base management systems Backward compatibility tests verify that the current software build flawlessly works with older version of platforms

206 Performance Tests Handouts Tests are designed to determine the performance of the actual system compared to the expected one Tests are designed to verify response time, execution time, throughput, resource utilization and traffic rate One needs to be clear about the specific data to be captured in order to evaluate performance metrics. For example, if the objective is to evaluate the response time, then one needs to capture End-to-end response time (as seen by external user) CPU time Network connection time Database access time Waiting time

207 Scalability Tests Handouts Tests are designed to verify that the system can scale up to its engineering limits Scaling tests are conducted to ensure that the system response time remains the same, or increases by a small amount, as the number of users are increased. There are three major causes of these limitations: data storage limitations network bandwidth limitations speed limit Extrapolation is often used to predict the limit of scalability

208 Stress Tests Handouts The goal of stress testing is to evaluate and determine the behavior of a software component while the offered load is in excess of its designed capacity The system is deliberately stressed by pushing it to and beyond its specified limits It ensures that the system can perform acceptably under worst-case conditions, under an expected peak load. If the limit is exceeded and the system does fail, then the recovery mechanism should be invoked Stress tests are targeted to bring out the problems associated with one or more of the following: Memory leak Buffer allocation and memory carving

209 Load and Stability Tests
Handouts Tests are designed to ensure that the system remains stable for a long period of time under full load When a large number of users are introduced and applications that run for months without restarting, a number of problems are likely to occur: the system slows down the system encounters functionality problems the system crashes altogether Load and stability testing typically involves exercising the system with virtual users and measuring the performance to verify whether the system can support the anticipated load This kind of testing help one to understand the ways the system will fare in real-life situations

210 Reliability Tests Handouts Reliability tests are designed to measure the ability of the system to remain operational for long periods of time. The reliability of a system is typically expressed in terms of mean time to failure (MTTF) The average of all the time intervals between successive failures is called the MTTF After a failure is observed, the developers analyze and fix the defects, which consumes some time – let us call this interval the repair time. The average of all the repair times is known as the mean time to repair (MTTR) Now we can calculate a value called mean time between failure (MTBF) as MTBF = MTTF + MTTR The random testing technique discussed in Chapter 9 is used for reliability measurement The software reliability modeling and testing is discussed in Chapter 15 in detail

211 Regression Tests Handouts In this category, new tests are not designed, instead, test cases are selected from the existing pool and executed The main idea in regression testing is to verify that no defect has been introduced into the unchanged portion of a system due to changes made elsewhere in the system During system testing, many defects are revealed and the code is modified to fix those defects One of four different scenarios can occur for each fix: The reported defect is fixed The reported defect could not be fixed inspite of making an effort The reported defect has been fixed, but something that used to work before has been failing The reported defect could not be fixed inspite of an effort, and something that used to work before has been failing

212 Regression Tests Handouts One possibility is to re-execute every test case from version n − 1 to version n before testing anything new A full test of a system may be prohibitively expensive. A subset of the test cases is carefully selected from the existing test suite to maximize the likelihood of uncovering new defects reduce the cost of testing Methods for test selection for regression testing have been discussed in Chapter 12

213 Documentation Tests Handouts Documentation testing means verifying the technical accuracy and readability of the user manuals, tutorials and the on-line help Documentation testing is performed at three levels: Read test: In this test a documentation is reviewed for clarity, organization, flow, and accuracy without executing the documented instructions on the system Hands-on test: Exercise the on-line help and verify the error messages to evaluate their accuracy and usefulness. Functional test: Follow the instructions embodied in the documentation to verify that the system works as it has been documented.

214 Regulatory Tests Handouts In this category, the final system is shipped to the regulatory bodies in those countries where the product is expected to be marketed The idea is to obtain compliance marks on the product from various countries Most of these regulatory bodies issue safety and EMC (electromagnetic compatibility)/ EMI (electromagnetic interference) compliance certificates (emission and immunity) The regulatory agencies are interested in identifying flaws in software that have potential safety consequences The safety requirements are primarily based on their own published standards

215 Software Safety Handouts A hazard is a state of a system or a physical situation which when combined with certain environmental conditions, could lead to an accident or mishap An accident or mishap is an unintended event or series of events that results in death, injury, illness, damage or loss of property, or harm to the environment Software safety is defined in terms of hazards A software in isolation cannot do physical damage. However, a software in the context of a system and an embedding environment could be vulnerable

216 Software Safety Examples:
Handouts Examples: A software module in a database application is not hazardous by itself, but when it is embedded in a missile navigation system, it could be hazardous If a missile takes a U-turn because of a software error in the navigation system, and destroys the submarine that launched it, then it is not a safe software

217 Safety Assurance Handouts There are two basic tasks performed by a safety assurance engineering team: Provide methods for identifying, tracking, evaluating, and eliminating hazards associated with a system Ensure that safety is embedded into the design and implementation in a timely and cost effective manner, such that the risk created by the user/operator error is minimized

218 Handouts Software Testing and Quality Assurance Theory and Practice Chapter 9 Functional Testing 218

219 Outline of the Chapter Functional Testing Concepts of Howden
Handouts Functional Testing Concepts of Howden Different Types of Variables Test Vectors Howden’s Functional Testing Summary Pairwise Testing Orthogonal Array In Parameter Order Equivalence Class Partitioning Guidelines for Equivalence Class Partitioning Identification of Test Cases Advantages of Equivalence Class Partitioning Boundary Value Analysis (BVA) Guidelines for Boundary Value Analysis Decision Tables Random Testing Adaptive Random Testing Error Guessing Category Partition

220 Functional Testing Concepts of Howden
Handouts The four key concepts in functional testing are: Precisely identify the domain of each input and each output variable Select values from the data domain of each variable having important properties Consider combinations of special values from different input domains to design test cases Consider input values such that the program under test produces special values from the domains of the output variables

221 Different Types of Variables
Handouts Numeric Variables A set of discrete values A few contiguous segments of values Arrays An array holds values of the same type, such as integer and real. Individual elements of an array are accessed by using one or more indices. Substructures A structure means a data type that can hold multiple data elements. In the field of numerical analysis, matrix structure is commonly used. Subroutine Arguments Some programs accept input variables whose values are the names of functions. Such programs are found in numerical analysis and statistical applications

222 Test Vectors Handouts A test vector is an instance of an input to a program, a.k.a. test data If a program has n input variables, each of which can take on k special values, then there are kn possible combinations of test vectors We have more than one million test vectors even for k = 3 and n = 20 There is a need to identify a method for reducing the number of test vectors Howden suggested that there is no need of combining values of all input variables to design a test vector, if the variables are not functionally related It is difficult to give a formal definition of the idea of functionally related variables, but it is easy to identify them Variables appearing in the same assignment statement are functionally related Variables appearing in the same branch predicate – the condition part of an if statement, for example – are functionally related

223 Test Vectors Example of functionality related variables
Handouts Test Vectors Example of functionality related variables Figure 9.3: Functionality related variables

224 Howden’s Functional Testing Summary
Handouts Let us summarize the main points in functional testing: Identify the input and the output variables of the program and their data domains Compute the expected outcomes as illustrated in Figure 9.5(a), for selected input values Determine the input values that will cause the program to produce selected outputs as illustrated in Figure 9.5(b).

225 Howden’s Functional Testing Summary
Handouts Figure 9.5: Obtaining output values from an input vector (a), and obtaining an input vector from an output value (b) in functional testing

226 Pairwise Testing Handouts Pairwise testing means that each possible combination of values for every pair of input variables is covered by at least one test case Consider the system S in Figure 9.7, which has three input variables X, Y, and Z. For the three given variables X, Y , and Z, their value sets are as follows: D(X) = {True, False}, D(Y ) = {0, 5}, and D(Z) = {Q,R} Figure 9.7: System S with three input variables.

227 Pairwise Testing Handouts The total number of all-combination test cases is 2 × 2 × 2 = 8 However, a subset of four test cases, as shown in Table 9.5, covers all pairwise combinations

228 Orthogonal Array Handouts Consider the two-dimensional array of integers shown in Table 9.6 This is an example of L4(23) orthogonal array The “4” indicates that the array has 4 rows, also known as runs The “23” part indicates that the array has 3 columns, known as factors, and each cell in the array contains 2 different values, known as levels. Levels mean the maximum number of values that a single factor can take on Orthogonal arrays are generally denoted by the pattern LRuns(LevelsFactors)

229 Orthogonal Array Let us consider our previous example of the system S.
Handouts Let us consider our previous example of the system S. The system S which has three input variables X, Y, and Z. For the three given variables X, Y , and Z, their value sets are as follows: D(X) = {True, False}, D(Y ) = {0, 5}, and D(Z) = {Q,R}. Map the variables to the factors and values to the levels onto the L4(23) orthogonal array (Table 9.6) with the resultant in Table 9.5. In the first column, let 1 = True, 2 = False. In the second column, let 1 = 0, 2 = 5. In the third column, let 1 = Q, 2 = R. Note that, not all combinations of all variables have been selected Instead combinations of all pairs of input variables have been covered with four test cases

230 Orthogonal Array Handouts Orthogonal arrays provide a technique for selecting a subset of test cases with the following properties: It guarantees testing the pairwise combinations of all the selected variables It generates fewer test cases than a all-combination approach. It generates a test suite that has even distribution of all pairwise combinations It can be automated

231 In Parameter Order Handouts Tai and Lei have given an algorithm called In Parameter Order (IPO) to generate a test suite for pairwise coverage of input variables The algorithm runs in three phases, namely, initialization, horizontal growth, and vertical growth, in that order In the initialization phase, test cases are generated to cover two input variables In the horizontal growth phase, the existing test cases are extended with the values of the other input variables. In the vertical growth phase, additional test cases are created such that the test suite satisfies pairwiae coverage for the values of the new variables.

232 In Parameter Order Handouts Initialization

233 In Parameter Order Handouts Horizontal Growth Phase

234 In Parameter Order Handouts Vertical Growth Phase

235 Equivalence Class Partitioning
Handouts An input domain may be too large for all its elements to be used as test input (Figure 9.8(a)) The input domain is partitioned into a finite number of subdomains Each subdomain is known as an equivalence class, and it serves as a source of at least one test input (Figure 9.8(b)) A valid input to a system is an element of the input domain that is expected to return a non error value An invalid input is an input that is expected to return an error value. Figure 9.8: (a) Too many test input; (b) One input is selected from each of the subdomain

236 Guidelines for Equivalence Class Partitioning
Handouts An input condition specifies a range [a, b] one equivalence class for a < X < b, and two other classes for X < a and X > b to test the system with invalid inputs An input condition specifies a set of values one equivalence class for each element of the set {M1}, {M2}, ...., {MN}, and one equivalence class for elements outside the set {M1,M2, ...,MN} Input condition specifies for each individual value If the system handles each valid input differently then create one equivalence class for each valid input An input condition specifies the number of valid values (Say N) Create one equivalence class for the correct number of inputs two equivalence classes for invalid inputs – one for zero values and one for more than N values An input condition specifies a “must be” value Create one equivalence class for a “must be” value, and one equivalence class for something that is not a “must be” value

237 Identification of Test Cases
Handouts Test cases for each equivalence class can be identified by: Assign a unique number to each equivalence class For each equivalence class with valid input that has not been covered by test cases yet, write a new test case covering as many uncovered equivalence classes as possible For each equivalence class with invalid input that has not been covered by test cases, write a new test case that covers one and only one of the uncovered equivalence classes

238 Advantages of Equivalence Class Partitioning
Handouts A small number of test cases are needed to adequately cover a large input domain One gets a better idea about the input domain being covered with the selected test cases The probability of uncovering defects with the selected test cases based on equivalence class partitioning is higher than that with a randomly chosen test suite of the same size The equivalence class partitioning approach is not restricted to input conditions alone – the technique may also be used for output domains

239 Boundary Value Analysis (BVA)
Handouts The central idea in Boundary Value Analysis (BVA) is to select test data near the boundary of a data domain so that data both within and outside an equivalence class are selected The BVA technique is an extension and refinement of the equivalence class partitioning technique In the BVA technique, the boundary conditions for each of the equivalence class are analyzed in order generate test cases

240 Guidelines for Boundary Value Analysis
Handouts The equivalence class specifies a range If an equivalence class specifies a range of values, then construct test cases by considering the boundary points of the range and points just beyond the boundaries of the range The equivalence class specifies a number of values If an equivalence class specifies a number of values, then construct test cases for the minimum and the maximum value of the number In addition, select a value smaller than the minimum and a value larger than the maximum value. The equivalence class specifies an ordered set If the equivalence class specifies an ordered set, such as a linear list, table, or a sequential file, then focus attention on the first and last elements of the set.

241 Decision Tables Handouts The structure of a decision table has been shown in Table 9.13 It comprises a set of conditions (or, causes) and a set of effects (or, results) arranged in the form of a column on the left of the table In the second column, next to each condition, we have its possible values: Yes (Y), No (N), and Don’t Care (“-”) To the right of the “Values” column, we have a set of rules. For each combination of the three conditions {C1,C2,C3}, there exists a rule from the set {R1,R2, ..,R8} Each rule comprises a Yes (Y), No (N), or Don’t Care (“-”) response, and contains an associated list of effects {E1,E2,E3} For each relevant effect, an effect sequence number specifies the order in which the effect should be carried out, if the associated set of conditions are satisfied The “Checksum” is used for verification of the combinations, the decision table represent Each rule of a decision table represents a test case

242 Decision Tables Handouts

243 Decision Tables Handouts The steps in developing test cases using decision table technique: Step 1: The test designer needs to identify the conditions and the effects for each specification unit. A condition is a distinct input condition or an equivalence class of input conditions An effect is an output condition. Determine the logical relationship between the conditions and the effects Step 2: List all the conditions and effects in the form of a decision table. Write down the values the condition can take Step 3: Calculate the number of possible combinations. It is equal to the number of different values raised to the power of the number of conditions

244 Decision Tables Handouts Step 4: Fill the columns with all possible combinations – each column corresponds to one combination of values. For each row (condition) do the following: Determine the Repeating Factor (RF): divide the remaining number of combinations by the number of possible values for that condition Write RF times the first value, then RF times the next and so forth, until row is full Step 5: Reduce combinations (rules). Find indifferent combinations - place a “-” and join column where columns are identical. While doing this, ensure that effects are the same Step 6: Check covered combinations (rules). For each column calculate the combinations it represents. A “-” represents as many combinations as the condition has. Multiply for each “-” down the column. Add up total and compare with step 3. It should be the same Step 7: Add effects to the column of the decision table. Read column by column and determine the effects. If more than one effect can occur in a single combinations, then assign a sequence number to the effects, thereby specifying the order in which the effects should be performed. Check the consistency of the decision table Step 8: The columns in the decision table are transformed into test cases

245 Random Testing Handouts In the random testing approach, test inputs are selected randomly from the input domain of the system Random testing can be summarized as: Step 1 : The input domain is identified Step 2 : Test inputs are selected independently from the domain Step 3 : The system under test is executed on these inputs The inputs constitute a random test set Step 4 : The results are compared to the system specification. The test is a failure if any input leads to incorrect results Otherwise it is a success. Random testing gives us an advantage of easily estimating software reliability from test outcomes Test inputs are randomly generated according to an operational profile, and failure times are recorded The data obtained from random testing can then be used to estimate reliability

246 Random Testing Handouts Computing expected outcomes becomes difficult, if the inputs are randomly chosen Therefore, the technique requires good test oracles to ensure the adequate evaluation of test results A test oracle is a mechanism that verifies the correctness of program outputs An oracle provides a method to generate expected results for the test inputs, and compare the expected results with the actual results of execution of the Implementation Under Test (IUT) Four common types of oracles are as follows: Perfect oracle Gold standard oracle Parametric oracle Statistical oracle

247 Adaptive Random Testing
Handouts In adaptive random testing the test inputs are selected from the randomly generated set in such a way that these are evenly spread over the entire input domain The goal is to select a small number of test inputs to detect the first failure A number of random test inputs are generated, then the “best” one among them is selected We need to make sure the selected new test input should not be too close to any of the previously selected ones That is, try to distribute the selected test inputs as spaced out as possible

248 Error Guessing Handouts It is a test case design technique where a test engineer uses his experience to guess the types and probable locations of defects, and design tests specifically to reveal the defects Though experience is of much use in guessing errors, it is useful to add some structure to the technique It is good to prepare a list of types of errors that can be uncovered The error list can aid us in guessing where errors may occur. Such a list should be maintained from experience gained from earlier test projects

249 Category Partition Handouts The Category Partition Method (CPM) is a systematic, specification based methodology that uses an informal functional specification to produce formal test specification The test designer’s key job is to develop categories, which are defined to be the major characteristics of the input domain of the function under test Each category is partitioned into equivalence classes of inputs called choices The choices in each category must be disjoint, and together the choices in each category must cover the input domain

250 Category Partition The method comprise of the following steps:
Handouts The method comprise of the following steps: Step 1. Analyze the Specification Step 2. Identify Categories Step 3. Partition the Categories into Choices Step 4. Determine Constraints among Choices Step 5. Formalize and Evaluate the Test Specification Step 6. Generate and Validate the Test Cases

251 Handouts Software Testing and Quality Assurance Theory and Practice Chapter 10 Test Generation from FSM Models 251

252 Outline of the Chapter State-oriented Model
Handouts State-oriented Model Points of Control and Observation Finite-state Machine (FSM) Test Generation from an FSM Transition Tour Method Testing with State Verification Unique Input/Output Sequence Distinguishing Sequence Characterizing Sequence Test Architectures Testing and Test Control Notation 3 (TTCN-3) Extended Finite-state Machines Test Generation from EFSM Models Additional Coverage Criteria for System Testing Summary

253 State-oriented Model Software systems State-oriented system: two parts
Handouts Software systems State-oriented (Examples: Operating Systems) Stateless (Example: compiler) State-oriented system: two parts Control portion Data portion Figure 10.1: Spectrum of software systems.

254 State-oriented Model Handouts The control portion of a system is often modeled as an FSM. Figure 10.4: FSM model of a dual-boot laptop computer. Figure 10.5: The interactions between a system and its environment are modeled as an FSM.

255 Points of Control and Observation
Handouts Points of Control and Observation A PCO is a point of interaction between a system and it users. Figure 10.6: PCOs on a telephone Table 10.1: PCOs for testing a telephone PBX. PCO IN/OUT Hook IN Keypad Ringer OUT Speaker Mouthpiece

256 Points of Control and Observation
Handouts Figure 5.7: FSM model of a private branch exchange (PBX)

257 Finite-state Machine (FSM)
Handouts A finite-state machine M = <S, I, O, s0, δ, λ>, where S is a set of states. I is a set of inputs. O is a set of outputs. s0 is the initial state. δ: S x I  S (next state function) λ: S x I  O (output function) Figure 10.8: FSM model of a private branch exchange (PBX).

258 Test Generation from an FSM
Handouts Let M be the FSM model of a system and IM be its implementation. An important testing task is to confirm if IM behaves like M. Conformance testing: Ensure by means of testing that IM conforms to its spec. M. A general procedure for conformance testing Derive sequences of state-transitions from M. Turn each state-transition into a test sequence. Test IM with a test sequence to observe whether or not IM possesses the corresponding transition sequence. The conformance of IM with M can be verified by choosing enough state- transition sequences.

259 Transition Tour (TT) Method
Handouts TT: It is a sequence of state-transitions from the initial state to the final state. Example: From Figure 10.8 <OH, LP:OFH, LP:DT,AD>, <AD, LP:ONH, LP: -, OH> Figure 10.9: Interaction of a test sequence with an SUT. Ideas in turning a TT into a test case. The input/output in a test case are derives from a TT. Unexpected inputs must be processed. Indefinite waits must be avoided. Figure 10.10: Derived test case from the transition tour.

260 Transition Tour (TT) Method
Handouts Coverage metrics for FSM based testing State coverage Choose enough number of TTs to be able to cover each state at least once. You can choose 3 TTs to cover all the states, but just 11 of the transitions. Transition coverage Choose enough number of TTs to be able to cover each state-transition at least once.

261 Testing with State Verification
Handouts Two functions associated with a state- transition Output function: Easy to verify in the TT method. Next-state function: Ignored in the TT method (drawback of the TT method). Figure 10.11: Conceptual model of a test case with state verification. State verification with Unique Input/Output (UIO) sequences Distinguishing sequences Characterizing sequences

262 Unique Input/Output Sequence
Handouts Let X be an input sequence applied in a state s, and Y be the corresponding output sequence. X/Y is a UIO sequence for s if no other state produces output sequence Y in response to input X. Thus, X/Y is unique to s. Four assumptions about an FSM Completely specified Deterministic Reduced Strongly connected

263 Unique Input/Output Sequence
Handouts Figure 10.12: Finite-state machine G1. Table 10.7: UIO sequences of minimal lengths obtained from Figure Figure 10.14: Identification of UIO sequences on the UIO tree of Figure (Fig is similar to Fig ).

264 Distinguishing Sequence
Handouts Let X be an input sequence. X is a distinguishing sequence for an FSM, if each state produces a unique (i.e. different) output sequence in response to X. Four assumptions about an FSM Completely specified Deterministic Reduced Strongly connected

265 Distinguishing Sequence
Handouts Figure 10.15: Finite-state machine G2. Figure 10.16: Distinguishing sequence tree for G2 in Figure Table 10.9: Output of FSM G2 in response to input sequence 11 in different states.

266 Characterizing Sequence
Handouts Some FSMs do not have a D-sequence. State verification is still possible. Use characterizing sets. Characterizing Sets (CS) A CS for a state s is a set of input sequences such that, when each sequence is applied to the FSM in s, the set of output sequences is unique. Thus s is uniquely identified. Figure 10.17: An FSM that does not possess a distinguishing sequence. Figure 10.18: DS-tree for FSM (Figure 10.17).

267 Characterizing Sequence
Handouts Figure 10.10: Output sequences generated by the FSM of Figure as a response to W1. Figure 10.11: Output sequences generated by the FSM of Figure as a response to W2.

268 Characterizing Sequence
Handouts Figure 10.12: Test sequences for the state transition (D, A, a/x) of the FSM in Fig

269 Test Architectures A test architecture is a certain configuration of
Handouts A test architecture is a certain configuration of an Implementation Under Test (IUT) one or more test entities, one or two PCOs, and a communication service provide. Common test architectures Local Architecture Distributed Architecture Coordinated Architecture Remote Architecture Figure 10.19: Abstraction of an (N)-Entity in the OSI reference architecture

270 Test Architectures Local Architecture
Handouts Local Architecture Figure 10.22: Local architecture. Distributed Architecture Figure 10.23: Distributed architecture.

271 Test Architectures Coordinated Architecture
Handouts Coordinated Architecture Figure 10.24: Coordinated architecture. Remote Architecture Figure 10.25: Remote architecture.

272 Testing and Test Control Notation 3 (TTCN-3)
Handouts TTCN-3 A language for specifying test cases. Predecessors were TTCN-1 and TTCN-2 (Tree and Tabular Combined Notation) Standardized by ETSI (European Telecom. Standards Institute) Core features of TTCN-3 Module Data types Templates Ports Components Test Cases

273 Testing and Test Control Notation 3 (TTCN-3)
Handouts Module Figure 10.26: The structure of a module in TTCN-3.

274 Testing and Test Control Notation 3 (TTCN-3)
Handouts Types, subtypes, and messages Figure 10.27: Definitions of two subtypes. Figure 10.28: A parameterized template for constructing a message to be sent. Figure 10.29: A parameterized template for constructing a message to be sent.

275 Testing and Test Control Notation 3 (TTCN-3)
Handouts Ports Figure 10.30: Testing an application called SFC calculator (a) and a port between the tester and the SFC calculator (b).

276 Testing and Test Control Notation 3 (TTCN-3)
Handouts Ports and components Figure 10.31: Defining a port type. Figure 10.32: Associating a port with a component.

277 Testing and Test Control Notation 3 (TTCN-3)
Handouts Ports and components Figure 10.33: A test case for testing the square root function calculator.

278 Testing and Test Control Notation 3 (TTCN-3)
Handouts Test case execution Figure 10.34: Executing a test case.

279 Extended Finite-state Machines
Handouts Two conceptual components of a software system are Flow of control Manipulation of data Manipulate local variables. Start and stop timers. Create instances of processes. Compare values and make control-flow decisions. Access databases. There is a need for modeling a software system as an EFSM. We consider the Specification and Description Languages (SDL). The basic concepts in SDL are as follows: System Behavior Data Communication

280 Extended Finite-state Machines
Handouts Figure 10.35: Comparison of state-transitions of an FSM and an EFSM.

281 Test Generation from EFSM Models
Handouts Let E be an EFSM and PE be a program implementing E. Goal: Test that PE behaves as E. Basic idea Phase 1: Identify a set of state-transition sequences such that each sequence of state-transitions represents a common use sequence. Phase 2: Design a test case from each state-transition sequence. Phase 1 Pay attention to the following. Perform tests to ensure that the system under test (SUT) produces expected sequences of outcomes in response to input sequences. Perform tests to ensure that the system under test takes the right actions when a timeout occurs. Perform tests to ensure that the system under test has appropriately implemented other task blocks, such as resource allocation, database accesses, etc. Coverage criteria: state coverage and transition coverage.

282 Test Generation from EFSM Models
Handouts Phase 2 Transform the inputs and outputs in a transition tour into outputs and inputs, respectively. Augment the above core test behavior with “otherwise” events to be able to handle exception events. Augment the above test behavior with timers.

283 Test Generation from EFSM Models
Handouts Figure 10.36: Controlled access to a door.

284 Test Generation from EFSM Models
Handouts Figure 10.37: SDL/GR door control system.

285 Test Generation from EFSM Models
Handouts Figure 10.38: Door control behavior specification (1 of 2). Figure 10.39: Door control behavior specification (2 of 2).

286 Test Generation from EFSM Models
Handouts GETDIGIT  … GETDIGIT  … GETDIGIT  … DOOROPEN  GETDIGIT. Figure 10.40: A transition tour from the door control system of Figs and Figure 10.41: Testing the door control system.

287 Test Generation from EFSM Models
Handouts Figure 10.42: Output and input behavior obtained from the transition tour of Fig

288 Test Generation from EFSM Models
Handouts Figure 10.43: Test behavior obtained by refining the “if” part in Fig

289 Test Generation from EFSM Models
Handouts Figure 10.44: Test behavior that can receive unexpected events. This is derived from Fig

290 Test Generation from EFSM Models
Handouts Figure 10.45: The core behavior (partial) of a test case for testing the door control system. This is derived from Fig (See the book for the complete test case.)

291 Additional Coverage Criteria for System Testing
Handouts PCO coverage Select test cases such that the SUT receives an event at each input PCO and produces an event at each output PCO. Sequence of events at PCOs Select test cases such that common sequences of inputs and outputs occur at the PCOs. Events occurring in different contexts An event generated at a PCO may have different meanings at different times. Inopportune events Inopportune events are normal events which occur at an inappropriate time.

292 Summary Software systems Testing FSM based systems
Handouts Software systems Stateless State-oriented Control portion is modeled by an FSM or an EFSM. Testing FSM based systems Transition tour method State verification method State verification techniques Distinguishing sequence UIO sequence Characterizing sequence Coverage metrics State coverage State-transition coverage Test architectures Local Distributes Coordinated Remote TTCN-3 Data types Modules Ports Templates Testing EFSM based systems Identify transition sequences Turn each sequence into a test case Input/output  Output/input “Otherwise” events Timers Coverage metrics PCO coverage Sequences of events at each PCO Events occurring in different contexts Inopportune events

293 Handouts Software Testing and Quality Assurance Theory and Practice Chapter 11 System Test Design 293

294 Outline of the Chapter Test Design Factors Requirement Identification
Handouts Test Design Factors Requirement Identification Test Objective Identification Modeling a Test Design Process Modeling Test Results Test Design Preparedness Metrics Test Case Design Effectiveness

295 Test Design Factors Handouts The following factors must be taken into consideration during the design of system tests Coverage metrics Effectiveness Productivity Validation Maintenance User skills

296 Requirement Identification
Handouts Statistical analysis conducted by Vinter reveals that out 1000 defects: 23.9 % requirement issues 24.3 % functionality 20.9% component structure 9.6 % data 4.3 % implementation 5.2 % integration 0.9 % architecture 6.9 % testing 4.3 % others

297 Requirement Identification
Handouts Requirements are a description of the needs or desire of users that a system suppose to implement Two major challenges in defining requirements: Ensure that the right requirements are captured which is essential for meeting the expectations of the users Ensure that requirements are communicated unambiguously to the developers and testers so that no surprise when the system is delivered Essential to have an unambiguous representation of the requirements The requirements must be available in a centralized place so that all the stakeholders have the same interpretation of the requirements A stakeholder is a person or an organization who influences a system’s behavior or who is impacted by the system

298 Requirement Identification
Handouts The state diagram of a simplified requirement life-cycle starting from Submit state to the Closed state is shown in Figure 11.1and the schema in Table 11.1 At each of these states certain actions are taken by the owner, and the requirement is moved to the next state after the actions are completed A requirement may be moved to Decline state from any of the following state: Open, Review, Assign, Implement, and Verification for several reasons A marketing manager may decide that the implementation of a particular requirement may not generate revenue and may decline a requirement. Figure 11.1: State transition diagram of a requirement

299 Requirement Identification
Handouts Table 11.1: Requirement schema field summary

300 Requirement Identification
Handouts Definition of requirements traceability: The requirements traceability is the ability to describe and follow the life of a requirement, in both forward and backward direction, i.e., from its origins, through its development and specification, to its subsequent deployment and use, and through periods of ongoing refinement and iteration in any of these phase

301 Requirement Identification
Handouts One can generate traceability matrix from the requirement life-cycle system, which gives them confidence about test coverage A traceability matrix allows one to find a two-way mapping between requirements and test cases as follows From a requirement to a functional specification to specific tests which exercise the requirements From each test case back to the requirement and functional specifications A traceability matrix finds two applications: To identify and track the functional coverage of a test To identify which test cases must be exercised or updated when a system evolves

302 Characteristics of Testable Requirements
Handouts One way to determine the requirement description is testable is as follows: Take the requirement description “The system must perform X.” Encapsulate the requirement description to create a test objective: “Verify that the system performs X correctly.” Review this test objective and find out if it is possible to execute it assuming that the system and the test environment are available If the answer to the above question is yes, then the requirement description is clear and detailed for testing purpose Otherwise, more work needs to be done to revise or supplement the requirement description

303 Characteristics of Testable Requirements
Handouts The following items must be analyzed during the review of requirements: Safety Security Completeness Correctness Consistency Clarity Relevance Feasibility Verifiable Traceable

304 Characteristics of Testable Requirements
Handouts A functional specification provides a precise description of the major functions the system must fulfill the requirements explanation of the technological risks involved external interfaces with other software modules data flow such as flowcharts, transaction sequence diagrams, and finite-state machines describing the sequence of activities fault handling, memory utilization and performance estimates any engineering limitation

305 Characteristics of Testable Requirements
Handouts The following are the objectives that are kept in mind while reviewing a functional specification: Achieving requirements Correctness Extensible Comprehensive Necessity Implementable Efficient Simplicity Consistency with existing components Limitations

306 Characteristics of Testable Requirements
Handouts Table 11.4: Characteristics of testable functional specification.

307 Test Objective Identification
Handouts The question “What do I test?” must be answered with another question: “What do I expect the system to do?” The first step in identifying the test objective is to read, understand, and analyze the functional specification It is essential to have a background familiarity with the subject area, the goals of the system, business processes, and system users, for a successful analysis One must critically analyze requirements to extract the inferred requirements that are embedded in the requirements An inferred requirement is one that a system is expected to support, but not explicitly stated Inferred requirements need to be tested just like the explicitly stated requirements

308 Test Objective Identification
Handouts The test objectives are put together to form a test group or a subgroup after they have been identified A set of (sub) groups of test cases are logically combined to form a larger group A hierarchical structure of test groups as shown in Figure 11.2 is called a test suite It is necessary to identify the test groups based on test categories, and refine the test groups into sets of test objectives Individual test cases are created for each test objective within the subgroups Test groups may be nested to an arbitrary depth The test grouping may be used to aid system test planning and execution that are discussed in Chapters 12 and 13, respectively

309 Test Objective Identification
Handouts Figure 11.2: Test Suite Structure

310 Modeling a Test Design Process
Handouts One test case is created for each test objective Each test case is designed as a combination of modular components called test steps Test cases are clearly specified so that testers can quickly understand, borrow, and re-use the test cases Figure 11.6 illustrate the life-cycle model of a test case in the form of a state transition diagram One can easily implement a database of test cases using the test cases schema shown in Table 11.6 Figure 11.6: State-transition diagram of a test case.

311 Modeling a Test Design Process
Handouts Table 11.6: Test case schema summary.

312 Modeling Test Results Handouts A test suite schema shown in Table 11.7 can be used for testing a particular release The schema requires a test suite id, a title, an objective and a list of test cases to be managed by the test suite The idea is to gather a selected number of released test cases and repackage them to form a test suite for a new project The results of executing those test cases are recorded in a database for gathering and analyzing test metrics The result of test execution is modeled by using a state-transition diagram as shown in Figure 11.7 The corresponding schema is given in Table 11.8

313 Modeling Test Results Handouts Table 11.7: Test suite field summary.

314 Modeling Test Results Handouts Table 11.8: Test result schema summary.

315 Modeling Test Results Handouts Figure 11.7: State transition diagram of a test case results

316 Test Design Preparedness Metrics
Handouts Metrics are tracked To know if a test project is progressing according to schedule Plan the next project more accurately The following metrics are monitored Preparation status of test cases (PST) Average time spent (ATS) in test case design Number of available test (NAT) cases Number of planned test (NPT) cases Coverage of a test suite (CTS)

317 Test Case Design Effectiveness
Handouts The objective of the test design effectiveness metric is to Measure the defect revealing ability of the test suite Use the metric to improve the test design process A metric commonly used in the industry to measure test case design effectiveness is the Test Case Design Yield (TCDY) TCE stand for Test Case Escaped During testing new defects are found for which no test cases had been planned For these new defects, new test cases are designed, which is known as Test Case Escaped metric

318 Handouts Software Testing and Quality Assurance Theory and Practice Chapter 12 System Test Planning and Automation 318

319 Outline of the Chapter Structure of a System Test Plan
Handouts Structure of a System Test Plan Introduction and Feature Description Assumptions Test Approach Test Suite Structure Test Environment Test Execution Strategy A Multi-Cycle System Test Strategy Characterization of Test Cycles Preparing for the First Test Cycle Selecting Test Cases for the Final Test Cycle Prioritization of Test Cases Details of Three Test Cycles Test Effort Estimation Function Points Computation of Function Point Test Case Creation Effort Test Case Execution Effort Scheduling and Milestones Gantt Chart System Test Automation Evaluation and Selection of Test Tools Test Selection Guidelines for Automation Characteristics of Automation Test Cases Structure of an Automation Test Case Test Automation Infrastructure

320 Structure of a System Test Plan
Handouts The purpose of a system test plan is as follows: It provides guidance for the executive management to support the test project It establishes the foundation of the system testing part of the overall software project It provides assurance of test coverage by creating a requirement traceability matrix It outlines an orderly schedule of events and test milestones that are tracked It specifies the personnel, financial, equipment, and facility resources required to support the system testing part of a software project

321 Structure of a System Test Plan
Handouts

322 Introduction and Feature Description
Handouts The introduction section of the system test plan includes: Test project name Revision history Terminology and definitions Name of the approvers and the date of approval References Summary of the rest of the test plan The feature description section summarizes the high level description of the functionalities of the system

323 Assumptions Handouts The assumptions section describes the areas for which test cases will not be designed The necessary equipments to carry out scalability testing may not be available It may not be possible to procure third-party equipments in time to conduct interoperability testing It may not be possible to conduct compliance test for regulatory bodies and environment tests in the laboratory

324 Test Approach Handouts The test approach section describes the following aspect of the testing project Issues discovered by customers that were not caught during system testing in the past project are discussed and the preventive action that are being taken in this test project If there are any outstanding issues that need to be tested differently need to be discussed here A test automation strategy for writing scripts is a topic of discussion Identify test cases from the database that can be re-used in this test plan Give an outline of the tools, formats, and organizing scheme, such as traceability matrix that will be used and folloed during the test project Finally, the first level of test categories as discussed in Chapter 8 are identified

325 Test Suite Structure Handouts Detail test groups and subgroups are outlined based on the test categories identified in the test approach section Test objectives are created for each test group and subgroups based on the system requirements and functional specification documents Identification of test objectives provides a clue to the total number of test cases needs to be developed A traceability matrix is generated to make an association between requirements and test objectives to provide the test coverage

326 Test Environment Handouts Multiple test environments are constructed in practice To run scalability tests one need more resources than to run functionality tests To reduce the length of testing time A schematic diagram of one or more test beds are presented in this section of the system test plan A high-level graphic layout of the test architectures A table of types of equipments, their quantities, and their descriptions to support the test architecture

327 Test Execution Strategy
Handouts The processes of system test execution, defect detection, and fixing defects are intricately intertwined The key characteristics of those processes are as follows. Some test cases cannot be executed unless certain defects are detected and fixed A programmer may introduce new defects while fixing one defect, which may not be successful The development team releases a new build for system testing by working on a subset of the reported defects, rather than all the defects It is a waste of resources to run the entire test set T on a build if too many test cases fail The following concerns must be addressed before the start of system testing: How many times are the test cases executed and when? What does one do with the failed test cases? What happens when too many test cases fail? In what order are the test cases executed? Which test cases are to be run just before ending the system testing phase?

328 A Multi-Cycle System Test Strategy
Handouts Figure 12.1: The concept of a cycle-based test execution strategy

329 Characterization of Test Cycles
Handouts Each test cycle is characterized by a set of six parameters: Goals Assumptions Test execution Revert and Extension criteria Actions Exit criteria

330 Characterization of Test Cycles
Handouts Goals System test team sets its own goals to be achieved in each test cycle These goals are ideal in the sense these are very high standard Goals are specified in terms of the number of test cases to pass in a cycle Assumptions How often the builds will be selected during in a system test cycle? For example “the team can accept builds from SIT group on a daily basis during a test cycle” Test Execution Prioritization of test execution changes between test cycles Test cases that exercise basic functionalities have higher priority than the rest in the first test cycle Test cases that have failed in one test cycle have a higher priority in the following test cycle Test cases in certain groups have higher priority than others

331 Characterization of Test Cycles
Handouts Revert and Extension criteria It may not be useful to continue a test cycle if it is found that a software is of poor quality Often a test cycle is extended due to various reasons A need to re-execute all the test cases in a particular test group because a large fraction of the test cases within the group failed A significantly large number of new test cases were added while test execution was in progress The conditions for prematurely terminating a test cycle and for extending a test cycle must be precisely stated

332 Characterization of Test Cycles
Handouts Actions Too many test cases may fail during a test cycle The development team is alerted The developers take action in the form of root cause analysis (RCA) Corrective actions are taken by updating the design specification, reviewing the code, and adding new test cases to the unit and integration test plan The system test team has to design a large number of new test cases during a test cycle The system test team initiates a root cause analysis (RCA) The team studies the new test cases and categories them into different groups based on the functional requirements The relevant requirements are studied to understand why the test team was unable to identify the objectives of these new test cases in the first place

333 Characterization of Test Cycles
Handouts Exit Criteria An exit criterion specifies the termination of a test cycle One may exit a test cycle even if goals for that particular test cycle are not fully achieved The exit criteria are defined based on few quality metrics associated with the test cycle These quality metrics must be monitored during the test cycle Example of exit criteria 95% of test cases passed and all the known defects are in CLOSED state

334 Preparing for the First Test Cycle
Handouts Life-cycle of a Defect The life-cycle of a defect is represented by a state-transition diagram with five states: NEW, ASSIGNED, OPEN, RESOLVED, and CLOSED The detail model of a defect life-cycle is discussed in Chapter 13. Assignment of test Cases Since no single engineer is going to execute all the test cases all by themselves it is desirable to assign test cases to appropriate test engineers by considering their expertise and interest Assignment of test cases to test engineers may be changed from test cycle to test cycle Entry Criteria for the First Test Cycle The entry criteria for the first test cycle, given in Table 12.3 It tell us when we should start executing system tests It consists of five groups which depend on five cross-functional groups: marketing, hardware, software, technical publication, and system testing

335 Preparing for the First Test Cycle
Handouts Table 12.3: Entry criteria for the first system test cycle

336 Selecting Test Cases for the Final Test Cycle
Handouts Test cases are selected in three steps Step 1: The test suite is partitioned into red, yellow, green and white bins as follows: Red: The red bin holds the following kinds of test cases that must be executed: Test cases that failed at least once in the previous test cycles. Test cases from those test groups for which root-cause analysis was conducted by the development team in the previous test cycles. Test cases from the stress, scalability, and load and stability test groups Test cases from the performance test category Yellow: The yellow bin holds the test cases that are useful to execute. This bin includes those test cases whose objectives are similar to the objectives of the test cases in the red bin Green: The green bin holds the test cases that will not add any value to regression testing, and, thus can be skipped White: The test cases for which no concrete decision can be made in the first step are put in the white bin. This includes the rest of the test cases not falling in the red, yellow, or green bin

337 Selecting Test Cases for the Final Test Cycle
Handouts Step 2: In this step, test cases from the white bin are moved to the other bins The software developers identify all the software components that have been modified after the start of the first test cycle. Each test case from the white bin is mapped to the identified software components. This mapping is done by analyzing the objective of the test case and then checking whether the modified code of the identified software components is exercised by executing the test cases The test cases that are mapped to more than one, one, or zero software components are moved to the red, yellow, or green bin, respectively. Step 3: In this step, test cases from the red and yellow bins are actually selected for regression testing as follows: All the test cases from the red bin are selected for the final test cycle Depending on the schedule, time-to-market, and customers demand, test cases from the yellow bin are selected for the final test cycle

338 Prioritization of Test Cases
Handouts Prioritization of test cases means ordering the execution of test cases according to certain test objectives Formulating test objectives for prioritization of individual test cases is an extremely difficult task In system testing test cases are prioritize in terms of groups with common properties In a multi-cycle based test execution strategy, test cases are prioritized in a group in each test cycles for three reasons: initially the quality level of the system under test is not very high the quality of the system keeps improving from test cycle to test cycle a variety of defects are detected as testing progresses

339 Prioritization of Test Cases
Handouts Test Prioritization in Test Cycle 1 Principle: Prioritize the test cases to allow the maximum number of test cases to completely execute without being blocked. Each engineer prioritizes the execution of their subset of test cases as follows: A high priority is assigned to the test cases in the basic and functionality test groups. A medium priority is assigned to the robustness and inter-operability test groups. A low priority is assigned to the test cases in the following groups: documentation, performance, stress, scalability, and load and stability tests.

340 Prioritization of Test Cases
Handouts Test Prioritization in Test Cycle 2 Principle: Test cases which failed in the previous test cycle are executed early in the test cycle Each test engineer prioritizes the execution of test cases in their subset as follows: A high priority is assigned to the test cases in the red bin A medium priority is assigned to the test cases in the yellow bin A low priority is assigned to the test cases in the green bin Test Prioritization in Test Cycle 3 Principle: Test prioritization is similar to that in the second test cycle, but it is applied to a selected subset of the test cases chosen for regression testing. Each test engineer prioritizes the execution of test cases in their assigned subset as follows: A low priority is assigned to the test cases in the yellow bin

341 Details of Three Test Cycles
Handouts Test Cycle 1 Goals: To maximize the number of passed test cases (98%) Assumptions: Test groups accepts a s/w image one every week for the first four weeks and one every weeks afterwards Test Execution: Test cases are executed according the prioritization discussed earlier Revert and Extension criteria: If the number of failed test cases reaches 20% of the total number of test cases to be executed the system test team abandons this test cycle If more than two unique crashes are observed during the test cycle, the system test team runs regression tests after the crash defects are fixed. If the number of failed test cases for any group of test cases reaches 20% of the number of test cases in the group during the test cycle, the test team re-execute all the test cases in that group in the test cycle after the defects are fixed

342 Details of Three Test Cycles
Handouts Test Cycle 1(Cont’d) Actions: The software development group initiates a root cause analysis (RCA) during the test cycle if the total number of failed test cases reaches some pre-set values as shown in Table 12.4 (b) The system test group initiates an RCA if the number of new test cases increases by 10% of the total number of test cases designed before the test cycle was started Exit Criteria: The test cycle is considered to have completed when the following predicates hold: (i) new test cases are designed and documented for those defects that were not detected by the existing test case - those are referred to as test case escapes, (ii) all test cases are executed at least once, (iii) 95% of test cases passed, and (iv) all the known defects are in CLOSED state

343 Details of Three Test Cycles
Handouts Test Cycle 2 Goals: To maximize the number of passed test cases (99%) Assumptions: Test groups accepts a s/w image one every two weeks Test Execution: Test cases are executed according the prioritization discussed earlier Revert and Extension criteria: If the number of failed test cases reaches 10% of the total number of test cases to be executed the system test team abandons this test cycle If more than one unique crashes are observed during the test cycle, the system test team runs regression tests after the crash defects are fixed. If the number of failed test cases for any group of test cases reaches 10% of the number of test cases in the group during the test cycle, the test team re-execute all the test cases in that group in the test cycle after the defects are fixed

344 Details of Three Test Cycles
Handouts Test Cycle 2(Cont’d) Actions: The software development group initiates a root cause analysis (RCA) during the test cycle if the total number of failed test cases reaches some pre-set values as shown in Table 12.5 (b) The system test group initiates an RCA if the number of new test cases increases by 5% of the total number of test cases designed before the test cycle was started Exit Criteria: The test cycle is considered to have completed when the following predicates hold: (i) new test cases are designed and documented for those defects that were not detected by the existing test case, (ii) all test cases are executed at least once, (iii) 98% of test cases passed, and (iv) all the known defects are in CLOSED state

345 Details of Three Test Cycles
Handouts Test Cycle 3 Goals: A selected subset of test cases from the test suite shall be re- executed. The process of selecting test cases for this test cycle has been explained earlier. 100% of the selected test cases should pass. Assumptions: Test groups accepts just one s/w image at the beginning of the test cycle Test Execution: Test cases are executed according the prioritization discussed earlier Revert and Extension criteria: If the number of failed test cases reaches 5% of the total number of test cases to be executed the system test team abandons this test cycle Testing is stopped if a single crash is observed The test cycle can be terminated and restarted again, but not extended

346 Details of Three Test Cycles
Handouts Test Cycle 3(Cont’d) Actions: N/A Exit Criteria: The final test cycle is considered to have completed if all of these predicates hold: All the selected test cases are executed The results of all the tests are available 98% of test cases passed The 2% failed test cases should not be from stress, performance, scalability, and load and stability test groups The system does not crash in the final three weeks of testing The test report is completed and approved

347 Test Effort Estimation
Handouts Two major components: The number of test cases created by one person in one day The number of test case executed by one person in one day

348 Test Effort Estimation
Handouts Estimation of Number of test cases Estimation of Number of Test Cases Based on Test Group Category It is straightforward to estimate the number of test cases after the test suite structure and the test objectives are created simply count the number of test objectives Estimation of Number of Test Cases Based on Function Points Total number of test cases = (Function Points)1.2

349 Function Points Handouts The central idea in the function point method is as follows: Given a functional view of a system, in the form of the number of user inputs, the number of user outputs, the number of user on-line queries, the number of logical files, and the number of external interfaces, one can estimate the project size in number of lines of code required to implement the system and the number of test cases required to test the system The function point of a system is a weighted sum of the numbers of inputs, outputs, master files inquiries produced to, or generated by, the software

350 Computation of Function Point
Handouts Step 1: Identify the following five types of components, also known as “user function types,” in a software system Number of external input types (NI) Number of external output types (NO) Number of external inquiry types (NQ) Number of logical internal file types (NF) Number of external interface file types (NE)

351 Computation of Function Point
Handouts Step 2: Analyze the complexity of each of the above five types of user function and classify those to three levels of complexities, namely simple, average, or complex Compute the unadjusted function point (UFP) by using the form shown in Table 12.7 UFP = WFNI × NI + WFNO × NO + WFNQ × NQ + WFNL × NL + WFNE × NE

352 Computation of Function Point
Handouts Step 3: Identify 14 factors that affect the required development effort for a project. A grade – between 0 and 5 – is assigned to each of the 14 factors for a certain project. The sum of these 14 grades is known as processing complexity adjustment (PCA) factor. The 14 factors have been listed in Table 12.8 In Table 12.8, the degree of influence of a factor on development effort is measured as follows: Not present, or no influence if present = 0 Insignificant influence = 1 Moderate influence = 2 Average influence = 3 Significant influence = 4 Strong influence = 5

353 Computation of Function Point
Handouts

354 Computation of Function Point
Handouts Step 4: Compute the function points (FP) of a system using the following empirical expression: FP = UFP × ( × PCA) By multiplying the unadjusted function point, denoted by UFP, by the expression ( × PCA), we get an opportunity to adjust the function point by +/- 35 percent. Let us analyze the two extreme values of PCA, namely 0 and 70 (= 14 × 5). PCA = 0 : FP = 0.65 × UFP PCA = 70 : FP = UFP × ( × 70) = 1.35 × UFP The value of FP can range from 0.65 × UFP to 1.35 × UFP The value of FP is adjusted within a range of +/- 35 percent by using intermediate values of PCA.

355 Test Effort Estimation
Handouts Test Case Creation Effort The productivity of the manual test case creation is summarized in Table 12.10

356 Test Case Execution Effort
Handouts

357 Scheduling and Test Milestones
Handouts It is essential to understand and consider the following steps in order to schedule a test project effectively: Develop a detailed list of tasks List up all the major milestones needed to be achieved during the test project Identify the interdependencies among the test tasks and any software milestones that may influence the flow of work Identify the different kinds of resources and expertise needed to fulfill each task on the list Estimate the quantity of resources needed for each task Identify the types and quantities of resources available for this testing project Assume that the rest of the resources will be available by certain dates Allocate the resources to each task

358 Scheduling and Test Milestones
Handouts Steps in order to schedule a test project effectively (Cont’d): Schedule the start and end dates of each task At this point insert rest of the milestones into the overall schedule Determine the earliest and the latest possible start date and end date for each task by taking into account any inter-dependency between tasks identified earlier Review the schedule for reasonableness of the assumptions Identify the conditions required to be satisfied for the schedule Document the assumptions Review the schedule with the test team and get their feedback

359 Gantt Chart Handouts A Gantt chart is often used to represent a project schedule Gantt chart graphically displays the start and end points of each task, the total duration needed to complete each task As the project progresses, it displays the percentage of completion of each task It allows the planner to assess the duration of a project, identify the resources needed, and lay out the order in which tasks need to be carried out It is widely used for project planning and scheduling in order to: Assess the time characteristics of a project Show the task order Show the link between scheduled tasks Define resources involved Monitor project completion

360 System Test Automation
Handouts Benefits of system test automation Test engineer productivity Coverage of regression testing Re-usability of test cases Consistency in testing Test interval reduction Reduces software maintenance cost Increased test effectiveness Pre-requisites for test automation The system is stable and its functionalities are well defined The test cases to be automated are unambiguous The test tools and infrastructure are in place The test engineers have prior successful experience with automation Adequate budget should have been allocated for the procurement of tools

361 Evaluation and Selection of Test Tools
Handouts Figure 12.3: Broad criteria of test automation tool evaluation

362 Test Selection Guidelines for Automation
Handouts Figure 12.4: Test selection guideline for test automation

363 Characteristics of Automation Test Cases
Handouts Figure 12.5: Characteristics of automated test cases

364 Structure of an Automation Test Case
Handouts Figure 12.6: Six major steps in an automated test case

365 Test Automation Infrastructure
Handouts Figure 12.7: Components of an automation infrastructure

366 Handouts Software Testing and Quality Assurance Theory and Practice Chapter 13 System Test Execution 366

367 Outline of the Chapter Modeling Defects
Handouts Modeling Defects Preparedness to Start System Testing Metrics for Tracking System Test Metrics for Monitoring Test execution Metrics for Monitoring Defect Reports Orthogonal Defect Classification Defect Causal Analysis Beta Testing First Customer Shipment System Test Report Product Sustaining Measuring Test Effectiveness Fault Seeding Spoilage Metric

368 Modeling Defects Handouts A life-cycle model in the form of a state-transition diagram as shown in Figure 13.1. The different states are briefly explained in Table 13.1 Two key concepts involved in modeling defects are the levels of priority and severity A priority level is a measure of how soon the defect needs to be fixed, i.e., urgency. Critical (1), High (2), Medium (3), and Low(4) A severity level is a measure of the extent of the detrimental effect of the defect on the operation of the product Critical (1), High (2), Medium (3), and Low (4) The defect schema is given in Table 13.2

369 Modeling Defects Handouts Figure 13.1: State-transition diagram representation of the life-cycle of a defect

370 Modeling Defects Table 13.1: State of a defect modeled in Figure 13.1
Handouts Table 13.1: State of a defect modeled in Figure 13.1

371 Modeling Defects Handouts Table 13.2: Defect schema summary fields

372 Preparedness to Start System Testing
Handouts The last item of the entry criteria namely test execution working document is in place and complete in Chapter 12, before the start of the system test A framework of such document is outlined in Table 13.4

373 Metrics for Tracking System Test
Handouts We categorized execution metrics into two classes: Metrics for monitoring test execution Metrics for monitoring defects

374 Metrics for Monitoring Test Execution
Handouts Test case Escapes (TCE) A significant increase in the number of test case escapes implies that deficiencies in the test design Planned versus Actual Execution (PAE) Rate Compare the actual number of of test cases executed every week with the planned number of test cases Execution Status of Test (EST) Cases Periodically monitor the number of test cases lying in different states Failed, Passed, Blocked, Invalid and Untested Useful to further subdivide those numbers by test categories

375 Metrics for Monitoring Defect Reports
Handouts Function as Designed (FAD) Count Irreproducible Defects (IRD) Count Defects Arrival Rate (DAR) Count Defects Rejected Rate (DRR) Count Defects Closed Rate (DCR) Count Outstanding Defects (OD) Count Crash Defects (CD) Count Arrival and Resolution of Defects (ARD) Count

376 Orthogonal Defect Classification
Handouts Orthogonal Defect Classification (ODC) is a methodology for rapid capturing of the semantics of each software defect. The classification of defects occurs at two different points in time during the life-cycle of a defect In the NEW state, the submitter needs to fill out the following ODC attributes or fields: Activity: This is the actual activity that was being performed at the time the defect was discovered Trigger: The environment or condition that had to exist for the defect to surface Impact: This refers to the effect, the defect would have on the customer, if the defect had escaped to the field.

377 Orthogonal Defect Classification
Handouts The owner needs to fill out the following ODC attributes or fields when the defect is moved to RESOLVED state: Target: The target represents the high-level identity, such as design, code, or documentation, of the entity that was fixed Defect type: The defect type represents the actual correction that was made Qualifier: The qualifier specifies whether the fix was made due to missing, incorrect, or extraneous code Source: The source indicates whether the defect was found in code developed in house, reused from a library, ported from one platform to another, or provided by a vendor Age: The history of the design or code that had the problem. The age specifies whether the defect was found in new, old (base), rewritten, or refixed code. New: The defect is in a new function which was created by and for the current project. Base: The defect is in a part of the product which has not been modified by the current project. The defect was not injected by the current project Rewritten: The defect was introduced as a direct result of redesigning and/or rewriting of old function in an attempt to improve its design or quality. Refixed: The defect was introduced by the solution provided to fix a previous defect.

378 Orthogonal Defect Classification
Handouts Data assessment of ODC classified data is based on the relationship of the ODC and non-ODC attributes of a defect The assessment must be performed by an analyst who is familiar with the project Once the feedback is given to s/w development team, they can take actions to prevent defects from recurring The ODC analysis can be combined with Pareto analysis to focus on error-prone parts of the software Pareto principle can be stated as concentrate on the vital few and not the trivial many An alternative expression of the principle is to state that 80% of the problems can be fixed with 20% of the effort It is generally called the 80/20 rule

379 Defect Causal Analysis
Handouts In DCA, defects are analyzed to Determine the cause of an error Take actions to prevent similar errors from occurring in the future Means to remove similar defects that may exist in the system or to detect them at the earliest possible point in the software development process It is sometimes referred to as defect prevention or root-cause defect analysis (RCA) Three key principles to drive defect causal analysis: Reduce the number of defects to improve quality Apply local expertise where defects occur Focus on systematic errors DCA focuses on understanding of cause-effect relationship There must be a correlation between the hypothesized cause and the effect The hypothesized cause must precede the effect in time The mechanism linking the cause to the effect must be identified

380 Defect Causal Analysis
Handouts Linking the causes to the effect consists of five steps: When was the failure detected and the corresponding fault injected? What scheme is used to classify errors? What is the common problem (systematic error)? What is the principal cause of the errors? Cause-effect diagram may be used to identify the cause How could the error be prevented in the future? Preventive: A preventive action reduces the chances of similar problems occurring in the future Corrective: A corrective action means fixing the problems. Attacking the cause itself may not be cost effective in all situations Mitigating: A mitigating action tries to counter the adverse consequences of problems Some Preventive and Corrective actions: Training, Improvement in Communication, Using tools, Process Improvement

381 Defect Causal Analysis
Handouts Figure 13.5: Cause-effect diagram for defect causal analysis (DCA).

382 Beta Testing Handouts Beta testing is conducted by the potential buyers prior to the official release of the product The purpose of beta testing is not to find defects, but to obtain feedback from the field about the usability of the product Three kinds of beta: Marketing beta Technical beta Acceptance beta A decision about when to release the system to the beta customers is made by the software project team members The beta release criteria are established by the project team A framework for writing beta release criteria is given in Table 13.13 The system test cycle continues concurrently with beta testing Weekly meetings are conducted with the beta customers by the beta support team to resolve issues.

383 Beta Testing Table 13.13: A framework for beta release criteria
Handouts Table 13.13: A framework for beta release criteria

384 First Customer Shipment
Handouts A set of generic FCS readiness criteria is as follows: All the test cases from the test suite should have been executed Test case results are updated with Passed, Failed, Blocked, or Invalid status The requirements are updated by moving each requirement from the Verification state to either the Closed or the Decline state, as discussed in Chapter 11 The pass rate of test cases is very high, say, 98% No crash in the past two weeks of testing has been observed No known defect with critical or high severity exists in the product Not more than a certain number of known defects with medium and low levels of severity exist in the product All the resolved defects must be in the CLOSED state The user guides are in place Trouble shooting guide is available The test report is completed and approved

385 System Test Report Handouts

386 Product Sustaining Handouts Once the product is shipped to one of the paying customer the software project is moved to sustaining phase The goal of this phase is to maintain the software quality throughout the product’s market life Software maintenance activities occur because software testing cannot uncover all the defects in a large software system The following three software maintenance activities were coined by Swanson: Corrective: The process that includes isolation and correction of one or more defects in the software Adaptive: The process that modifies the software to properly interface with a changing environment such as new version of hardware or third party software Perfective: The process that improves the software by the addition of new functionalities, enhancements, and/or modifications to the existing functions

387 Product Sustaining Handouts The first major task is to determine the type of maintenance task to be conducted when a defect report comes in from a customer The sustaining team, which include developers and testers are assigned immediately to work on the defect If the defect reported by the customer is considered as corrective in nature The status of the progress is updated to the customer within 24 hours The group continues to work until a patch with the fix is released to the customer If the defect reported is considered as either adaptive or perfective in nature it is entered in the requirement database, and it goes though the usual software development phases

388 Product Sustaining Handouts The major tasks of sustaining test engineers are as follows: Interact with customer to understand their real environment Reproduce the issues observed by the customer in the laboratory environment Once the root cause of the problem is known, develop new test cases to verify it Develop upgrade/downgrade test cases from the old image to the new patch image Participate in the code review process Select a subset of regression tests from the existing pool of test cases to ensure that there is no side effect because of the fix Execute the selected test cases Review the release notes for correctness Conduct experiments to evaluate test effectiveness

389 Measuring Test Effectiveness
Handouts Defect Removal Efficiency (DRE) metric defined as follows:

390 Fault Seeding Handouts Fault seeding approach is used to estimate the # of escaped defects Inject a small number of defects into system Measure the percentage of defects that are uncovered by the test engineers Estimate the number of actual defects using an extrapolation technique

391 Spoilage Metric Handouts Defects are injected and removed at different phases of a software development cycle The cost of each defect injected in phase X and removed in phase Y increases with the increase in the distance between X and Y An effective testing method would find defects earlier than a less effective testing method would An useful measure of test effectiveness is defect age, called PhAge Table 13.15: Scale for defect age

392 Spoilage Metric Handouts Table 13.16: Defect injection and versus discovery on project Boomerang

393 Spoilage Metric Handouts Table 13.17: Number of defects weighted by defect age on project Boomerang

394 Spoilage Metric Handouts The spoilage value for the Boomerang test project is 2.2 A spoilage value close to 1 is an indication of a more effective defect discovery process As an absolute value, the spoilage metric has little meaning This metric is useful in measuring the long-term trend of test effectiveness in an organization

395 Handouts Software Testing and Quality Assurance Theory and Practice Chapter 14 Acceptance Testing 395

396 Outline of the Chapter Types of Acceptance Testing Acceptance Criteria
Handouts Types of Acceptance Testing Acceptance Criteria Selection of Acceptance Criteria Acceptance Test Plan Acceptance Test Execution Acceptance Test Report Acceptance Testing in eXtreme Programming

397 Types of Acceptance Testing
Handouts Acceptance testing is a formal testing conducted to determine whether a system satisfies its acceptance criteria There are two categories of acceptance testing: User Acceptance Testing (UAT) It is conducted by the customer to ensure that system satisfies the contractual acceptance criteria before being signed-off as meeting user needs. Business Acceptance Testing (BAT) It is undertaken within the development organization of the supplier to ensure that the system will eventually pass the user acceptance testing.

398 Types of Acceptance Testing
Handouts Three major objectives of acceptance testing: Confirm that the system meets the agreed upon criteria Identify and resolve discrepancies, if there is any Determine the readiness of the system for cut-over to live operations

399 Acceptance Criteria Handouts The acceptance criteria are defined on the basis of the following attributes: Maintainability and Serviceability Robustness Timeliness Confidentiality and Availability Compliance Installability and Upgradability Scalability Documentation Functional Correctness and Completeness Accuracy Data Integrity Data Conversion Backup and Recovery Competitive Edge Usability Performance Start-up Time Stress Reliability and Availability

400 Selection of Acceptance Criteria
Handouts The acceptance criteria discussed are too many and very general The customer needs to select a subset of the quality attributes The quality attributes are prioritize them to specific situation IBM used the quality attribute list CUPRIMDS for their products – Capability, Usability, Performance, Reliability, Installation, Maintenance, Documentation, and Service Ultimately, the acceptance criteria must be related to the business goals of the customer’s organization

401 Acceptance Test Plan Handouts

402 Acceptance Test Execution
Handouts The acceptance test cases are divided into two subgroups The first subgroup consists of basic test cases, and The second consists of test cases that are more complex to execute The acceptance tests are executed in two phases In the first phase, the test cases from the basic test group are executed If the test results are satisfactory then the second phase, in which the complex test cases are executed, is taken up. In addition to the basic test cases, a subset of the system-level test cases are executed by the acceptance test engineers to independently confirm the test results Acceptance test execution activity includes the following detailed actions: The developers train the customer on the usage of the system The developers and the customer co-ordinate the fixing of any problem discovered during acceptance testing The developers and the customer resolve the issues arising out of any acceptance criteria discrepancy

403 Acceptance Test Execution
Handouts The acceptance test engineer may create an Acceptance Criteria Change (ACC) document to communicate the deficiency in the acceptance criteria to the supplier A representative format of an ACC document is shown in Table 14.2. An ACC report is generally given to the supplier’s marketing department through the on-site system test engineers

404 Acceptance Test Report
Handouts The acceptance test activities are designed to reach at a conclusion: accept the system as delivered accept the system after the requested modifications have been made do not accept the system Usually some useful intermediate decisions are made before making the final decision. A decision is made about the continuation of acceptance testing if the results of the first phase of acceptance testing is not promising If the test results are unsatisfactory, changes be made to the system before acceptance testing can proceed to the next phase During the execution of acceptance tests, the acceptance team prepares a test report on a daily basis A template of the test report is given in Table 14.3 At the end of the first and the second phases of acceptance testing an acceptance test report is generated which is outlined in Table 14.4

405 Acceptance Test Report
Handouts

406 Acceptance Test Report
Handouts

407 Acceptance Testing in eXtreme Programming
Handouts In XP framework the user stories are used as acceptance criteria The user stories are written by the customer as things that the system needs to do for them Several acceptance tests are created to verify the user story has been correctly implemented The customer is responsible for verifying the correctness of the acceptance tests and reviewing the test results A story is incomplete until it passes its associated acceptance tests Ideally, acceptance tests should be automated, either using the unit testing framework, before coding The acceptance tests take on the role of regression tests

408 Handouts Software Testing and Quality Assurance Theory and Practice Chapter 15 Software Reliability 408

409 Outline of the Chapter What is Reliability?
Handouts What is Reliability? Definitions of Software Reliability Factors Influencing Software Reliability Applications of Software Reliability Operational Profiles Reliability Models Summary

410 What is Reliability? Reliability is a broad concept.
Handouts Reliability is a broad concept. It is applied whenever we expect something to behave in a certain way. Reliability is one of the metrics that are used to measure quality. It is a user-oriented quality factor relating to system operation. Intuitively, if the users of a system rarely experience failure, the system is considered to be more reliable than one that fails more often. A system without faults is considered to be highly reliable. Constructing a correct system is a difficult task. Even an incorrect system may be considered to be reliable if the frequency of failure is “acceptable.” Key concepts in discussing reliability: Fault Failure Time Three kinds of time intervals: MTTR, MTTF, MTBF

411 What is Reliability? Failure Fault Time
Handouts Failure A failure is said to occur if the observable outcome of a program execution is different from the expected outcome. Fault The adjudged cause of failure is called a fault. Example: A failure may be cause by a defective block of code. Time Time is a key concept in the formulation of reliability. If the time gap between two successive failures is short, we say that the system is less reliable. Two forms of time are considered. Execution time () Calendar time (t)

412 What is Reliability? MTTF: Mean Time To Failure
Handouts MTTF: Mean Time To Failure MTTR: Mean Time To Repair MTBF: Mean Time Between Failures (= MTTF + MTTR) Figure 15.1: Relationship between MTTR, MTTF, and MTBF.

413 What is Reliability? Two ways to measure reliability µ() λ()
Handouts Two ways to measure reliability Counting failures in periodic intervals Observer the trend of cumulative failure count - µ(). Failure intensity Observe the trend of number of failures per unit time – λ(). µ() This denotes the total number of failures observed until execution time  from the beginning of system execution. λ() This denotes the number of failures observed per unit time after  time units of executing the system from the beginning. This is also called the failure intensity at time . Relationship between λ() and µ() λ() = dµ()/d

414 Definitions of Software Reliability
Handouts First definition Software reliability is defined as the probability of failure-free operation of a software system for a specified time in a specified environment. Key elements of the above definition Probability of failure-free operation Length of time of failure-free operation A given execution environment Example The probability that a PC in a store is up and running for eight hours without crash is 0.99. Second definition Failure intensity is a measure of the reliability of a software system operating in a given environment. Example: An air traffic control system fails once in two years. Comparing the two The first puts emphasis on MTTF, whereas the second on count.

415 Factors Influencing Software Reliability
Handouts A user’s perception of the reliability of a software depends upon two categories of information. The number of faults present in the software. The ways users operate the system. This is known as the operational profile. The fault count in a system is influenced by the following. Size and complexity of code Characteristics of the development process used Education, experience, and training of development personnel Operational environment

416 Applications of Software Reliability
Handouts Comparison of software engineering technologies What is the cost of adopting a technology? What is the return from the technology -- in terms of cost and quality? Measuring the progress of system testing Key question: How of testing has been done? The failure intensity measure tells us about the present quality of the system: high intensity means more tests are to be performed. Controlling the system in operation The amount of change to a software for maintenance affects its reliability. Thus the amount of change to be effected in one go is determined by how much reliability we are ready to potentially lose. Better insight into software development processes Quantification of quality gives us a better insight into the development processes.

417 Operational Profiles Developed at AT&T Bell Labs.
Handouts Developed at AT&T Bell Labs. An OP describes how actual users operate a system. An OP is a quantitative characterization of how a system will be used. Two ways to represent operational profiles Tabular Graphical Table 15.1: An example of operational profile of a library information system. Figure 15.2: Graphical representation of operational profile of a library information system.

418 Operational Profiles Use of operational profiles
Handouts Use of operational profiles For accurate estimation of the reliability of a system, test the system in the same way it will be actually used in the field. Other uses of operational profiles Use an OP as a guiding document in designing user interfaces. The more frequently used operations should be easy to use. Use an OP to design an early version of a software for release. This contains the more frequently used operations. Use an OP to determine where to put more resources.

419 Reliability Models Main idea
Handouts Main idea We develop mathematical models for λ() and µ(). Basic assumptions in developing a reliability model Faults in the program are independent. Execution time between failures is large w.r.t. instruction execution time. Potential test space covers its use space. The set of inputs per test run is randomly chosen. The fault causing a failure is immediately fixed or else its re-occurrence is not counted again.

420 Reliability Models Intuitive idea Two decrement processes
Handouts Intuitive idea As we observe another system failure and the corresponding fault is fixed, there will be fewer number of faults remaining in the system and the failure intensity will be smaller with each fault fixed. In other words, as the cumulative failure count increases, the failure intensity decreases. Two decrement processes Decrement process 1 The decrease in failure intensity after observing a failure and fixing the corresponding fault is constant. This gives us the Basic model. Decrement process 2 The decrease in failure intensity after observing a failure and fixing the corresponding fault is smaller than the previous decrease. This gives us the Logarithmic model.

421 Reliability Models Parameters of the models
Handouts Parameters of the models λ0: The initial failure intensity observed at the beginning of system testing. v0: The total number of system failures that we expect to observe over infinite time starting from the beginning of system testing. : A parameter representing n0n-linear drop in failure intensity in the Logarithmic model. Figure 15.3: Failure intensity λ as a function of cumulative failures µ.

422 Reliability Models Basic model Logarithmic model
Handouts Basic model Assumption: λ(µ) = λ0 (1 - µ/v0) dµ()/d = λ0 (1 - µ()/v0) µ() = λ0 (1 - µ/v0) λ() = λ0.e -λ0 /v0 Logarithmic model Assumption: λ(µ) = λ0e-µ dµ()/d = λ0e-µ() µ() = ln(λ0 + 1)/ λ() = λ0/(λ0 + 1) Figure 15.4: Failure intensity λ as a function of execution time  (λ0 = 9 failures/unit time, v0 = 500 failures,  = ).

423 Reliability Models Handouts Figure 15.4: Cumulative failure µ as a function of execution time  (λ0 = 9 failures/unit time, v0 = 500 failures,  = ).

424 Reliability Models Example
Handouts Example Assume that a software system is undergoing system level testing. The initial failure intensity of the system was 25 failures/CPU hours, and the current failure intensity is 5 failures/CPU hour. It has been decided by the project manager that the system will be released only after the system reaches a reliability level of at most failures/CPU hour. From their experience the management team estimates that the system will experience a total of failures over infinite time. Calculate the additional length of system testing required before the system can be released. The system will experience a total of 1200 failures over infinite time. Thus, we use the Basic model. λc and λr are the current failure intensity and the failure intensity at the time of release. Assume that the current failure intensity has been achieved after executing the system for c hours. Let λr be achieved after testing the system for a total of r hours.

425 Reliability Models (Example continued)
Handouts (Example continued) (r - c) denotes the additional execution time requires to achieve λr. We can write λc and λr as follows. λc = λ0.e -λ0 c/v0 λr = λ0.e -λ0 r/v0 λc / λr = (λ0.e -λ0 c/v0)/(λ0.e -λ0 r/v0) = e (r - c) λ0/v0 ln(λc / λr) = (r - c) λ0/v0 (r - c) = (v0/ λ0)ln(λc / λr) = (1200/25)ln(5/0.001) = hours It is required to test the system for more time so that the CPU runs for another hours to achieve the reliability level of failures/hour.

426 Summary Handouts Reliability is a user-oriented quality factor relating to system operation. The chapter introduced the following. Fault and failure Execution and calendar time Time interval between failures Failures in periodic intervals Failure intensity Software reliability was defined in two ways. The probability of failure-free operation of a system for a specified time in a given environment. Failure intensity is a measure of reliability. User’s perception of reliability: The number of faults in a system. How a user operates a system. The number of faults in a system is influenced by the following: Size and complexity of code. Development process. Personnel quality. Operational environment Operational profile A quantitative characterization of how actual users operate a system. Tabular and graphical representation Applications of reliability metric Reliability models Six assumptions Two models Basic Logarithmic

427 Handouts Software Testing and Quality Assurance Theory and Practice Chapter 16 Test Team Organization 427

428 Outline of the Chapter Test Groups Integration Test Group
Handouts Test Groups Integration Test Group System Test Group Software Quality Assurance Group Quality Management Group System Test Team Hierarchy Effective Staffing of Test Engineers Recruiting Test Engineers Retaining Test Engineers Team Building

429 Test Groups There is no right or wrong ways to organize test teams
Handouts There is no right or wrong ways to organize test teams The structure one chooses will affect productivity, quality, customer satisfaction, employee morale, and budget Unit tests are developed and executed by the software developers themselves, rather than an independent unit test group It is recommended to have at least two test groups: integration test group system test group The acceptance test group is formed on a demand basis consisting of people from different backgrounds The acceptance test group is dismantled after the project is completed

430 Integration Test Group
Handouts The mandate of this group is to ensure that unit-tested modules operate correctly when they are combined The leader of the integration test group reports to the software development manager The software developers, who together built the modules, must be involved in performing integration testing In practice, the developers themselves may integrate the system The system architects are also involved in integration testing for complex systems The test group may perform other duties, such as: code inspection, configuration management, release management, and management of development laboratory.

431 System Test Group Handouts The mandate of this group is to ensure that the system requirements have been satisfied and that the system is acceptable The system test group is truly an independent group, and they usually have a separate headcount and budget The manager of this group is a peer to the hardware or software development managers The system test group conducts different categories of tests as discussed in Chapter 8 The group executes business acceptance tests identified in the user acceptance test plan Figure 16.1: Structure of test groups

432 Software Quality Assurance Group
Handouts Software quality assurance deals not only with the location of the defects, but also with mechanisms to prevent defects Software quality assurance group has a larger role in ensuring, conformance to the best development practices throughout the organization It is recommended to have a separate group for quality management work as shown in Figure 16.2, rather than assign quality management task to system test engineers. Figure 16.2: Structure of software quality assurance group.

433 Quality Management Group
Handouts This group works on customizing software development processes and ensuring that processes are adhered to The group is responsible for creating and implementing a quality management program plan for the entire organization The group proactively works to drive process improvement initiatives across the organization Quality control is another term that is often used in the literature. Quality control is defined in the IEEE standard 610 as: A set of activities designed to evaluate the quality of developed or manufactured products The term is used in a production or hardware manufacturing environment, where large a number of physical items are produced

434 System Test Team Hierarchy
Handouts Figure 16.3: System test team hierarchy.

435 Effective Staffing of Test Engineers
Handouts A successful test team is made up of members whose strengths are complementary It is advisable to have people on the test team with diverse background and experience, such as: developers integration testers information technology administrators technical support personnel technical writers quality management personnel experienced test engineers recent graduates

436 Effective Staffing of Test Engineers
Handouts It is useful to keep in mind the following five-C characteristics a good test engineer must possess. Controlled Comprehensive, Considerate, Critical and Competent In addition to the five-C characteristics, test engineers are expected to have the following skills Have credibility with software developers Understand developers’ terminologies Know when the code is ready for testing Be able to evaluate the impact of a problem on the customers Assist software developers in expediting defect resolution Reduce false-positive and false-negative results in testing Develop expertise in test automation Mentor the junior test engineers

437 Recruiting Test Engineers
Handouts Figure 16.3: Six phases of the effective recruiting process

438 Retaining Test Engineers
Handouts The following are key factors that positively impact the ability of an organization to retain good system test engineers A Career Path Training On-site commercial training: Public forum training In-house training Specialty training Mentoring Reward System

439 Team Building The essential ingredients of a good team building:
Handouts The essential ingredients of a good team building: Expectations Consistency Information Sharing Standardization Test Environments Recognitions

440 Handouts Software Testing and Quality Assurance Theory and Practice Chapter 17 Software Quality 440

441 Outline of the Chapter Five Views of Software Quality
Handouts Five Views of Software Quality McCall’s Quality Factors and Criteria The ISO 9126 Quality Characteristics The ISO 9000:2000 Software Quality Standard Summary

442 Five Views of Software Quality
Handouts Transcendental view User view Manufacturing view Product view Value-based view

443 Five Views of Software Quality
Handouts Transcendental view Quality is something that can be recognized through experience, but not defined in some tractable form. A good quality object stands out, and it is easily recognized. User view Quality concerns the extent to which a product meets user needs and expectations. Is a product fit for use? This view is highly personalized. A product is of good quality if it satisfies a large number of users. It is useful to identify the product attributes which the users consider to be important. This view may encompass many subject elements, such as usability, reliability, and efficiency.

444 Five Views of Software Quality
Handouts Manufacturing view This view has its genesis in the manufacturing industry – auto and electronics. Key idea: Does a product satisfy the requirements? Any deviation from the requirements is seen as reducing the quality of the product. The concept of process plays a key role. Products are manufactured “right the first time” so that the cost is reduced Development cost Maintenance cost Conformance to requirements leads to uniformity in products. Some argue that such uniformity does not guarantee quality. Product quality can be incrementally improved by improving the process. The CMM and ISO 9001 models are based on the manufacturing view.

445 Five Views of Software Quality
Handouts Product view Hypothesis: If a product is manufactured with good internal properties, then it will have good external properties. One can explore the causal relationship between internal properties and external qualities. Example: Modularity enables testability. Value-based view This represents the merger of two concepts: excellence and worth. Quality is a measure of excellence, and value is a measure of worth. Central idea How much a customer is willing to pay for a certain level of quality. Quality is meaningless if a product does not make economic sense. The value-based view makes a trade-off between cost and quality.

446 Five Views of Software Quality
Handouts Measuring quality Reasons for developing a quantitative view of quality Measurement of user’s view Measurement of manufacturing view Measurement allows us to establish baselines for qualities. Measurement is key to process improvement. The needs for improvements can be investigated after performing measurements.

447 Five Views of Software Quality
Handouts Measurement of user’s view Functionalities can be easily measured. What functionality test cases have passed? Measure of delivered functionality = ratio of # of passed test cases to the total number of test cases designed to verify the functionalities. Apply Gilb’s technique. The quality concept is broken down into component parts until each can be stated in terms of directly measurable qualities. Example: Usability can be broken down into Learnability Understandability Operability

448 Five Views of Software Quality
Handouts Measurement of manufacturer’s view Manufacturers are interested in defect count and rework cost. Defect count: The total number of defects detected during development and operation. It is a measure of the quality of the work produced. One can analyze the defects as follows. For each defect, identify the development phase in which it was introduced. Categorize the defects, say, based on modules. Normalize defect count by product size. Defect density: Number of defects per 1000 lines of code. Separate the defects found during operation from those found during development. Rework cost: How much does it cost to fix the known defects? Development rework cost: This is the rework cost incurred before a product is released. This is a measure of development efficiency. Operation rework cost: This is the rework cost incurred when a product is in operation. This is a measure of the delivered quality.

449 McCall’s Quality Factors and Criteria
Handouts Quality Factors McCall, Richards, and Walters studied the concept of software quality in terms of two key concepts as follows: quality factors, and quality criteria. A quality factor represents the behavioral characteristic of a system. Examples: correctness, reliability, efficiency, testability, portability, … A quality criterion is an attribute of a quality factor that is related to software development. Example: Modularity is an attribute of the architecture of a software system. A highly modular software allows designers to put cohesive components in one module, thereby increasing the maintainability of the system. McCall et al. identified 11 quality factors (Table 17.1.)

450 McCall’s Quality Factors and Criteria
Handouts Table 17.1: McCall’s quality factors [10].

451 McCall’s Quality Factors and Criteria
Handouts The 11 quality factors defined in Table 17.1 have been grouped into three broad categories (See Table 17.2.) Product operation Product revision Product transition Table 17.2: Categorization of McCall’s quality factors [10].

452 McCall’s Quality Factors and Criteria
Handouts Quality Criteria A quality criterion is an attribute of a quality factor that is related to software development. Example: Modularity is an attribute of the architecture of a software system. A highly modular software allows designers to put cohesive components in one module, thereby increasing the maintainability of the system. In Table 17.3, we have listed 23 quality criteria.

453 McCall’s Quality Factors and Criteria
Handouts Table 17.3: McCall’s quality criteria [10].

454 McCall’s Quality Factors and Criteria
Handouts Relationship Between Quality Factors and Quality Criteria Each quality factor is positively influenced by a set of quality criteria, and the same quality criterion impacts a number of quality factors. Example: Simplicity impacts reliability, usability, and testability. If an effort is made to improve one quality factor, another quality factor may be degraded. Portable code may be less efficient. Some quality factors positively impact others. An effort to improve the correctness of a system will increase its reliability. See Figure 17.1.

455 McCall’s Quality Factors and Criteria
Handouts Figure 17.1: Relation between quality factors and quality criteria [10].

456 The ISO 9126 Quality Characteristics
Handouts The ISO 9126 document is the product of an international effort. ISO: International Organization for Standardization The document defines six broad quality characteristics as shown in Table 17.4. The document includes an example quality model (Figure 17.2) that further decomposes the quality characteristics. Figure 17.2 is just an example, and not a universal one. The 20 subcharacteristics of Figure 17.2 have been defined in Table 17.5.

457 The ISO 9126 Quality Characteristics
Handouts Table 17.4: ISO 9126 quality characteristics.

458 The ISO 9126 Quality Characteristics
Handouts Figure 17.2: The ISO 9126 sample quality model refines the standard’s features into subcharacteristics [9]. (©[1996] IEEE)

459 The ISO 9126 Quality Characteristics
Handouts Table 17.5: Quality subcharacteristics of ISO 9126.

460 The ISO 9126 Quality Characteristics
Handouts McCall’s quality model vs. ISO 9126 model What is called quality factor in McCall’s model is called a quality subcharacteristic in the ISO 9126 model. The following quality factors/characteristics are found in both the models. reliability, usability, efficiency, maintainability, and portability Differences between the two models The ISO 9126 model emphasizes on characteristics visible to the users, whereas the McCall model considers internal qualities as well. In McCall’s model, one quality criterion can impact many quality factors, whereas in the ISO 9126 model, one subcharacteristic impacts exactly one quality characteristic. A high-level quality factor, such as testability, in the McCall’s model is a low-level subcharacteristic of maintainability in the ISO 9126 model. Concerns There is no consensus about what high-level quality factors are most important at the top level. McCall, et al. define 11 high-level quality factors, whereas there are only six in the ISO 9126 document. There is no consensus regarding what is a top-level quality factor/ characteristic and what is a more concrete quality criterion/ subcharacteristic.

461 The ISO 9000:2000 Software Quality Standard
Handouts The international organization ISO has developed a series of standards for quality assurance and quality management, collectively known as the ISO 9000. The ISO 9000 standards are reviewed and updated once every 5-8 years. The standards released in the year 2000 are known as ISO 9000:2000. There are three components of the ISO 9000:2000 standard. ISO 9000: Fundamentals and vocabulary ISO 9001: Requirements ISO 9004: Guidelines for performance improvements Note: ISO 9002 and ISO 9003 were parts of ISO 9000:1994, but these are no more parts of ISO 9000:2000.

462 The ISO 9000:2000 Software Quality Standard
Handouts ISO 9000:2000 Fundamentals: This is based on eight principles. Principle 1: Customer focus Principle 2: Leadership Principle 3: Involvement of people Principle 4: Process approach Principle 5: System approach to management Principle 6: Continual improvement Principle 7: Factual approach to decision making Principle 8: Mutually beneficial supplier relationships

463 The ISO 9000:2000 Software Quality Standard
Handouts ISO 9001:2000 Requirements The five major parts of this document are as follows. Part 4. Systemic requirements Part 5. Management requirements Part 6. Resource requirements Part 7. Realization requirements Part 8. Remedial requirements

464 The ISO 9000:2000 Software Quality Standard
Handouts ISO 9001:2000 Requirements Part 4. Systemic requirements (partial) Document the organizational policies and goals. Publish a vision document. Document all quality processes and their interrelationship. Implement a mechanism to approve documents before those are distributed. Part 5: Management requirements (partial) Generate an awareness for quality to meet a variety of requirements, such as customer, regulatory, and statutory. Focus on customers by identifying and meeting their requirements in order to satisfy them. Develop a quality policy to meet the customer’s needs. Clearly define individual responsibilities and authorities concerning the implementation of quality policies.

465 The ISO 9000:2000 Software Quality Standard
Handouts ISO 9001:2000 Requirements Part 6. Resource requirements (partial) Identify and provide resources required to support the organizational quality policy in order to realize the quality objectives. Allocate quality personnel resource to projects. Put in place a mechanism to enhance the quality level of personnel. Part 7: Realization requirements (partial) Develop a plan to realize a product from its requirements. Interact with customers to gather their requirements. Classify those requirements. Review the requirements. Follow a defined purchasing process by evaluating potential suppliers based on a number of factors, such as ability to meet requirements and price.

466 The ISO 9000:2000 Software Quality Standard
Handouts ISO 9001:2000 Requirements Part 8. Remedial requirements (partial) Measure and track the customer’s satisfaction level. Perform internal audit. Example: Find out whether or not personnel with adequate education, experience, and skill have been assigned to a project. Monitor processes by using a set of key performance indicators.

467 Summary Five views of quality Measure quality for three reasons
Handouts Five views of quality Transcendental view User view Manufacturing view Product view Value-based view Measure quality for three reasons Baseline Quality improvement based on cost Know the present level for future planning Measuring the manufacturer’s view Defect count Rework cost McCall’s quality factors Quality factors (11): 3 classes (operation, revision, transition) Quality criteria (23) Global initiatives for quality control ISO 9126 ISO 9000:2000 Six quality characteristics Twenty quality subcharacteristics ISO 9000: Fundamentals ISO 9001: Requirements ISO 9004: Performance improvements

468 Handouts Software Testing and Quality Assurance Theory and Practice Chapter 18 Maturity Models 468

469 Outline of the Chapter Basic Idea in Software Process
Handouts Basic Idea in Software Process Capability Maturity Model (CMM) Test Process Improvement (TPI) Testing Maturity Model (TMM) Summary

470 Basic Idea in Software Process
Handouts A process comprises a set of activities that are executed to develop products. The activities find expressions in the form of methods, techniques, strategies, procedures, and practices. The activities heavily rely on information repositories, such as documents, standards, and policies. Different processes are driven by different goals and availability of resources. It is useful to follow a defined process because of the following benefits. The process can be repeated in subsequent projects. The process can be evaluated by using a variety of metrics, such as cost, quality, and time to deliver. Actions can be taken to improve the process to achieve better results.

471 Basic Idea in Software Process
Handouts A software process comprises the following tasks. Gathering requirements Constructing a functional specification Designing the system Writing code Testing the system Maintaining the system

472 Basic Idea in Software Process
Handouts Software testing is treated as a distinct process because it involves a variety of unique activities, techniques, strategies, and policies. Testing is performed to reveal defects and show to what extent the software possesses different quality attributes, such as reliability and performance. Testing begins almost at the same time a project is conceptualized. Testing is carried out by different people at different stages of system development. A number of different techniques can be applied at each level of testing. A number of different strategies can be applied at each level of testing. A number of metrics can be monitored to gauge the progress of testing. Testing is influenced by organizational policies. Testing can be performed as a combination of manual and automated modes of execution of test cases.

473 Basic Idea in Software Process
Handouts To be able to improve a defined process, organizations need to evaluate its capabilities and limitations. Example: The Capability Maturity Model (CMM) allows an organization to evaluate its software development processes. The CMM model supports incremental process improvement. A separate model, known as the Testing Maturity Model (TMM), has been developed to evaluate a testing process. For an organization to be able to improve their testing process, the Test Process Improvement (TPI) model has been developed.

474 Capability Maturity Model (CMM)
Handouts While awarding a contract, the customer needs to gain confidence that an organization is capable of delivering the desired product. The US Department of Defense wanted to evaluate their contractors. They needed a framework to evaluate the maturity of software processes. In 1986, the Software Engineering Institute (SEI) initiated the development of a framework to be called the CMM. In the CMM model, the maturity level of an organization tells us to what extent an organization can produce low cost, high quality software. Having known the current maturity level, an organization can work to reach the next higher level. There are five maturity levels in the CMM model.

475 Capability Maturity Model (CMM)
Handouts Figure 18.1: The CMM structure [4] (©[2005] John Wiley).

476 Capability Maturity Model (CMM)
Handouts Figure 18.2: SW-CMM maturity levels [4] (©[2005] John Wiley).

477 Capability Maturity Model (CMM)
Handouts Common features of key practices The key practices in every key process area are organized into five categories called common features. Common features are attributes of key practices that indicate whether the implementation of a KPA is effective, repeatable, and lasting. The five categories of common features are as follows. Commitment to perform Ability to perform Activities performed Measurement and analysis Verifying implementation

478 Capability Maturity Model (CMM)
Handouts Application of the CMM For an organization to be at a certain level of maturity, all the goals of all the KPAs at that level – and all preceding levels too – must be satisfied. Example: For an organization to be at Level 3, it must meet all the six KPAs at Level 2 and all the seven KPAs at Level 3. The SEI developed the Capability Maturity Model-Based Assessment Internal Process Improvement (CBA-IPI) to assist organizations for self-assessment. The CBA-IPI uses the CMM as a reference model to evaluate the process capability of organizations by identifying what KPAs are being satisfied and what need to be improved. The SEI developed the CMM Appraisal Framework (CAF) to provide a mechanism for formal evaluation of organizations. The CAF describes the requirements and guidelines to be used by external assessors in designing CAF-compliant evaluation methods.

479 Capability Maturity Model (CMM)
Handouts Capability Maturity Model Integration (CMMI) After the successful application of the CMM in the software area (known as CMM-SW). CMMs in other areas were also developed. Systems Engineering CMM Integrated Product Development CMM Electronic Industry Alliance 731 CMM Software Acquisition CMM People CMM Supplier Source CMM

480 Test Process Improvement (TPI)
Handouts A test process is a certain way of performing activities related to defect detection. A few such activities are as follows (See Section 18.3 for more.) Identifying test goals. Preparing a test plan. Identifying different kinds of tests. Hiring test personnel. Designing test cases. Setting up test benches. Procuring test tools. Assigning test cases to test engineers. Prioritizing test cases for execution. Organizing the execution of test cases into multiple test cycles.

481 Test Process Improvement (TPI)
Handouts A simple test process for system-level testing Categorize the features of a system into k groups. Design Ni test cases for feature category i, for 1 ≤ i ≤ k. These Ni test cases are denoted by the set Ti. Run T1 U … U Tk to detect defects. Run T1 U … U Tk each defect fix until no more defects are found, or it is time to release the system. Deficiencies in the above simple process. Test tools have not been used. Test cases have not been prioritized. The entire test suite has been executed in each test cycle. Therefore, it is important to improve test processes by following a defined model. The idea of improving test processes by following a model, namely the Test Process Improvement (TPI) model, was first studied by Tim Koomen and Martin Pol.

482 Test Process Improvement (TPI)
Handouts A test process needs to be improved for three reasons. Quality: A better test process should give more insights into the quality characteristics of a system being tested. Lead Time: A better test process saves testing time. One can prioritize test cases so that difficult-to-fix defects to gain time. Cost: A better test process is expected to be carried out with a lower cost. An intuitive approach to improving a test process is as follows: Step 1: Determine an area for improvement. Step 2: Evaluate the current status of the test process. Step 3: Identify the next desired state and the means. Step 4: Implement the necessary changes to the process. The above steps are straightforward, but their implementation is not. The TPI model supports gradual process improvement. The current status of a test process is evaluated from different viewpoints, known as key areas – and 20 key areas have been identified. The status of a test process w.r.t. a key area is represented in terms of one of four levels of maturity – A, B, C, and D.

483 Test Process Improvement (TPI)
Handouts The 20 key areas are as follows: Test strategy Life-cycle model Moment of involvement Planning and estimating Test specification technique Static test technique Metrics Test tools Test environment Office environment Commitment and motivation Test functions and training Scope of methodology Communication Reporting Defect management Test process management Evaluation Low-level testing

484 Test Process Improvement (TPI)
Handouts Maturity levels of test processes Based on the idea of dependencies and prioritization, a Test Maturity Matrix, as shown in Table 18.2, is constructed. The Test Maturity Matrix shows that the overall maturity of a test process can be represented on a scale of 1—13. The 13 scales of maturity of a test process are classified into three distinct segments as follows. Controlled (1—5): All component activities are planned and executed in phases according to the plan. Efficient (6—10): All the key areas, except Evaluation, are raised to at least B level with some being at C. Optimizing (11—13): All the key areas have reached their respective highest maturity levels. Optimizing a test process means performing testing tasks in the best possible manner from the standpoint of quality, time, and cost.

485 Test Process Improvement (TPI)
Handouts Applying the TPI model Analyze the current test process, using Table 18.1 (Requirements for different maturity levels), in terms of the 20 key areas, and give each key area a rating – A, B, C, or D. Evaluate the current scale, between 1—13, of the test process by comparing the current status of the test process with the standard Test Maturity Matrix of Table 18.2 (Test maturity matrix.) Identify the goal of the organization in terms of the next scale to be achieved. Identify the key areas where improvements must be achieved. Take actions to improve the key areas identified in the preceding step.

486 Testing Maturity Model (TMM)
Handouts TMM was pioneered by Ilene Burnstein to help organizations evaluate and improve their testing processes. The TMM framework describes an evolutionary path of test process maturity in five levels, or stages. (Figure 18.3). Each stage is characterized by the concepts of maturity goals supporting maturity goals, and activities, tasks, and responsibilities (ATRs)

487 Testing Maturity Model (TMM)
Handouts Figure 18.3: The 5-level structure of the testing maturity model [1] (©[2003] Springer).

488 Testing Maturity Model (TMM)
Handouts Maturity goals Each maturity level, except 1, contains certain maturity goals. For an organization to reach a certain level, the corresponding maturity goals must be met by the organization. Maturity subgoals Maturity goals are supported by maturity subgoals ATRs Maturity subgoals are achieved by means of ATRs. ATRs address issues concerning implementation of activities and tasks. ATRs also address how an organization can adapt its practices so that it can move in-line with the TMM model. ATRs are refined into “views” from the perspectives of three groups: Managers Developers and test engineers Customers (user/client).

489 Testing Maturity Model (TMM)
Handouts Level 1 – Initial There are no maturity goals to be met at this level. Testing begins after code is written. An organization performs testing to demonstrate that the system works. No serious effort is made to track the progress of testing. Test cases are designed and executed in an ad hoc manner. In summary, testing is not viewed as a critical, distinct phase in software development.

490 Testing Maturity Model (TMM)
Handouts Level 2 – Phase Definition: The maturity goals are as follows: Develop testing and debugging goals. Some concrete maturity subgoals that can support this goal are as follows: Organizations form committees on testing and debugging. The committees develop and document testing and debugging goals. Initiate a test planning process. (Identify test objectives. Analyze risks. Devise strategies. Develop test specifications. Allocate resources.) Assign the task of test planning to a committee. The committee develops a test plan template. Proper tools are used to create and manage test plans. Provisions are put in place so that customer needs constitute a part of the test plan. Institutionalize basic testing techniques and methods. The following concrete subgoals support the above maturity subgoal. An expert group recommends a set of basic testing techniques and methods. The management establishes policies to execute the recommendations.

491 Testing Maturity Model (TMM)
Handouts Level 3 – Integration: The maturity goals are as follows: Establish a software test group. Concrete subgoals to support the above are: An organization-wide test group is formed with leadership, support, and $$. The test group is involved in all stages of the software development. Trained and motivated test engineers are assigned to the group. The test group communicates with the customers. Establish a technical training program. Integrate testing into the software lifecycle. The test phase is partitined into several activities: unit, integration, system, and acceptance testing. Follow the V-model. Control and monitor the testing process. Develop policies and mechanisms to monitor and control test projects. Define a set of metrics related to the test project. Be prepared with a contingency plan.

492 Testing Maturity Model (TMM)
Handouts Level 4 – Management and Measurement: The maturity goals are: Establish an organization-wide review program. Maturity subgoals to support the above are as follows. The management develops review policies. The test group develops goals, plans, procedures, and recording mechanisms for carrying out reviews. Members of the test group are trained to be effective. Establish a test management program. Test metrics should be identified along with their goals. A test measurement plan is developed for data collection and analysis. An action plan should be developed to achieve process improvement. Evaluate software quality. The organization defines quality attributes and quality goals for products. The management develops policies and mechanisms to collect test metrics to support the quality goals.

493 Testing Maturity Model (TMM)
Handouts Level 5 –Optimization, Defect Prevention and Quality Control: The maturity goals are as follows: Application of process data for defect prevention Maturity subgoals to support the above are as follows. Establish a defect prevention team. Document defects that have been identified and removed. Each defect is analyzed to get to its root cause. Develop an action plan to eliminate recurrence of common defects. Statistical quality control Establish high-level measurable quality goals. (Ex. Test case execution rate, defect arrival rate, …) Ensure that the new quality goals form a part of the test plan. The test group is trained in statistical testing and analysis methods. Test process optimization

494 Testing Maturity Model (TMM)
Handouts Level 5 –Optimization, Defect Prevention and Quality Control: The maturity goals are as follows (continued.) Test process optimization Maturity subgoals to support the above are as follows. Establish a test process improvement group to monitor the testing process and identify areas for improvement. Evaluate new technologies and tools to improve the capability of the testing process. Put a mechanism in place for continual evaluation of the effectiveness of the testing process. Test stopping criteria are based on quality goals.

495 Summary Capability Maturity Model (CMM) Test Process Improvement (TPI)
Handouts Capability Maturity Model (CMM) The CMM is used to assess the maturity level of an organization to develop software products. Five levels of maturity Level 1: Initial Level 2: Repeatable Level 3: Defined Level 4: Managed Level 5: Optimized Each level is characterized by a set of key process areas. Test Process Improvement (TPI) A test process is evaluated w.r.t. 20 key areas. The maturity level of a test process is assessed on a scale of 1—13. The 13 levels of maturity are partitioned into three groups: controlled, efficient, and optimizing. Testing Maturity Model (TMM) The TMM model gives guidelines concerning how to improve a test process. The maturity of a testing process is evaluated on a scale of 1—5. Level 1: Initial Level 2: Phase Definition Level 3: Integration Level 4: Management and Measurement Level 5: Optimization, Defect Prevention, and Quality Control


Download ppt "Handouts Software Testing and Quality Assurance Theory and Practice Chapter 1 Basic Concepts and Preliminaries ------------------------------------------------------------------"

Similar presentations


Ads by Google