Вы находитесь на странице: 1из 55

UNIT 3

TESTING
PREPARED BY : HETA J DESAI - BCA -SDJIC

TESTING
Testing is executing a program with an indent
to finding error/fault and failure.
IEEE defines testing as An examination of the
behavior of the program by executing on
sample data set.

PREPARED BY : HETA J DESAI - BCA -SDJIC

OBJECTIVES
Uncover as many as errors (or bugs) as possible in a given product.
Demonstrate a given software product matching its requirement
specifications.

Validate the quality of a software testing using the minimum cost


and efforts.
Generate high quality test cases, perform effective tests, and
issue correct and helpful problem reports.

PREPARED BY : HETA J DESAI - BCA -SDJIC

Error, Bug, Fault & Failure


Error : It is a human action that produces the incorrect
result that produces a fault.
Bug : The presence of error at the time of execution of
the software.

Fault : State of software caused by an error.


Failure : Deviation of the software from its expected
result. It is an event.

PREPARED BY : HETA J DESAI - BCA -SDJIC

Testing Principles
Davis suggests a set of testing principles.
1. All tests should be traceable to customer
requirements. As we have seen, the objective
of software testing is to uncover errors. It
follows that the most severe defects (from
the customers point of view) are those that
cause the program to fail to meet its
requirements.
PREPARED BY : HETA J DESAI - BCA -SDJIC

. Tests should be planned long before


testing begins. Test planning can
begin as soon as the requirements
model is complete. All tests can be
planned and designed before any
code has been generated

PREPARED BY : HETA J DESAI - BCA -SDJIC

3.The Pareto principle applies to software


testing. Stated simply, the Pareto principle
implies that 80 percent of all errors
uncovered during testing will likely be
traceable to 20 percent of all program
components. The problem, of course, is to
isolate [separate] these suspect components
and to thoroughly test them.

PREPARED BY : HETA J DESAI - BCA -SDJIC

4.Testing should begin in the small and


progress toward testing in the large. The
first tests planned and executed generally
focus on individual components. As testing
progresses, focus shifts in an attempt to find
errors in integrated clusters of components
and ultimately in the entire system.

PREPARED BY : HETA J DESAI - BCA -SDJIC

5.Exhaustive (COMPLETE) testing is not


possible. The number of path combinations
for even a moderately sized program is
exceptionally large. For this reason, it is
impossible to execute every combination of
paths during testing. It is possible, however,
to adequately [satisfactorily] cover program
logic and to ensure that all conditions in the
component-level
design
have
been
exercised.
PREPARED BY : HETA J DESAI - BCA -SDJIC

6.

To be most effective, testing should be


conducted by an independent third party.
By most effective, we mean testing that
has the highest probability of finding
errors (the primary objective of testing).

PREPARED BY : HETA J DESAI - BCA -SDJIC

10

Testing Fundamental

Error, Fault and Failure


Test oracle
Test Plan
Test Case
Defect logging and tracking
Defect analysis and prevention
Metrics Reliability Estimation

PREPARED BY : HETA J DESAI - BCA -SDJIC

11

1.Error fault and failure


Error can be identified as the difference between
calculated observed or measured values and the
actual or theatrically correct value.
Fault can be characterized as circumstances that
cause the software to fail to execute its required
function
Failure is the inability of software or module to
execute required function according to its
speficification
PREPARED BY : HETA J DESAI - BCA -SDJIC

12

2.Test oracle
Test oracle is a method, different from
program itself, that is use to test out the
output produced by any program or module
for test cases. Test oracle are essential for
testing.
As testing any program or module test case
are submitted to oracle and program under
testing. The output of two is than compared
PREPARED BY : HETA J DESAI - BCA -SDJIC

13

3.Test plan
It is a document that describes the objectives ,
scope , approach and focus of software testing
effort.
Test plan are formed using following inputs :
1.Project plan
2.Requirement Document
3.Software design Document

PREPARED BY : HETA J DESAI - BCA -SDJIC

14

4.Test Case
IEEE defines test case as set of input values,
execution precondition ,expected result and
execution post conditions developed for a
particular objective or test condition , such as
to exercise a particular program path or to
verify compliance with a specific requirement.

PREPARED BY : HETA J DESAI - BCA -SDJIC

15

Test case specifications essential part


Test case specification identifier : Unique identifier of
document
Test item : Identifies item and feature to be tested
Input specification : Details of each input to test case
Output specification : Expected output specification
Environmental needs :Hardware ,software required
for execution of particular test case.

PREPARED BY : HETA J DESAI - BCA -SDJIC

16

5.Defect logging and tracking


Defect life cycle consist of three stage :
Submitted : When defect is found the first action is to
log in to defect along with sufficient information
about it.It is submitted stage
Fixed : Fixing defect job is assigned to some one.Person
debugs and fixes this is how defect enters in to fixed
state.
Closed : Once defect fixing is verified than defect can
be marked as fixed
PREPARED BY : HETA J DESAI - BCA -SDJIC

17

6.Defect analysis and prevention

It used to improve quality and


productivity.
Pareto Analysis

PREPARED BY : HETA J DESAI - BCA -SDJIC

18

Matrics :Reliability estimation


MTBF- Mean time between failures

PREPARED BY : HETA J DESAI - BCA -SDJIC

19

TESTING PROCESS

PREPARED BY : HETA J DESAI - BCA -SDJIC

20

Testing strategies

PREPARED BY : HETA J DESAI - BCA -SDJIC

21

Levels of testing

PREPARED BY : HETA J DESAI - BCA -SDJIC

22

Black box testing


requirements
output

input
events

PREPARED BY : HETA J DESAI - BCA -SDJIC

23

White box testing


Test data

Tests

Derives
Component
code

PREPARED BY : HETA J DESAI - BCA -SDJIC

Test
outputs

24

White Box testing


It is known as glass box testing or structural
testing. It deals with testing the internal
program logic. For this technique tester should
have a detailed knowledge of the program
code and the reason for which it is developed.

PREPARED BY : HETA J DESAI - BCA -SDJIC

25

Purpose of white box testing

Testing all loops


Testing basis path
Testing conditional statement
Testing data structures
Testing logical errors
Testing incorrect assumptions
PREPARED BY : HETA J DESAI - BCA -SDJIC

26

Advantages of white box


It concentrates on examination of coding
It uncovers typographical errors.
Detects design errors.

PREPARED BY : HETA J DESAI - BCA -SDJIC

27

Disadvantages
Do not full fill all testing goals since it only
focus on examination of code.
Many other system problems may left out
Test case needs to be changed for
implementation of changes

PREPARED BY : HETA J DESAI - BCA -SDJIC

28

Basis Path testing

In this testing test cases are to be


generated by software tester in order to
develop a logical complexity measures of
procedural designs.

PREPARED BY : HETA J DESAI - BCA -SDJIC

29

Creating control flow graph


It is used to show the logical control flow with
in program.

PREPARED BY : HETA J DESAI - BCA -SDJIC

30

Independent path
A path through the program which specifies a
new condition or a minimum of a one new set
of processing statement is known as
independent path.

PREPARED BY : HETA J DESAI - BCA -SDJIC

31

Cyclomatic Complexity
It is used to calculate number of independent
path present in the program. It is software
matric that provides a quantitative measures
of the logical complexity of the program.

PREPARED BY : HETA J DESAI - BCA -SDJIC

32

Flow graph matrix


It can be defined as a data structure
which represents the flow graph of a
program in tabular form.I.E : Logical
structure and loops

PREPARED BY : HETA J DESAI - BCA -SDJIC

33

Control structure testing


It is used to improve the coverage area
by testing various control structure of the
program code.

PREPARED BY : HETA J DESAI - BCA -SDJIC

34

Condition testing
All logical condition contained in the program
module should be tested. It examines logical
conditions.
EX : <,>,AND ,OR

PREPARED BY : HETA J DESAI - BCA -SDJIC

35

Data flow testing


It is test design method in which test cases are
designed to implement definition and uses of
variables in the program.
LOOP Testing : It is used to test out the validity
of loops present in the program modules.

PREPARED BY : HETA J DESAI - BCA -SDJIC

36

1.Simple loop : It means a loop that has no other loop.


2.Nested loop : Loop within loops are nested loop.
3.Concatenated loop : It means loop which contain
several loops that may or may not depend on each
other.
4.Unstructured loop : Unstructured type of loop must
be redesigned so that the use of structure
programming contracts is reflected.

PREPARED BY : HETA J DESAI - BCA -SDJIC

37

2.Black Box testing


It is also known as behavioral testing focuses
on functional requirement of the software.
It is not an alternative to white box technique
, But it is complementary approach that is
likely to uncover a different class of errors
than white box matters.

PREPARED BY : HETA J DESAI - BCA -SDJIC

38

Category of errors
In correct or missing functions
Interface errors
Errors in data structure or external
database access
Behavioral performance error
Initialization and termination errors
PREPARED BY : HETA J DESAI - BCA -SDJIC

39

Advantages
Tester can be non-technical
Used to verify contradiction in actual
statement and specifications

PREPARED BY : HETA J DESAI - BCA -SDJIC

40

Disadvantages
Test input needs to be from large sample
space
Difficult to identify all possible inputs

PREPARED BY : HETA J DESAI - BCA -SDJIC

41

Techniques of black box testing


Equivalence class
Boundary value analysis
Error guessing

PREPARED BY : HETA J DESAI - BCA -SDJIC

42

Equivalence Class
It divides the input domain of program in to
classes of data from which test cases can be
derived.
It labels classes as valid and invalid inputs
EX : Area code : Blank or three digit no only
Password : six digit alphanumeric string

PREPARED BY : HETA J DESAI - BCA -SDJIC

43

Boundary Value Analysis


BVA is a test functional testing technique
where extreme boundary values are
chosen .
Boundary values includes maximum
,minimum, Just inside, typical values and
error values.

PREPARED BY : HETA J DESAI - BCA -SDJIC

44

Error guessing
This is simply based on prior experience and
judgment of tester.
Guessing is the art of guessing where error
can be hidden

PREPARED BY : HETA J DESAI - BCA -SDJIC

45

Verification vs Validation

Verification: The software should confirm to its


specification (Are we building the product right?)

Validation: The software should do what the user really


requires (Are we building the right product?)

PREPARED BY : HETA J DESAI - BCA -SDJIC

46

Unit Testing
It is a level of the software testing
process where individual
units/components of a software/system
are tested. The purpose is to validate
that each unit of the software performs
as designed.

PREPARED BY : HETA J DESAI - BCA -SDJIC

47

PREPARED BY : HETA J DESAI - BCA -SDJIC

48

Unit Testing benefits


Developers looking to learn what functionality is provided by a unit and
how to use it can look at the unit tests to gain a basic understanding of the
unit API.
Unit testing allows the programmer to refractor code at a later date, and
make sure the module still works correctly (i.e. Regression testing).
The procedure is to write test cases for all functions and methods so that
whenever a change causes a fault, it can be quickly identified and fixed.

Due to the modular nature of the unit testing, we can tests parts of project
without waiting for others to be completed.

PREPARED BY : HETA J DESAI - BCA -SDJIC

49

Unit Testing Limitations


Unit testing cant be expected to catch every error in a
program. It is not possible to evaluate all execution paths
even in the most trivial programs
Unit testing by its very nature focuses on a unit of code.
Hence it cant catch integration errors or broad system
level errors.

PREPARED BY : HETA J DESAI - BCA -SDJIC

50

Integration Testing
The testing of combined parts of
an application to determine if
they function correctly together
is Integration Testing.

PREPARED BY : HETA J DESAI - BCA -SDJIC

51

Need of Integration Testing:


Although each software module is unit tested, defects still exist for various
reasons like:
1. A Module in general is designed by an individual software developer who
understanding and programming logic may differ from other
programmers. Integration testing becomes necessary to verify the
software modules work in unity
2. At the time of module development, there wide chances of change in
requirements by the clients. These new requirements may not be unit
tested and hence integration testing becomes necessary.
3. Interfaces of the software modules with the database could be erroneous
4. External Hardware interfaces, if any, could be erroneous
5. Inadequate exception handling could cause issues.

PREPARED BY : HETA J DESAI - BCA -SDJIC

52

two methods of doing Integration Testing,


Bottom-Up Integration testing begins with unit testing, followed by tests of
progressively higher-level combinations of units called modules or builds.
Top-Down Integration testing, the highest-level modules are tested first
and progressively lower-level modules are tested after that.

PREPARED BY : HETA J DESAI - BCA -SDJIC

53

SYSTEM TESTING
The system as a whole is tested to uncover
requirement errors.
Verifies that all system elements work properly
and that overall system function and
performance has been achieved.
Types:
Alpha Testing
Beta Testing
Acceptance Testing
Performance Testing

PREPARED BY : HETA J DESAI - BCA -SDJIC

54

* Alpha Testing
It is carried out by the test team within the developing organization
* Beta Testing
It is performed by a selected group of friendly customers.
* Acceptance Testing
It is performed by the customer to determine whether to accept or
reject the delivery of the system.
* Performance Testing
It is carried out to check whether the system meets the nonfunctional
requirements identified in the SRS document.
PREPARED BY : HETA J DESAI - BCA -SDJIC

55

Вам также может понравиться