SOFTWARE TESTING
SOFTWARE TESTING Techniques
Overview
 Abstract
 Problem Definition
◦ Need for Software Testing?
◦ Infamous Error Case studies
◦ Software Bug and its Effects
 Literature Survey
 Black-Box Testing
 White-Box Testing
 Static Testing & Dynamic Testing
 Applying the testing methods
 Design for Implementation
 Conclusions
ABSTRACT
 Here, main testing methods and
techniques are shortly described
 General Classification is outlined: two
Testing methods-“Black-Box” and
“White-Box” Testing & their frequently
used techniques
PROBLEM DEFINITION
Need for Testing software:
• Software is everywhere. However it is
written by people- hence it’s not perfect.
Infamous software errors:
• 1.Disney’s Lion king:- failed as disney didn’t
test the game on different PC platforms.
• II.Intel Pentium Floating Point Division Bug:-
(4135835/3145727)*3145727-4135835
• The answer is zero, but old Intel CPU
didn’t give the right answer.
Problem Definition Contd.. (Software Bug and its
Effects)
 Any software failure
is called as a Bug
 Other terms used:
i. Defect
ii. Variance
iii. Fault
iv. Failure
v. Problem
vi. Inconsistency
vii. Error
viii. Feature
ix. Incident
x. Anomaly
Cost of Bugs
The Costs are logarithmic-
they increase by tenfold as
the time increases
Literature Survey
Goal of software tester[1]
“The goal if the software tester is to find bugs,
find them early, and make sure they are fixed as
soon as possible”
Software Testing Fundamentals[1]
 Testing the Specification.
Testing the Software with Blinders On
Examining the Code.
Testing the Software with X-Ray Glasses.
BLACK-BOX TESTING[5]
 Here tester knows only
what the software is
supposed to do(he
can’t look in the box to
see how it operates
 No access to software
code
 He a input, he
gets a certain output
but doesn’t how or
why it happens, just
that it does.
WHITE-BOX TESTING[5]
 Also called as clear
box testing
 Tester can see
inside the box ie.,
has access to
program’s code
STATIC & DYNAMIC TESTING[1]
• Refers testing to
something which is not
running-examining and
reviewing it.
STATIC
TESTING:-
• testing the software by
running it(normally what
we think of as testing).
DYNAMIC
TESTING:-
TESTING THE
SPECIFICATION[1]
 Also called Static Black-Box Testing.
 How is it Done??
Stati
c
BlackBo
x
• Pretend to be the Customer.
• Research Existing Standards & Guidelines.
• Review & Test Similar Software.
High level
Review
• Specification Attribute Checklist.
• Specification Terminology Checklist
Low level
Review
Attribute CheckList
1. Complete 2. Accurate 3. Precise, Unambigous, Clear
4. Consistent 5. Relevant 6. Feasible
Terminology CheckList
1. Always, Every, All, None, Never
2. Certainly, Therefore, Clearly
3. Some, Sometimes, Often, Usually,Etc., And So Forth, And So On,
Such As
4. 5.If…Then…(missing Else)
TESTING THE SOFTWARE
WITH BLINDERS ON[1]
 Also called as Dynamic Black-Box
Testing.
 How is it Done??
Dynami
c
BlackBo
x
 Data Testing:
1) Boundary Conditions:
2) Sub-Boundary Conditions:- (refers to internal boundaries)
3) Default, Empty, Blank, Zero or None.
4) Invalid, Incorrect, Wrong, Garbage.
 State Testing:
 Testing s/w logic flow(by creating state transition map).
int data[]=new int[5];
for(int i=1;i<5;i++)
data[i]=-1;
data[1]=-1
data[2]=-1
data[3]=-1 what about
data[0]???
data[4]=-1
EXAMINING THE CODE[1]
 Also called Static White Box testing
 How is it Done??
 What is to be done??
1. Formal
Reviews.
2. Peer Reviews.
3. WalkThroughs
4. Inspections.Coding Standards and Guidelines
Generic Code Review Checklist
Stati
c
Whitebox
TESTING THE SOFTWARE
WITH XRAY GLASSES[1]
 Also called as Dynamic White-Box
Testing
 How is it Done??
Code Coverage
◦ Statement Coverage
◦ Branch Coverage
◦ Condition Coverage
If Date=01-01-2000
Lines 1,2,3,4,5,6,7
If Date<>01-01-2000
Lines 1,2,5,6,7
Code Coverage
1. PRINT “Hello World”
2. IF Date$ = “01-01-2000”
THEN
3. PRINT “Happy New Year”
4. END IF
5. PRINT “The date is: “; Date$
6. PRINT “The time is: “; Time$
7. END
◦ Consider the following code
1. PRINT “Hello World”
2. IF Date$ = “01-01-2000” AND Time$ = “00:00:00”
THEN
3. PRINT “Happy New Year”
4. END IF
5. PRINT “The date is: “; Date$
6. PRINT “The time is: “; Time$
7. END
Date=01-01-0000
& Time=11:11:11
• Lines 1,2,5,6,7
Date=01-01-0000
& Time=00:00:00
:-
• Lines 1,2,5,6,7
Date=01-01-2000
& Time=11:11:11 :-
• Lines 1,2,5,6,7
Date=01-01-2000
& Time=00:00:00
• Lines
1,2,3,4,5,6,7
PRINT “Hello World”
Date=
01/01/2000
Time=
00:00:00
PRINT ”Happy New Year”
PRINT Date
PRINT Time
YES
YES
NO
NO
1
2
2
3
4
5
6
7
Condition 1 Condition 2
DFD Diagram
Check if
input is
proper
User
Sort the
input list
Enter a List of numbers
to be sorted
Return sorted list
Ask for re input
(improper)
Proper input
CONCLUSIONS
 Software testing is a component of software
quality control (SQC).
 If customers are dissatisfied with a product,
they will never recommend that product, so
product’s cost and its popularity at the market
will decrease.
 Eventual bugs and defects reduce
application functionality, do not look
vocational, and disturb company’s reputation.
 Hence, radically Testing is very important to
conduct.
 At that way, the defects can be discovered
and repaired.
REFERENCES
1. Ron Patton “Software Testing”
2. http://www.his.sunderland.ac.uk/~cs0mel/comm83wk5
.doc, February 08, 2009.
3. Stacey, D. A., “Software Testing Techniques”
4. Guide to the Software Engineering Body of
Knowledge, Swebok – A project of the IEEE Computer
Society Professional Practices Committee, 2004.
5. “Software Engineering: A Practitioner’s Approach, 6/e;
Chapter 14: Software Testing Techniques”,
R.S.Pressman & Associates, Inc., 2005.
6. Myers, Glenford J., IBM Systems Research Institute,
Lecturer in Computer Science, Polytechnic Institute of
New York, “The Art of Software Testing”, Copyright
1979. by John Wiley & Sons, Inc.
Thank you

Software testing

  • 1.
  • 2.
    Overview  Abstract  ProblemDefinition ◦ Need for Software Testing? ◦ Infamous Error Case studies ◦ Software Bug and its Effects  Literature Survey  Black-Box Testing  White-Box Testing  Static Testing & Dynamic Testing  Applying the testing methods  Design for Implementation  Conclusions
  • 3.
    ABSTRACT  Here, maintesting methods and techniques are shortly described  General Classification is outlined: two Testing methods-“Black-Box” and “White-Box” Testing & their frequently used techniques
  • 4.
    PROBLEM DEFINITION Need forTesting software: • Software is everywhere. However it is written by people- hence it’s not perfect. Infamous software errors: • 1.Disney’s Lion king:- failed as disney didn’t test the game on different PC platforms. • II.Intel Pentium Floating Point Division Bug:- (4135835/3145727)*3145727-4135835 • The answer is zero, but old Intel CPU didn’t give the right answer.
  • 5.
    Problem Definition Contd..(Software Bug and its Effects)  Any software failure is called as a Bug  Other terms used: i. Defect ii. Variance iii. Fault iv. Failure v. Problem vi. Inconsistency vii. Error viii. Feature ix. Incident x. Anomaly Cost of Bugs The Costs are logarithmic- they increase by tenfold as the time increases
  • 6.
    Literature Survey Goal ofsoftware tester[1] “The goal if the software tester is to find bugs, find them early, and make sure they are fixed as soon as possible” Software Testing Fundamentals[1]  Testing the Specification. Testing the Software with Blinders On Examining the Code. Testing the Software with X-Ray Glasses.
  • 7.
    BLACK-BOX TESTING[5]  Heretester knows only what the software is supposed to do(he can’t look in the box to see how it operates  No access to software code  He a input, he gets a certain output but doesn’t how or why it happens, just that it does.
  • 8.
    WHITE-BOX TESTING[5]  Alsocalled as clear box testing  Tester can see inside the box ie., has access to program’s code
  • 9.
    STATIC & DYNAMICTESTING[1] • Refers testing to something which is not running-examining and reviewing it. STATIC TESTING:- • testing the software by running it(normally what we think of as testing). DYNAMIC TESTING:-
  • 10.
    TESTING THE SPECIFICATION[1]  Alsocalled Static Black-Box Testing.  How is it Done?? Stati c BlackBo x • Pretend to be the Customer. • Research Existing Standards & Guidelines. • Review & Test Similar Software. High level Review • Specification Attribute Checklist. • Specification Terminology Checklist Low level Review Attribute CheckList 1. Complete 2. Accurate 3. Precise, Unambigous, Clear 4. Consistent 5. Relevant 6. Feasible Terminology CheckList 1. Always, Every, All, None, Never 2. Certainly, Therefore, Clearly 3. Some, Sometimes, Often, Usually,Etc., And So Forth, And So On, Such As 4. 5.If…Then…(missing Else)
  • 11.
    TESTING THE SOFTWARE WITHBLINDERS ON[1]  Also called as Dynamic Black-Box Testing.  How is it Done?? Dynami c BlackBo x  Data Testing: 1) Boundary Conditions: 2) Sub-Boundary Conditions:- (refers to internal boundaries) 3) Default, Empty, Blank, Zero or None. 4) Invalid, Incorrect, Wrong, Garbage.  State Testing:  Testing s/w logic flow(by creating state transition map). int data[]=new int[5]; for(int i=1;i<5;i++) data[i]=-1; data[1]=-1 data[2]=-1 data[3]=-1 what about data[0]??? data[4]=-1
  • 12.
    EXAMINING THE CODE[1] Also called Static White Box testing  How is it Done??  What is to be done?? 1. Formal Reviews. 2. Peer Reviews. 3. WalkThroughs 4. Inspections.Coding Standards and Guidelines Generic Code Review Checklist Stati c Whitebox
  • 13.
    TESTING THE SOFTWARE WITHXRAY GLASSES[1]  Also called as Dynamic White-Box Testing  How is it Done?? Code Coverage
  • 14.
    ◦ Statement Coverage ◦Branch Coverage ◦ Condition Coverage If Date=01-01-2000 Lines 1,2,3,4,5,6,7 If Date<>01-01-2000 Lines 1,2,5,6,7 Code Coverage 1. PRINT “Hello World” 2. IF Date$ = “01-01-2000” THEN 3. PRINT “Happy New Year” 4. END IF 5. PRINT “The date is: “; Date$ 6. PRINT “The time is: “; Time$ 7. END ◦ Consider the following code 1. PRINT “Hello World” 2. IF Date$ = “01-01-2000” AND Time$ = “00:00:00” THEN 3. PRINT “Happy New Year” 4. END IF 5. PRINT “The date is: “; Date$ 6. PRINT “The time is: “; Time$ 7. END Date=01-01-0000 & Time=11:11:11 • Lines 1,2,5,6,7 Date=01-01-0000 & Time=00:00:00 :- • Lines 1,2,5,6,7 Date=01-01-2000 & Time=11:11:11 :- • Lines 1,2,5,6,7 Date=01-01-2000 & Time=00:00:00 • Lines 1,2,3,4,5,6,7 PRINT “Hello World” Date= 01/01/2000 Time= 00:00:00 PRINT ”Happy New Year” PRINT Date PRINT Time YES YES NO NO 1 2 2 3 4 5 6 7 Condition 1 Condition 2
  • 15.
    DFD Diagram Check if inputis proper User Sort the input list Enter a List of numbers to be sorted Return sorted list Ask for re input (improper) Proper input
  • 16.
    CONCLUSIONS  Software testingis a component of software quality control (SQC).  If customers are dissatisfied with a product, they will never recommend that product, so product’s cost and its popularity at the market will decrease.  Eventual bugs and defects reduce application functionality, do not look vocational, and disturb company’s reputation.  Hence, radically Testing is very important to conduct.  At that way, the defects can be discovered and repaired.
  • 17.
    REFERENCES 1. Ron Patton“Software Testing” 2. http://www.his.sunderland.ac.uk/~cs0mel/comm83wk5 .doc, February 08, 2009. 3. Stacey, D. A., “Software Testing Techniques” 4. Guide to the Software Engineering Body of Knowledge, Swebok – A project of the IEEE Computer Society Professional Practices Committee, 2004. 5. “Software Engineering: A Practitioner’s Approach, 6/e; Chapter 14: Software Testing Techniques”, R.S.Pressman & Associates, Inc., 2005. 6. Myers, Glenford J., IBM Systems Research Institute, Lecturer in Computer Science, Polytechnic Institute of New York, “The Art of Software Testing”, Copyright 1979. by John Wiley & Sons, Inc.
  • 18.