Overview of Software Testing 07/12/2013 WISTPC 2013 Peter Clarke.

Slides:



Advertisements
Similar presentations
CMSC 345, Version 11/07 SD Vick from S. Mitchell Software Testing.
Advertisements

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.
Nov R McFadyen1 A Traditional Software Development Process Unit test Integration test System test Detailed design Architectural design Analysis.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing 2.
Testing Team exercise Have each team member contribute answers: –Do you test your code? If no, why not? If yes: When? How? How often? –What is your team’s.
Objectives Understand the basic concepts and definitions relating to testing, like error, fault, failure, test case, test suite, test harness. Understand.
Testing an individual module
1 Software Testing and Quality Assurance Lecture 5 - Software Testing Techniques.
Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution.
Chapter 13 & 14 Software Testing Strategies and Techniques
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
Software Testing Verification and validation planning Software inspections Software Inspection vs. Testing Automated static analysis Cleanroom software.
System/Software Testing
Objectives Understand the basic concepts and definitions relating to testing, like error, fault, failure, test case, test suite, test harness. Explore.
Implementation Yaodong Bi. Introduction to Implementation Purposes of Implementation – Plan the system integrations required in each iteration – Distribute.
Object-Oriented Software Engineering, Ch. 9
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.
Prof. Mohamed Batouche Software Testing.
CS4311 Spring 2011 Unit Testing Dr. Guoqiang Hu Department of Computer Science UTEP.
©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.
Instructor: Peter Clarke
Course Outline Traditional Static Program Analysis –Theory –Classic analysis and applications Points-to analysis, CHA, RTA –The Soot analysis framework.
Introduction to Software Testing
CS /51 Illinois Institute of Technology CS487 Software Engineering Software Testing Techniques Mr. David A. Lash.
Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.
Ch6: Software Verification. 1 Decision table based testing  Applicability:  Spec. is described by a decision table.  Tables describe:  How combinations.
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
Black Box Testing Techniques Chapter 7. Black Box Testing Techniques Prepared by: Kris C. Calpotura, CoE, MSME, MIT  Introduction Introduction  Equivalence.
Test Drivers and Stubs More Unit Testing Test Drivers and Stubs CEN 5076 Class 11 – 11/14.
Test Coverage CS-300 Fall 2005 Supreeth Venkataraman.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 22 Slide 1 Software Verification, Validation and Testing.
1 Program Testing (Lecture 14) Prof. R. Mall Dept. of CSE, IIT, Kharagpur.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 1 Defect testing l Testing programs to establish the presence of system defects.
Introduction to Software Testing Paul Ammann & Jeff Offutt Updated 24-August 2010.
Introduction to Software Testing 06/23/2010 WISTPC 2010 Peter J. Clarke.
CPSC 873 John D. McGregor Session 9 Testing Vocabulary.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
CS451 Lecture 10: Software Testing Yugi Lee STB #555 (816)
CPSC 871 John D. McGregor Module 8 Session 1 Testing.
1. Black Box Testing  Black box testing is also called functional testing  Black box testing ignores the internal mechanism of a system or component.
Dynamic Testing.
Workshop on Integrating Software Testing into Programming Courses (WISTPC14:2) Friday July 18, 2014 Introduction to Software Testing.
1 Test Coverage Coverage can be based on: –source code –object code –model –control flow graph –(extended) finite state machines –data flow graph –requirements.
Testing Overview Software Reliability Techniques Testing Concepts CEN 4010 Class 24 – 11/17.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
White-Box Testing Statement coverage Branch coverage Path coverage
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
Software Testing. SE, Testing, Hans van Vliet, © Nasty question  Suppose you are being asked to lead the team to test the software that controls.
Defect testing Testing programs to establish the presence of system defects.
CS223: Software Engineering Lecture 26: Software Testing.
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.
Introduction to Software Testing (2nd edition) Chapter 5 Criteria-Based Test Design Paul Ammann & Jeff Offutt
Laurea Triennale in Informatica – Corso di Ingegneria del Software I – A.A. 2006/2007 Andrea Polini XVIII. Software Testing.
Testing Tutorial 7.
Rekayasa Perangkat Lunak Part-13
Software Testing.
Structural testing, Path Testing
Types of Testing Visit to more Learning Resources.
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Software Testing (Lecture 11-a)
Chapter 10 – Software Testing
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
Guide for writing a Software Testing Document
Software Testing “If you can’t test it, you can’t design it”
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Presentation transcript:

Overview of Software Testing 07/12/2013 WISTPC 2013 Peter Clarke

Outline of Presentation Testing Terminology Testing Approaches Levels of Testing Unit Testing 2

What is software testing? Software testing is the process of operating software under specified conditions, observing or recording the results and making an evaluation of some aspect of the software. (IEEE/ANSI std ) 3

CEN 4010 Class /11 4 Overview of Testing - Terminology Software testing is the dynamic verification of the behavior of a program on a finite set of test cases, suitably selected from the usually infinite execution domain, against the expected behavior. (Guide to the Software Engineering Body of Knowledge 2004 Version)

Testing Terminology The following defns are taken from Binder 2000 and McGregor & Sykes Failure – is the manifested inability of a system or component to perform a required function within specified limits e.g. abnormal termination, or unmet time and space constraints of the software. Fault - incorrect step, process, or data definition in the software. Error - a human action that produces a fault. 5

6 Introduction to Testing Theory D R F d..F(d) T t F(t)

Testing Concepts Test case components: 1.Name – identifies the test case, it is a good idea to derive the name from the requirement being tested. 2.Purpose – states the purpose of the test and relates it to the requirement (or scenario). 3.Test set up – describe the h/w and s/w and environment required for a successful test. 4.Input – description of the input data or commands. 5.Expected output (or Oracle) – expected test results against which the output of the test is compared. 7

Testing Concepts cont Test cases are classified depending on which aspect of the system model is tested: –Blackbox (specification-based or functional) tests focus on the input/output behavior (or functionality) of the component. Tests do not deal with the internal aspects of the component nor with the behavior or the structure of the components. –Whitebox (structural or implementation-based) tests focus on the internal structure of the component. That is, test cases are constructed based on the code that implements the software. 8

Testing Concepts cont Combination of blackbox and whitebox testing is referred to as graybox testing. Regression testing includes the re-execution of prior tests after a change, this ensures that the functionality that worked before the change has not been affected. 9

Testing Concepts cont Test criteria - The criteria that a system or component must meet in order to pass a given test. [IEEE 610] There are two types of testing criteria: 1.Test data selection criterion – represents a rule used to determine which test cases to select. 2.Test data adequacy criterion – a rule used determine whether or not sufficient testing has been performed. 10

Levels of Testing Unit Testing - refers to tests that verify the functionality of a specific section of code, usually at the function level. In an object-oriented environment, this is usually at the class level, and the minimal unit tests include the constructors and destructors. (wikipedia, 2010) Integration Testing - is any type of software testing that seeks to verify the interfaces between components against a software design. Components may be integrated in an iterative way or all together ("big bang"). (wikipedia, 2010) 11

Levels of Testing System Testing - testing a completely integrated system to verify that it meets its requirements. (wikipedia, 2010) See 12

Unit Testing Focuses on the building blocks of the software system i.e., objects and subsystems. Many unit testing techniques have been devised including: equivalence testing, state-based testing, boundary testing, domain testing, control flow-based testing (statement, branch). 13

Unit Testing – Equivalence Partitioning Equivalence partitioning is a blackbox testing technique that minimizes the number of test cases. Possible inputs are partitioned into equivalence testing classes, and a test case is selected from each class. Assumption - system behaves in a similar way for all members of an equiv. class. Criteria used to determine equivalence classes: coverage, disjointedness, representation. 14

Unit Testing – Equivalence Partitioning Equivalence classValue for month inputValue for year input Months with 31 days, non-leap yrs. 7 (July)1901 Months with 31 days, leap yrs.7 (July)1904 Months with 30 days, non-leap yrs. 6 (June)1901 Months with 30 days, leap yrs.6 (June)1904 Months with 28 or 29 days, non- leap yrs. 2 (February)1901 Months with 28 or 29 days, leap yrs. 2 (February) Example: Valid inputs to test the getNumberDaysInMonth() method

Unit Testing – Boundary Analysis Test cases are generated using the extremes of the input domain, e.g. maximum, minimum, just inside/outside boundaries, typical values, and error values. It is similar to Equivalence Partitioning but focuses on "corner cases“. Exercise: write test case input using boundary analysis for the getNumberDaysInMonth() method. 16

Control Flow Adequacy Criteria Flow Graph (FG) [Binder 00] -A segment is represented by a node in the FG (a sphere). A segment is one or more contiguous statements with no conditionally executed statements. -A conditional transfer of control is a branch. A branch is represented by an outgoing edge in the FG. -The entry point of a method is represented by the entry node, which is a node no incoming edges. The exit point of a method is represented by the exit node, which has no outbound edges. 17

18 Control Flow Adequacy Criteria cont Example: Source code public int Fun(int x){ k = 0; while (x <= 10 && k < 3){ if (x%2 != 0) k = k + 1; x = x + 1; } if (x < 0){ x = 10; k = 0; } return k; } K=0 x<=10 && k<3 x%2 != 0 x=x+1 k=k+1 return k B C D E F I Entry Flow graph A X<0 X = 10 K = 0 T F T T F F G H

19 Unit Testing – Statement Coverage 1.Statement coverage – A set P of execution paths satisfies the statement coverage criterion iff for all nodes n in the FG, there is at least one path p in P s.t. n is on the path p. Whitebox testing technique. Generate test data to execute every stmt in the program at least once. Exercise: Indentify value(s) of x to execute every stmt in Fun(int x) at least once.

20 Unit Testing – Branch Coverage 2.Branch coverage – A set P of execution paths satisfies the branch coverage criterion iff for all edges e in the FG, there is at least one path p in P s.t. p contains edge e. Whitebox testing technique. Generate test data to exercise the true and false outcomes of every decision. Exercise: Indentify value(s) of x to execute every branch in Fun(int x) at least once.

21 Homework Source code 1.public int Fun1(int x, int y){ 2. k = 0; 3. while (x <= 10 && k < 10){ 4.if (x%2 != 0){ 5.k = k + y; 6.k = k – 2; 7.} 8.x = x + 1; 9.k = x + k; 10. } 11. if (x < 0){ 12.x = y; 13.k = k + x; 14. } 15. return k; 16.} 1. Draw a flow graph 2.Identify pairs of values for for x and y that gives: (a) 100% statement coverage (b) 100% branch coverage

22 Summary Testing terminology – software testing, test case, test driver, stub, fault, failure, error Testing Approaches – blackbox, whitebox, and graybox testing Levels of Testing – unit, integration, system

23 Summary cont Unit Testing –Blackbox: equivalence partitioning and boundary analysis. –Whitebox: statement coverage, branch coverage. Practice exercises were given for each testing technique.