CSC 395 – Software Engineering Lecture 27: White-Box Testing.

Slides:



Advertisements
Similar presentations
Software Testing Technique. Introduction Software Testing is the process of executing a program or system with the intent of finding errors. It involves.
Advertisements

Software Testing. Quality is Hard to Pin Down Concise, clear definition is elusive Not easily quantifiable Many things to many people You'll know it when.
Annoucements  Next labs 9 and 10 are paired for everyone. So don’t miss the lab.  There is a review session for the quiz on Monday, November 4, at 8:00.
CMSC 345, Version 11/07 SD Vick from S. Mitchell Software Testing.
Creator: ACSession No: 13 Slide No: 1Reviewer: SS CSE300Advanced Software EngineeringFebruary 2006 Testing - Techniques CSE300 Advanced Software Engineering.
Chapter 17 Software Testing Techniques
TESTING LOOPS ● Simple Loops ● Nested Loops ● Concatenated Loops ● Unstructured Loops.
Software Testing and Quality Assurance
1 “White box” or “glass box” tests “White Box” (or “Glass Box”) Tests.
1 Software Testing and Quality Assurance Lecture 30 - Introduction to Software Testing.
Illinois Institute of Technology
IMSE Week 18 White Box or Structural Testing Reading:Sommerville (4th edition) ch 22 orPressman (4th edition) ch 16.
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
CS 425/625 Software Engineering Software Testing
Testing an individual module
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
Software Engineering Lecture 12 Software Testing Techniques 1.
Chapter 13 & 14 Software Testing Strategies and Techniques
Software Systems Verification and Validation Laboratory Assignment 3
System/Software Testing
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
Software Testing Techniques
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
CMSC 345 Fall 2000 Unit Testing. The testing process.
Testing phases. Test data Inputs which have been devised to test the system Test cases Inputs to test the system and the predicted outputs from these.
1 Introduction to Testing CIS*2450 Advanced Programming Concepts Based on “The Practice of Programming” by Brian W. Kernighan and Rob Pike, 1999.
Prof. Mohamed Batouche Software Testing.
INT-Evry (Masters IT– Soft Eng)IntegrationTesting.1 (OO) Integration Testing What: Integration testing is a phase of software testing in which.
1 Software testing. 2 Testing Objectives Testing is a process of executing a program with the intent of finding an error. A good test case is in that.
Software Testing The process of operating a system or component under specified conditions, observing and recording the results, and making an evaluation.
Agenda Introduction Overview of White-box testing Basis path testing
Software Testing. 2 CMSC 345, Version 4/12 Topics The testing process  unit testing  integration and system testing  acceptance testing Test case planning.
Unit Testing 101 Black Box v. White Box. Definition of V&V Verification - is the product correct Validation - is it the correct product.
INTRUDUCTION TO SOFTWARE TESTING TECHNIQUES BY PRADEEP I.
White-box Testing.
1 Software Engineering: A Practitioner’s Approach, 6/e Chapter 14a: Software Testing Techniques Software Engineering: A Practitioner’s Approach, 6/e Chapter.
Software Testing and Reliability Southern Methodist University CSE 7314.
1 Program Testing (Lecture 14) Prof. R. Mall Dept. of CSE, IIT, Kharagpur.
White Box Testing Arun Lakhotia University of Southwestern Louisiana P.O. Box Lafayette, LA 70504, USA
CSC 480 Software Engineering Test Planning. Test Cases and Test Plans A test case is an explicit set of instructions designed to detect a particular class.
Integration testing Integrate two or more module.i.e. communicate between the modules. Follow a white box testing (Testing the code)
Theory and Practice of Software Testing
SOFTWARE TESTING. Introduction Software Testing is the process of executing a program or system with the intent of finding errors. It involves any activity.
CSC 213 – Large Scale Programming. Today’s Goal  Understand why testing code is important  Result of poor or no testing & embarrassment caused  Learn.
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
White Box Testing by : Andika Bayu H.
These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.1.
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
White-Box Testing Techniques I Prepared by Stephen M. Thebaut, Ph.D. University of Florida Software Testing and Verification Lecture 7.
1 Lecture 14: Chapter 18 Testing Conventional Applications Slide Set to accompany Software Engineering: A Practitioner’s Approach, 7/e by Roger S. Pressman.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
ANOOP GANGWAR 5 TH SEM SOFTWARE TESTING MASTER OF COMPUTER APPLICATION-V Sem.
Software Testing. SE, Testing, Hans van Vliet, © Nasty question  Suppose you are being asked to lead the team to test the software that controls.
Testing Integral part of the software development process.
Chapter 17 Software Testing Techniques
Software Testing.
Software Testing Techniques
Software Engineering (CSI 321)
Chapter 13 & 14 Software Testing Strategies and Techniques
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Software Testing (Lecture 11-a)
“White box” or “glass box” tests
Chapter 10 – Software Testing
White-Box Testing Techniques I
Control Structure Testing
Chapter 18 Testing Conventional Applications.
Software Testing “If you can’t test it, you can’t design it”
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Chapter 13 & 14 Software Testing Strategies and Techniques 1 Software Engineering: A Practitioner’s Approach, 6th edition by Roger S. Pressman.
Presentation transcript:

CSC 395 – Software Engineering Lecture 27: White-Box Testing

In This Lecture Evaluate approaches for white-box testing How should we test when we can see the code? Methods of developing test suites When white-box testing is appropriate

Test Case Design Black-box testing – test to specifications Check functionality of code Test cases derived from original requirements, analysis, and design White-box testing – test code as it is written Use internals of the code to drive tests Premise: if checked 100%, there are no errors But cannot do full checks in finite time!

Software Defects Logic errors & bad assumptions inversely proportional to chance path is executed Common cases usually correct Rare or exceptional cases contain the bugs Remember the Pareto property! But, often believe path is unlikely to be executed when it is executed regularly Typographical error are random - Jones

White-box Testing Test all independent paths at least once Each line of code run in test suite Also called statement coverage Test all logical decisions All ifs should have both decisions checked Also called branch coverage Test all loops at boundaries & within operational bounds Consider normal & abnormal initial values Test all data structures

Cyclomatic Complexity Compute the cyclomatic complexity: number of simple decisions + 1 -or- number of enclosed areas + 1 V(G) = 4

Cyclomatic Complexity Studies indicate that the higher V(G), the higher the probability for errors Code has more opportunities for errors Errors tend to clumped in methods Spend more time testing these complex methods V(G) more complex & error prone # of Modules

White Box Testing Statement coverage Execute each statement in program at least once Branch coverage Executes each branching statement in each direction at least once Path coverage Executes all possible combinations of branches Not possible in practice

Coverage Measures All Statements:1, 2, 3, 4, 5 All Branches: 1, 2, 3, 4, 5 1, 3, 5 All Paths: 1, 2, 3, 4, 5 1, 3, 5 1, 2, 3, 5 1, 3, 4, 5

Loop Testing Nested Loops Concatenated Loops Unstructured Loops Simple loop

Loop Testing: Simple Loops If loop can be executed at most n times, try: Skipping loop entirely Exactly one pass through the loop Two passes through the loop Pass through loop m times ( m < n ) ( n -1), n, and ( n +1) passes through the loop

Loop Testing: Nested Loops 1.Starting from innermost loop, set outer loops to minimum iteration value. 2.Test ( min +1), average, ( max -1) & max runs of innermost loop, with outer loops at minimum values. 3.Repeat step 2 with next innermost loop

Loop Testing: Complex Loops For concatenated loops If loops independent, test independently Otherwise (loop dependent), test as nested loops For unstructured loops Fire the programmer, designer, & anyone else Burn the code Rewrite from design

Integration Testing Testing the combination of several modules Assumes unit-level testing has been done Incrementally test & add modules to system Add multiple when looking to burn several weeks Three traditional approaches to this process Top-down Bottom-up Sandwich

Top-Down Integration Modules tested with stubs for children Stubs replaced one-by-one “depth first” Re-run subset of tests as modules integrated A B C DE FG

Bottom-Up Integration Drivers test modules at the bottom Drivers replaced one at a time “depth first” Modules grouped into clusters and integrated A B C DE FG

Sandwich Integration Stubs used to help test modules at top Drivers test modules at the bottom Bottom modules clustered and integrated A B C DE FG

For Next Lecture Examine other analysis methods “Classical methods” for non-OO development Large amount of existing code still not OO Discusses many useful techniques Ultimately important to learn for workplace