Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test...

28
Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution domain, against the expected behavior

Transcript of Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test...

Page 1: Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution.

Chapter 11: Testing

The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution domain, against the expected behavior

Page 2: Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution.

Testing Fundamentals

Testing is the one step in software engineering process that could be viewed as destructive rather than constructive. A successful test is one that breaks the software.

A successful test is one that uncovers an as yet undiscovered defect.

Testing can not show the absence of defects, it can only show that software defects are present.

For most software exhaustive testing is not possible.

Page 3: Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution.

Testing Unit testing

White-box Code walkthroughs and inspections

Integration testing Bottom-up Top-down Sandwich Big Bang

Functional testing (black-box) Performance testing Acceptance testing Installation testing

Page 4: Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution.
Page 5: Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution.

System testing

Functional testing Performance testing Acceptance testing Installation testing

Page 6: Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution.

System Testing Process

Functional testing: does the integrated system perform as promised by the requirements specification?

Performance testing: are the non-functional requirements met?

Page 7: Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution.

Functional Testing

Test cases derived from requirements specification document Black box testing Independent testers Test both valid and invalid input and the

success of the test is determined by the produced output

Equivalence partitioning Boundary values

Page 8: Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution.

Equivalence partitioning

Reduces the number of test cases to a necessary minimum and select the right test cases to cover all possible scenarios

Example: method accepts an int value for month (1..12) as a parameter

Page 9: Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution.

Performance Testing

Stress tests Volume tests Recovery tests Security tests Timing tests

Environmental tests Quality tests Maintenance tests Documentation tests Human factors

(usability) tests

Page 10: Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution.

Acceptance Tests

Enable the customers and users to determine if the built system meets their needs and expectations

Written, conducted, and evaluated by the customers

Page 11: Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution.

Types of Acceptance Tests

Pilot test: install on experimental basis

Alpha test: in-house test Beta test: customer pilot Parallel testing: new system operates

in parallel with old system

Page 12: Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution.

Installation test

Does the system run at the customer site(s)?

Page 13: Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution.

System Testing

Page 14: Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution.

Pop quiz

How does system testing differ from unit and integration testing?

How does unit testing differ from integration testing?

Page 15: Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution.

In a method, a variable did not get initialized properly.

Which type of testing would most likely expose this defect?

A. Unit testingB. Integration testingC. Functional testingD. Performance testingE. Acceptance testingF. Installation testing

Page 16: Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution.

A gas pump system is supposed to allow the user to choose whether or not a receipt is printed, but the print function has not been implemented.

Which type of testing is most likely to expose this defect?

A. Unit testingB. Integration testingC. Functional testingD. Performance testingE. Acceptance testingF. Installation testing

Page 17: Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution.

A configuration file used by the reporting subsystem is not placed in the correct directory in the customer's environment.

Which type of testing is most likely to expose this defect?

A. Unit testingB. Integration testingC. Function testingD. Performance testingE. Acceptance testingF. Installation testing

Page 18: Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution.

The customer is unhappy with the number of screens that must be traversed before getting to the parts list screen, a screen accessed frequently when using the system.

Which type of testing is most likely to expose this defect?

A. Unit testingB. Integration testingC. Function testingD. Performance testingE. Acceptance testingF. Installation testing

Page 19: Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution.

Short answer question

What is the difference between verification and validation testing?

Page 20: Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution.

Test Documentation Test plan: describes system and plan for

testing all functions and characteristics Test case specification: details each test

and defines criteria for evaluating each feature

Test incident report: results of each test Test report summary: lists all failures

from the tests that need to be investigated

Page 21: Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution.

Test Plan (part of 480 QA plan)

Define the subsystems to be tested (and not tested)

Describe the process to follow for unit, integration, system, and acceptance testing

List the test cases

Plan the test schedule

Page 22: Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution.

Test Documentation

Page 23: Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution.

Defect Tracking Form

Page 24: Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution.

Regression Testing

Identifies new faults that may have been introduced as current ones are being corrected

Verifies that a new version or release still performs the same functions in the same manner as an older version or release

Page 25: Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution.

Quality Assurance concerns

Software reliability: operating without failure under given condition for a given time interval

Software availability: operating successfully according to specification at a given point in time

Software maintainability: for a given condition of use, a maintenance activity can be carried out within stated time interval, procedures and resources

Page 26: Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution.

Testing Safety-Critical Systems Recognize that testing cannot remove all faults

or risks

Assume that every mistake users can make will be made Do not assume that low-probability, high-

impact events will not happen

Emphasize requirements definition, testing, code and specification reviews, and configuration control Cleanroom testing

Page 27: Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution.

Different Levels of Failure Severity

Catastrophic: causes death or system loss Critical: causes severe injury or major

system damage Marginal: causes minor injury or minor

system damage Minor: causes no injury or system damage

Page 28: Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution.

One-minute quiz

What is meant by regression testing?

Is regression testing used for verification or validation?