Software Testing

29
Software Testing Benoy R Nair 12-Oct-2009 1 SOFTWARE TESTING

description

Objectives: 1. To understand software testing and its importance. 2. To understand the concepts of software quality. 3. To see the different classes/ levels/ types of testing. 4. To see the different test case design techniques. 5. To understand the software processes related to testing in a typical software organisation.

Transcript of Software Testing

Page 1: Software Testing

Software TestingBenoy R Nair 12-Oct-20091

SOFTWARE TESTING

Page 2: Software Testing

Objectives

2

� To understand software testing and its importance.

� To understand the concepts of software quality.

� To see the different classes/ levels/ types of testing.

� To see the different test case design techniques.

� To understand the software processes related to testing in a typical software organisation.

Software TestingBenoy R Nair 12-Oct-2009

Page 3: Software Testing

SOFTWARE TESTING

FUNDAMENTALS

3Software Testing

Benoy R Nair 12-Oct-2009

Page 4: Software Testing

What is ‘Testing’?

� Testing

– A process of evaluating a particular product to determine whether the product contains any defects.

� Software Testing

– A process of evaluating a system by manual or automatic means and verify that it satisfies specified requirements or identify differences between expected and actual results.

4Software Testing

Benoy R Nair 12-Oct-2009

Page 5: Software Testing

What is ‘Testing’?

� “Testing is the process of executing a program with

the intent of finding errors.”

� Testing is obviously concerned with errors, faults,

failures and incidents. A test is the act of exercising

software with test cases with an objective of

– Finding failure

– Demonstrate correct execution

5Software Testing

Benoy R Nair 12-Oct-2009

Page 6: Software Testing

Terminology

� Errors

� Faults

– Faults of commission

– Faults of omission

� Failures

� Incidents

� Test Cases

6Software Testing

Benoy R Nair 12-Oct-2009

Page 7: Software Testing

Why do we do ‘Testing’?

� Provide confidence in the system

� Identify areas of weakness

� Establish degree of quality

� Establish the extent that the requirements have been

met

� To provide an understanding of the whole system

� To prove that it is both usable and operable

� To provide sufficient information to allow an objective

decision on application to deploy

7Software Testing

Benoy R Nair 12-Oct-2009

Page 8: Software Testing

Basic Questions

� How much?

� What sort?

� By whom?

� When & by when?

8Software Testing

Benoy R Nair 12-Oct-2009

Page 9: Software Testing

SOFTWARE QUALITY

PRINCIPLES

9Software Testing

Benoy R Nair 12-Oct-2009

Page 10: Software Testing

Quality

� Meeting the Customer’s requirements in the First time and Every time

� Much more that absence of defects

� Allows us to meet customer expectations

10Software Testing

Benoy R Nair 12-Oct-2009

Page 11: Software Testing

Perspectives of Quality

� Transcendent

� Product based

� User based

� Development based

� Value based

11Software Testing

Benoy R Nair 12-Oct-2009

Page 12: Software Testing

Cost of Quality

� Cost of Prevention

� Cost of Appraisal

� Cost of Failure

12Software Testing

Benoy R Nair 12-Oct-2009

Page 13: Software Testing

Quality Assurance & Quality Control

� Quality Assurance

– Process oriented (software development)

– Defect prevention

� Quality Control

– Product oriented (quality of entire product is tested)

– Defect detention

13Software Testing

Benoy R Nair 12-Oct-2009

Page 14: Software Testing

SOFTWARE TESTING

CLASSIFICATIONS

14Software Testing

Benoy R Nair 12-Oct-2009

Page 15: Software Testing

Levels of Classification

� Based on Granularity

– Unit Level

– Integration Level

– System Level

� Based on Methodology

– Black Box (Functional) Testing

– White Box (Structural) Testing

15Software Testing

Benoy R Nair 12-Oct-2009

Page 16: Software Testing

Types of Testing (contd…)

� Regression Testing

� Acceptance Testing

� Sanity Testing

� Smoke Testing

� Stress Testing

16Software Testing

Benoy R Nair 12-Oct-2009

Page 17: Software Testing

Unit Testing

� Primary Goal

– To take the smallest piece of testable software in the application, isolate it from the remainder of the code, and determine whether it behaves exactly as you expect.

Each unit is tested separately before integrating

them into modules to test the interfaces between

modules. Unit testing has proven its value in that a large percentage of defects are identified during its

use.

17Software Testing

Benoy R Nair 12-Oct-2009

Page 18: Software Testing

Integration Testing

� A logical extension of unit testing.

� In its simplest form, two units that have already been

tested are combined into a component and the interface between them is tested.

� Approaches:

– Big Bang

– Bottom Up

– Top Down

– Sandwich

18Software Testing

Benoy R Nair 12-Oct-2009

Page 19: Software Testing

System Testing

� Conducted on a complete, integrated system to evaluate the system's compliance with its specified

requirements.

� Validate the software product against the

requirements specification.

� To find defects that can be exposed only by testing the entire system.

19Software Testing

Benoy R Nair 12-Oct-2009

Page 20: Software Testing

Functional (Black Box) Testing

� Inspects specified behavior

� Selects valid and invalid inputs and determines the

correct output.

� There is no knowledge of the test object's internal

structure

20Software Testing

Benoy R Nair 12-Oct-2009

Page 21: Software Testing

Structural (White Box) Testing

� Inspects programmed behavior

� Chooses test case inputs to exercise paths through

the code and determines the appropriate outputs

� Requires programming skills to identify all paths

through the software

21Software Testing

Benoy R Nair 12-Oct-2009

Page 22: Software Testing

Regression Testing

� Any type of software testing that seeks to uncover software regressions.

– Test fixed bugs promptly.

– Watch for side effects of fixes.

– Write a regression test for each bug fixed.

– Identify tests that the program consistently passes and archive them.

– Focus on functional issues, not those related to design.

– Make changes (small and large) to data and find any resulting corruption.

– Trace the effects of the changes on program memory.

22Software Testing

Benoy R Nair 12-Oct-2009

Page 23: Software Testing

Acceptance Testing

� Objective

– To provide confidence that the delivered system meets the business requirements of both sponsors and users

� By System Provider

� By Customer (UAT/ End User Testing)

23Software Testing

Benoy R Nair 12-Oct-2009

Page 24: Software Testing

Types of Testing (contd…)

� Sanity Testing

� Smoke Testing

� Stress Testing

24Software Testing

Benoy R Nair 12-Oct-2009

Page 25: Software Testing

TEST CASES & DESIGN TECHNIQUES

TECHNIQUES

25Software Testing

Benoy R Nair 12-Oct-2009

Page 26: Software Testing

What is a “Test Case”?

� Triplet [I, S, O] where

– I is the Input data

– S is the state of the system at which the data will be input

– O is the expected output

� Not randomly selected, but need to be carefully

designed.

� Test Suite

– Set of all test cases

26Software Testing

Benoy R Nair 12-Oct-2009

Page 27: Software Testing

Need for designing test cases

� Extremely large input data domain making exhaustive testing impractical

� Randomly selected test cases do not ensure completeness and may also bring in redundancy

� Number of test cases do not determine effectiveness

� Each test case should detect different errors

27Software Testing

Benoy R Nair 12-Oct-2009

Page 28: Software Testing

Test Case Design Techniques

� White Box Testing

– Control flow testing

– Data flow testing

– Branch testing

� Black Box Testing

– Equivalence class partitioning

– Boundary value analysis

– Comparison testing

– Orthogonal array testing

– Decision table based testing & Cause effect graph

28Software Testing

Benoy R Nair 12-Oct-2009

Page 29: Software Testing

Summary

� Testing: Integral part of software development function

– Starts with the requirements not code.

– Prevention is better than cure.

– The sooner you find the fault the cheaper it is to fix it.

– Create re-usable ‘testware’.

– Process first then tools.

– Not everyone can test well; use professional testers.

– Planned testing in a controlled environment provides objective metrics.

– To gain Return on Investment you must invest first.

29Software Testing

Benoy R Nair 12-Oct-2009