Nov 200291.3913 R McFadyen1 A Traditional Software Development Process Unit test Integration test System test Detailed design Architectural design Analysis.

Slides:



Advertisements
Similar presentations
Chapter 14 Software Testing Techniques - Testing fundamentals - White-box testing - Black-box testing - Object-oriented testing methods (Source: Pressman,
Advertisements

SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
10 Software Engineering Foundations of Computer Science ã Cengage Learning.
CMSC 345, Version 11/07 SD Vick from S. Mitchell Software Testing.
Black box testing  Black box tests focus on the input/output behavior of the component  Black-box tests do not deal with the internal aspects of the.
April 1, R McFadyen1 A Traditional Software Development Process Unit test Integration test System test Detailed design Architectural design.
Nov R. McFadyen1 Metrics Fan-in/fan-out Lines of code Cyclomatic complexity* Comment percentage Length of identifiers Depth of conditional.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
March R. McFadyen1 Software Metrics Software metrics help evaluate development and testing efforts needed, understandability, maintainability.
CS 425/625 Software Engineering Software Testing
Testing an individual module
Chapter 18 Testing Conventional Applications
Chapter 11, Testing.
1 Software Testing Techniques CIS 375 Bruce R. Maxim UM-Dearborn.
CSE 403 Lecture 13 Black/White-Box Testing Reading: Software Testing: Principles and Practices, Ch. 3-4 (Desikan, Ramesh) slides created by Marty Stepp.
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
System/Software Testing
1 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Lecture 9 Instructor Paulo Alencar.
White-box Testing Black-box Testing Extensions
Let us start from the V-Model Verification Phases Requirements analysis System Design Architecture Design Module Design Coding Validation phases Unit.
Class Specification Implementation Graph By: Njume Njinimbam Chi-Chang Sun.
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.
Chapter 12: Software Testing Omar Meqdadi SE 273 Lecture 12 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Prof. Mohamed Batouche Software Testing.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 1 Defect testing l Testing programs to establish the presence of system defects.
CSC 480 Software Engineering Lecture 14 Oct 16, 2002.
Overview of Software Testing 07/12/2013 WISTPC 2013 Peter Clarke.
Introduction to Software Testing
Software Testing Testing types Testing strategy Testing principles.
Software Testing The process of operating a system or component under specified conditions, observing and recording the results, and making an evaluation.
1 Software Testing. 2 Path Testing 3 Structural Testing Also known as glass box, structural, clear box and white box testing. A software testing technique.
Software testing techniques Software testing techniques Equivalence partitioning Presentation on the seminar Kaunas University of Technology.
Unit Testing 101 Black Box v. White Box. Definition of V&V Verification - is the product correct Validation - is it the correct product.
Software Testing Yonsei University 2 nd Semester, 2014 Woo-Cheol Kim.
Black-box Testing.
CS 217 Software Verification and Validation Week 7, Summer 2014 Instructor: Dong Si
1 Phase Testing. Janice Regan, For each group of units Overview of Implementation phase Create Class Skeletons Define Implementation Plan (+ determine.
1 Program Testing (Lecture 14) Prof. R. Mall Dept. of CSE, IIT, Kharagpur.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
White Box Testing Arun Lakhotia University of Southwestern Louisiana P.O. Box Lafayette, LA 70504, USA
Software Construction Lecture 19 Software Testing-2.
CS451 Lecture 10: Software Testing Yugi Lee STB #555 (816)
Overview Structural Testing Introduction – General Concepts
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.
Chapter 12: Software Testing Omar Meqdadi SE 273 Lecture 12 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Tevfik Bultan Lecture 4: Introduction to C: Control Flow.
White Box Testing by : Andika Bayu H.
Dynamic White-Box Testing What is code coverage? What are the different types of code coverage? How to derive test cases from control flows?
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.
Defect testing Testing programs to establish the presence of system defects.
1 Software Testing. 2 What is Software Testing ? Testing is a verification and validation activity that is performed by executing program code.
Testing Integral part of the software development process.
Software Testing.
Software Testing.
Chapter-(Testing principles)
Chapter 9, Testing.
Software Engineering (CSI 321)
Structural testing, Path Testing
Types of Testing Visit to more Learning Resources.
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Software Testing (Lecture 11-a)
Chapter 14 Software Testing Techniques
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
Software Testing “If you can’t test it, you can’t design it”
Whitebox Testing.
Chapter 11, Testing.
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Presentation transcript:

Nov R McFadyen1 A Traditional Software Development Process Unit test Integration test System test Detailed design Architectural design Analysis Requirements analysis Business modeling process Business results

Nov R McFadyen2 Black Team Peopleware: Productive Projects and Teams by Tom Demarco and Timothy Lister Ch 19: The Black Team "legendary" Black Team at IBM in 60’s a particularly effective testing team the best testers at the company testers delighted in finding new ways to break software programmers dreaded having their software go through Black Team testing promoted themselves by dressing all in black the spirit of the Black Team has survived

Nov R McFadyen3 Testing Unit testing White-box testing Black-box testing

Nov R McFadyen4 White-box Testing Tests are derived from knowledge of the software’s construction aka structural, glass-box, or clear-box testing Tester analyzes the code, the algorithm, to derive tests

Nov R McFadyen5 Whitebox testing Tests are derived from knowledge of the software’s construction Path testing: A whitebox testing technique based on flow of control Construct a flow graph for Cyclomatic Complexity gives us the maximum number of tests necessary to cover all edges in the flow graph Design test cases such that each transition is traversed at least once - examine each condition and select an input for the true branch and another for the false branch Each test should contain an edge that is not contained in any other test

Nov R McFadyen6 White-box Testing Example FindMean(float Mean, FILE ScoreFile) …see next slide What is the flow graph for FindMean? What is the CC? What tests can we generate from the flowgraph/CC … to know all paths have been executed?

Nov R McFadyen7 /*Read in and sum the scores*/ White-box Testing Example FindMean(float Mean, FILE ScoreFile) { SumOfScores = 0.0; NumberOfScores = 0; Mean = 0; Read(ScoreFile, Score); while (! EOF(ScoreFile) { if ( Score > 0.0 ) { SumOfScores = SumOfScores + Score; NumberOfScores++; } Read(ScoreFile, Score); } /* Compute the mean and print the result */ if (NumberOfScores > 0 ) { Mean = SumOfScores/NumberOfScores; printf("The mean score is %f \n", Mean); } else printf("No scores found in file\n"); }

Nov R McFadyen8 Prepare for Flow Graph FindMean (FILE ScoreFile) { float SumOfScores = 0.0; int NumberOfScores = 0; float Mean=0.0; float Score; Read(ScoreFile, Score); while (! EOF(ScoreFile) { if (Score > 0.0 ) { SumOfScores = SumOfScores + Score; NumberOfScores++; } Read(ScoreFile, Score); } /* Compute the mean and print the result */ if (NumberOfScores > 0) { Mean = SumOfScores / NumberOfScores; printf(“ The mean score is %f\n”, Mean); } else printf (“No scores found in file\n”); }

Nov R McFadyen9 Constructing the Logic Flow Diagram CC = = 4 1, 2, 6, 8, 9 1, 2, 6, 7, 9 is not possible 1, 2, 3, 4, 5, 2, 6, 7, 9 1, 2, 3, 4, 5, 2, 6, 8, 9 is not possible 1, 2, 3, 5, 2, 6, 8, 9 1, 2, 3, 5, 2, 6, 7, 9 is not possible ok Note: If node 4 is included then node 7 must be included These 3 tests cover all paths! We didn’t need 4! Every line of code is tested!

Nov R McFadyen10 Constructing the Logic Flow Diagram CC = = 4 1, 2, 6, 8, 9 Test with no records in the file

Nov R McFadyen11 Constructing the Logic Flow Diagram CC = = 4 1, 2, 3, 4, 5, 2, 6, 7, 9 A test with one positive score

Nov R McFadyen12 Constructing the Logic Flow Diagram CC = = 4 1, 2, 3, 5, 2, 6, 8, 9 A test with one negative score

Nov R McFadyen13 Black-box Testing A blackbox test is one that focuses on the input/output behaviour of a component without considering its implementation The system being tested is a black box, whose behaviour is determined by studying its inputs and outputs aka functional testing since it is concerned with functionality and not implementation Can use equivalence classes and boundary conditions

Nov R McFadyen14 Equivalence class testing A technique to minimize the number of test cases An equivalence class is a set of tests with common characteristics A test case is selected for each class We use our domain knowledge to generate equivalence classes Example: suppose a method returns the number of days in a month, given the month and year. –When we consider months, we could arrive at 3 equivalence classes: months with 31 days months with 30 days months with 28 or 29 days –When we consider years, we have two equivalence classes: leap years and non-leap years –Combining, we have 6 equivalence classes

Nov R McFadyen15 Six equivalence classes Equivalence class Input values month year 31 day month, non-leap year day month, leap year day month, non-leap year day month, leap year /29 day month, non-leap year /29 day month, leap year

Nov R McFadyen16 Boundary class testing We focus on the boundary conditions of equivalence classes Rather than selecting any element in an equivalence class, boundary testing requires that elements be selected from the “edges” Example In general, years that are multiples of 4 are leap years; years that are multiples of 100 are not leap years, unless they are multiples of is a leap year, but 1900 is not For Year, 2000 and 1900 are good boundary cases 0 and 13 would be good boundary cases for month

Nov R McFadyen17 Ten testing classes Equivalence class Input values month year 31 day month, non-leap year day month, leap year day month, non-leap year day month, leap year /29 day month, non-leap year /29 day month, leap year Leap year divisible by Non-leap year divisible by Non-positive invalid month positive invalid month

Nov R McFadyen18 Example How would knowledge of the algorithm (the code) affect your choices of equivalence classes and boundary classes? First, suppose you are testing a search method. What equivalence and boundary test classes would you use? What are your black-box test classes? Next, suppose you learn the search is a binary search … how might this knowledge affect your set of test classes …

Nov R McFadyen19 Example (continued): Suppose we have a search module to test. We know: –the list, elt, must have at least one element –if the element, key, is found, found will be true and elt[L] = key –if the key is not found, found will be false How do we structure, or organize, our test cases?

Nov R McFadyen20 How do we structure, or organize, our test cases? We have two types of searches: successful and unsuccessful. So, we can partition our search test cases into two classifications: found and not found When it comes to lists of elements, we know that lists of length 1, are special cases or boundary points. So, we should have 2 partitions of lists: length 1, and length of more than one. When an element is searched for, it can be found in boundary positions. So, we can should have 3 partitions: found at the start, found at the end, and then we should include where it is found in the middle. Example (continued):

Nov R McFadyen21 FoundNot Found List of 1 element combining the partitions List of >1 element In 1st position In last position In middle position List of >1 element Example (continued):

Nov R McFadyen sample tests for the 6 partitions true, 1 55false, ? 55true, 1 44true, 6 77true, 3 99false, ? Outputs Found, L Inputs List Key Example (continued):

Nov R McFadyen23 Now, suppose we are examining the algorithm that searches an ordered list for a specific value in Key. On examination we see it’s a binary search and we see that it really treats the List as having 3 sections: elements < mid mid- point elements > mid Example (continued):

Nov R McFadyen24 :We can use this knowledge to further refine our partitioning - we need to test for where the Key we are looking for is at the boundary points for these partitions. elements < mid mid- point elements > mid We’ll add two more tests relating to the boundary points – finding a key just before, and just after the midpoint. (Could there be more that we should add related to not finding a key? What is the control flowgraph?) Example (continued):

Nov R McFadyen25 Example (continued) true, 1 55false, ? 55true, 1 50true, 4 76true, 7 44true, 3 Outputs Found, L Inputs List Key true, false, ?