Title: CIS 4932 Software Testing Testing Concepts
1CIS 4932Software TestingTesting Concepts
2Purpose
This module presents the basic concepts of
software testing. We present several aspects of
software testing, and a give a generic lifecycle.
" arbitrarily selected test set ... results in
inefficient testing, leaving some functions
untested while performing redundant testing of
others." Darlene Mackay, Quality Consultants
Unlimited
3Agenda
4WHAT IS TESTING?
- Executing software to determine whether it
meets its specification - Executing a software element to discover defects
or anomalies - Executing software to evaluate its behavior in
different environments - Inspecting software element code to discover
defects or anomalies.
5TESTING IS HARD
- Exhaustive testing is impossible
- Software is complex
- Specifying requirements is hard
- Testing is a fallible, human process
- Consequences of failure not always understood in
advance
6WORKING SMART
- Test small pieces
- Use proven techniques
- Use tools to advantage
- Start early
- Cost of errors grows exponentially with time they
go undetected
7Agenda
8A TESTING LIFECYCLE
Analysis
Design
9TESTING vs DEVELOPMENT
- Work broken into stages
- Require similar skills
- Require management oversight
- Produce artifacts used to assess quality of the
work - Test artifacts are overhead, not part of
delivered system.
10TEST ARTIFACTS
- Strategy/Plan (must know techniques)
- Test cases central artifacts
- Test machinery to apply test cases
- Data showing results
- Reports that interpret test results
- List of problems/defects to be fixed.
11TESTING IS HIERARCHICAL
- Unit testing smallest components
- Aggregate testing assemblies of units
- Integration testing combinations of assemblies
- System testing system built from assemblies
12TESTING OBJECTIVES
- To demonstrate conformance
- To find defects
- To measure behavior in specific environments
- Load / stress testing
- Performance testing
- To measure trustworthiness/reliability
13Agenda
14REQUIRED ELEMENTS OF A TESTING METHODOLOGY?
- Specification for the software
- Process for designing test cases
- Repeatable process for designing, running and
evaluating tests - Accountable artifacts of testing activities
- Economical use of human, time and computing
resources
15Agenda
16BLACK-BOX TESTING
Stimuli
Response(s)
- Testing based on the specification rather than
the implementation. - Specification defines the expected response(s) to
stimuli
17BLACK-BOX TECHNIQUES
- Functional testing -- tests the behavior of the
software. - Boundary testing -- tests behavior at the
lower/upper bounds of input values - Random testing -- tests using randomly generated
stimuli - Intuitive (ad hoc) testing -- error guessing
18FUNCTIONAL TEST DESIGN METHODOLOGY
- Specification
- Identify behaviors
- Develop test cases
- Write test script
19EXAMPLE A(1) Specification
- Compute pay for an hourly employee, given the
number of hours worked and the hourly pay rate.
Compute overtime at 1.5 times hourly rate for
hours in excess of 40.
20EXAMPLE A(2) Identify Behaviors
- Case 1 No overtime (Hours lt 40)
- Expect Pay Hours Rate
- Case 2 Overtime (Hours gt 40)
- Expect Pay 40Rate1.5Rate(Hours - 40)
21EXAMPLE A(3) Create Test Cases
- Case 1 No overtime (Hours lt 40)
- Use Rate 10, Hours 30
- Expect Pay Hours Rate 300
- Case 2 Overtime (Hours gt 40)
- Use Rate 10, Hours 50
- Expect Pay 40Rate1.5Rate(Hours - 40)
- 550
22EXAMPLE A(4) Write Test Script
23A MORE COMPLEX EXAMPLE (B)
- Increased number of behaviors
- Use of decision table to document behaviors
- Test case generation from decision table
24EXAMPLE B(1) Specification
- Compute pay for employee, given the number of
hours worked and the hourly pay rate. For hourly
employees (rate lt 30), compute overtime at 1.5
times hourly rate for hours in excess of 40.
Salaried employees (rate gt 30) are paid for
exactly 40 hours.
25EXAMPLE B(2) Identify Behaviors
- Case 1 Hourly AND No overtime
- (Rate lt 30) (Hours lt 40)
- Expect Pay Hours Rate
- Case 2 Hourly AND Overtime
- (Rate lt 30) (Hours gt 40)
- Expect Pay 40Rate1.5Rate(Hours - 40)
- Case 3 Salaried (Rate gt 30)
- Expect Pay 40 Rate
26DECISION TABLE
Columns define Behaviors
27EXAMPLE B(3) Create Test Cases
- One test case per column of decision table
- Case 1 Hourly, No Overtime
- Case 2 Hourly, Overtime
- Case 3 Salaried, No Extra Hours
- Case 4 Salaried, Extra Hours
- Order the test cases by column
28EXAMPLE B(4) Write Test Script
29RULES -- DECISION TABLES
Use 'Y', 'N', '-' or space
30NEXT TIME
- Test Case Generation Strategies
- Documenting the Test
- Specification Techniques