20 - Pressman-Ch-1314-Software-Testing
20 - Pressman-Ch-1314-Software-Testing
- A strategic approach to testing - Test strategies for conventional software - Validation testing - System testing
Introduction
A strategy for software testing integrates the design of software test cases into a well-planned series of steps that result in successful development of the software The strategy provides a road map that describes the steps to be taken, when, and how much effort, time, and resources will be required The strategy incorporates test planning, test case design, test execution, and test result collection and evaluation The strategy provides guidance for the practitioner and a set of milestones for the manager Because of time pressures, progress must be measurable and problems must surface as early as possible
Integration testing
Focuses on the design and construction of the software architecture
Validation testing
Requirements are validated against the constructed software
System testing
The software and other system elements are tested as a whole
Integration testing
Focuses on inputs and outputs, and how well the components fit together and work together
Validation testing
Provides final assurance that the software meets all functional, behavioral, and performance requirements
System testing
Verifies that all system elements (software, hardware, people, databases) mesh properly and that overall system function and performance is achieved
7
Unit Testing
Focuses testing on the function or software module Concentrates on the internal processing logic and data structures Is simplified when a module is designed with high cohesion
Reduces the number of test cases Allows errors to be more easily predicted and uncovered
Concentrates on critical modules and those with high cyclomatic complexity when testing resources are limited
10
Boundary conditions
Ensure that the module operates properly at boundary values established to limit or restrict processing
11
Integration Testing
Defined as a systematic technique for constructing the software architecture
At the same time integration is occurring, conduct tests to uncover errors associated with interfaces
Objective is to take unit tested modules and build a program structure based on the prescribed design
12
Regression Testing
Each new addition or change to baselined software may cause problems with functions that previously worked flawlessly Regression testing re-executes a small subset of tests that have already been conducted
Ensures that changes have not propagated unintended side effects Helps to ensure that changes do not introduce unintended behavior or additional errors May be done manually or through the use of automated capture/playback tools
Smoke Testing
Taken from the world of hardware
Power is applied and a technician checks for sparks, smoke, or other dramatic signs of fundamental failure
The build is integrated with other builds and the entire product is smoke tested daily
Daily testing gives managers and practitioners a realistic assessment of the progress of the integration testing
14
Validation Testing
Validation testing follows integration testing The distinction between conventional and object-oriented software disappears Focuses on user-visible actions and user-recognizable output from the system Demonstrates conformity with requirements Designed to ensure that
All functional requirements are satisfied All behavioral characteristics are achieved All performance requirements are attained Documentation is correct Usability and other requirements are met (e.g., transportability, compatibility, error recovery, maintainability)
A configuration review or audit ensures that all elements of the software configuration have been properly developed, cataloged, and have the necessary detail for entering the support phase of the software life cycle
15
Beta testing
Conducted at end-user sites Developer is generally not present It serves as a live application of the software in an environment that cannot be controlled by the developer The end-user records all problems that are encountered and reports these to the developers at regular intervals
After beta testing is complete, software engineers make software modifications and prepare for release of the software product to the entire customer base
16
Security testing
Verifies that protection mechanisms built into a system will, in fact, protect it from improper access
Stress testing
Executes a system in a manner that demands resources in abnormal quantity, frequency, or volume
Performance testing
Tests the run-time performance of software within the context of an integrated system Often coupled with stress testing and usually requires both hardware and software instrumentation Can uncover situations that lead to degradation and possible system failure
17
Test Characteristics
A good test has a high probability of finding an error
The tester must understand the software and how it might fail
19
White-box testing
Knowing the internal workings of a product, test that all internal operations are performed according to specifications and all internal components have been exercised Involves tests that concentrate on close examination of procedural detail Logical paths through the software are tested Test cases exercise specific sets of conditions and loops
20
White-box Testing
White-box Testing
Uses the control structure part of component-level design to derive the test cases These test cases
Guarantee that all independent paths within a module have been exercised at least once Exercise all logical decisions on their true and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity
23
24
7
9 11
10
25
The number of paths in the basis set is determined by the cyclomatic complexity
26
Cyclomatic Complexity
Provides a quantitative measure of the logical complexity of a program Defines the number of independent paths in the basis set Provides an upper bound for the number of tests that must be conducted to ensure all statements have been executed at least once Can be computed
V(G) = E N + 2, where E is the number of edges and N is the number of nodes in graph G
27
Using the design or code as a foundation, draw a corresponding flow graph Determine the cyclomatic complexity of the resultant flow graph Determine a basis set of linearly independent paths Prepare test cases that will force execution of each path in the basis set
28
3 4
5
6 8 10 9 11 7 16 17
14 15
16 17 18
13
12
14
15
29
30
3 4
6
12 15 16 18 20 21 13
7
9
10
31
Black-box Testing
Black-box Testing
Complements white-box testing by uncovering different classes of errors Focuses on the functional requirements and the information domain of the software Used during the later stages of testing after white box testing has been performed The tester identifies a set of input conditions that will fully exercise all functional requirements for a program The test cases satisfy the following:
Reduce, by a count greater than one, the number of additional test cases that must be designed to achieve reasonable testing Tell us something about the presence or absence of classes of errors, rather than an error associated only with the specific task at hand
33
34
35
Equivalence Partitioning
A black-box testing method that divides the input domain of a program into classes of data from which test cases are derived An ideal test case single-handedly uncovers a complete class of errors, thereby reducing the total number of test cases that must be developed Test case design is based on an evaluation of equivalence classes for an input condition An equivalence class represents a set of valid or invalid states for input conditions From each equivalence class, test cases are selected so that the largest number of attributes of an equivalence class are exercise at once
36
If an input condition requires a specific value, one valid and two invalid equivalence classes are defined
Input value: 250 Eq classes: {250}, {x < 250}, {x > 250}
If an input condition specifies a member of a set, one valid and one invalid equivalence class are defined
Input set: {-2.5, 7.3, 8.4} Eq classes: {-2.5, 7.3, 8.4}, {any other x}
If an input condition is a Boolean value, one valid and one invalid class are define
Input: {true condition} Eq classes: {true condition}, {false condition}
37
38
39