Top Banner
Testing Basics of Testing Presented by: Vijay .C.G – Glister Tech
48
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Testing

Basics of Testing

Presented by:Vijay .C.G – Glister Tech

Page 2: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Software Reliability

• Probability that a software system will not deviate from the required behavior for a specified time under specified conditions

• Reliability enhancing techniques– Fault avoidance– Fault detection– Fault tolerance

Page 3: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Fault Avoidance

• Development methodologies– Avoid faults by minimizing their introduction

into models and code

• Configuration management– Avoid faults by minimizing undisciplined

changes to the models

• Verification techniques– Only useful for simple software projects

• Code reviews

Page 4: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Fault Detection

• Debugging– Correctness debugging– Performance debugging

• Testing– Component testing– Integration testing– System testing

Page 5: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Fault Tolerance

• Allows a system to recover in the case of failure– Atomic transactions– Modular redundancy

Page 6: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

What Is Testing?

1. The process of demonstrating that errors are not present

2. The systematic attempt to find errors in a planned way

Page 7: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Concepts

• Component• Fault• Error• Failure

• Test case• Test stub• Test driver• Correction

Page 8: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Component

• Part of the system that can be isolated for testing– Function(s)– Object(s)– Subsystem(s)

Page 9: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Fault

• Design or coding mistake that may cause abnormal component behavior

• A.K.A. bug or defect

Page 10: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Error

• A manifestation of a fault during the execution of the system

Page 11: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Failure

• A deviation between the specification of a component and its behavior– Caused by one or

more errors

Page 12: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Test Case

• A set of inputs and expected results that exercises a component

Page 13: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Test Case (Cont.)

Page 14: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Test Stub and Driver

• Stub provides a partial implementation of components on which the tested component depends

• Driver provides a partial implementation of a component that depends on the tested component

Page 15: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Test Stub and Driver (Cont.)

d rawC irc le () d rawS quare()

d rawS hap e()

m a in ()

Page 16: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Correction

• A change made to a component in order to repair a fault– May introduce additional faults– New faults can be used to handle new

faults• Problem tracking• Regression Testing• Rationale Maintenance

Page 17: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Testing Activities

• Inspecting components• Unit testing• Integration testing• System testing

Page 18: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Inspecting Components

• Code reviews find faults in components

• Can be formal or informal• Can be more effective than testing,

but finds different types of faults• Can be time consuming

Page 19: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Inspecting Components (Cont.)

• Fagan’s Inspection Method– Overview

• Author presents purpose and scope of component

– Preparation• Reviewers become familiar with implementation

– Inspection meeting• Recommendations are presented

– Rework– Follow up

Page 20: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Inspecting Components (Cont.)

• Active Design Review– Similar to Fagan’s method

• Less formal

– Not all reviewers need to be involved– Reviewers make recommendations during

the preparation phase– There is no inspection meeting

• Author meets with reviewers individually if at all• Reviewers fill out questionnaires

Page 21: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Unit Testing

• Equivalence testing• Boundary testing• Path testing• State testing

Page 22: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Equivalence Testing

• Black box technique• Possible inputs are partitioned into

equivalence classes• A typical input and an invalid input

are selected for each class• Test cases are written using the

input values selected

Page 23: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Equivalence Testing (Cont.)

• Class1 (31 day months) (1, 3, 5, 7, 8, 10, 12)• Class2 (30 day months) (4, 6, 9, 11)• Class3 (February)• Class4 (Leap years)• Class5 (Non leap years)

Page 24: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Boundary Testing

• Special case of equivalence testing• Deals with boundary conditions

and special cases• Detects “off by one” and “fence

post” faults

Page 25: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Path Testing

• White box technique• Every path is exercised

• Unable to detect omissions• Does not work well for object oriented

programs– Polymorphism makes paths dynamic– Shorter, related functions must be tested

together

Page 26: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

State Testing

• Designed to work with object oriented systems

• Compares the resulting state of the system with the expected state

• Currently not used in practice– Lengthy test sequences required to put

objects in desired state– Not yet supported by automated testing

tools

Page 27: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Integration Testing

• Big bang testing• Bottom-up testing• Top-down testing• Sandwich testing

Page 28: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Big Bang Testing

• All components unit tested first• All components integrated and

tested as a whole• Requires no stubs or drivers• Difficult to pinpoint cause of failure

– Unable to distinguish failures in the interface from failures inside the components

Page 29: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Bottom-Up Testing

• Lower level components tested first

• Lower level components are integrated with components from the next level

• Process continues until all levels have been integrated

d rawC irc le () d rawS quare()

d rawS hap e()

m a in ()

Page 30: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Top-Down Testing

• Upper level components tested first

• Upper level components are integrated with components from the next level

• Process continues until all levels have been integrated

d rawC irc le () d rawS quare()

d rawS hap e()

m a in ()

Page 31: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Sandwich Testing

• Combines bottom-up and top-down testing strategies

• System is divided into three layers– Top layer is unit tested, and then top-down

integration testing commences– Bottom layer is unit tested, and then bottom-

up integration testing commences

• Test stubs and drivers not needed for the top and bottom layers

• Does not adequately test the target layer

Page 32: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Sandwich Testing (Cont.)

Page 33: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Modified Sandwich Testing

• Each layer is unit tested first– Top layer uses stubs for the target layer– Target layer uses drivers for the top layer,

and stubs for the bottom layer– Bottom layer uses drivers for the target

layer

• Bottom-up and top-down testing can then reuse the test cases that were used in the individual layer tests

Page 34: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Modified Sandwich Testing (Cont.)

Page 35: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

System Testing

• Functional testing• Performance testing• Pilot testing• Acceptance testing• Installation testing

Page 36: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Functional Testing

• Tests the functional requirements specified in the RAD

• Black box technique– Test cases are derived from the use

cases.

• Test cases should exercise both common and exceptional behavior

Page 37: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Performance Testing

• Tests the design goals specified during system design, and the nonfunctional requirements in the RAD

• Types of Performance Testing– Stress Testing– Volume Testing– Security Testing– Timing Tests– Recovery Tests

Page 38: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Pilot Testing

• A selected set of users installs and tests the system

• Phases– Alpha test

• System is tested in the development environment

– Beta test• System is tested in the target environment

Page 39: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Acceptance Testing

• Benchmark tests• Competitor tests

– New system is tested against an existing system or a competitor’s product

• Shadow tests– Both the new system and the old

system are run in parallel and results compared

Page 40: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Installation Testing

• Performed in the target environment

• Repeats the test cases that were run during functional and performance testing

Page 41: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Managing Testing

• Planning• Documenting• Assigning responsibilities

Page 42: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Test Planning

• Test cases should be developed early– As soon as their models become stable– Tests must be changed when the models

change

• Parallelize tests whenever possible– Component tests should all run at the same

time– Integration tests can start when some

components tests have passed

Page 43: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Documentation

• Test Plan– Documents scope, approach,

resources, and schedule of testing process

• Test Case Specification– Contains the input, drivers, stubs, and

expected results– Documents test procedure

Page 44: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Documentation (Cont.)

Page 45: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Documentation (Cont.)

Page 46: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Documentation (Cont.)

• Test Incident Report– Records the differences between the

actual output and the expected output or each execution of a test case

• Test Summary Report– Lists all failures discovered during

testing

Page 47: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Assigning Responsibilities

• Testers should not be the same developers who built the system

• Dedicated testing teams are used when there are stringent quality requirements

• Subsystem teams can test subsystems developed by other teams when there are not stringent quality requirements

Page 48: Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.

Questions?

Please Reach – Glister Tech Family…..