Software Testing “If you can’t test it, you can’t design it”

Slides:



Advertisements
Similar presentations
Software Testing Techniques
Advertisements

Software Testing Technique. Introduction Software Testing is the process of executing a program or system with the intent of finding errors. It involves.
Software testing.
Defect testing Objectives
การทดสอบโปรแกรม กระบวนการในการทดสอบ
Chapter 10 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.
CMSC 345, Version 11/07 SD Vick from S. Mitchell Software Testing.
Software testing.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Final Project Account for 40 pts out of 100 pts of the final score 10 pts from.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
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.
1 Software Testing Techniques CIS 375 Bruce R. Maxim UM-Dearborn.
Chapter 13 & 14 Software Testing Strategies and Techniques
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
Software Testing Verification and validation planning Software inspections Software Inspection vs. Testing Automated static analysis Cleanroom software.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 23 Slide 1 Software testing Slightly adapted by Anders Børjesson.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
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.
Software testing techniques 3. Software testing
Prof. Mohamed Batouche Software Testing.
Software Engineering Chapter 23 Software Testing Ku-Yaw Chang Assistant Professor Department of Computer Science and Information.
©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.
©Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
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.
Software Testing. 2 CMSC 345, Version 4/12 Topics The testing process  unit testing  integration and system testing  acceptance testing Test case planning.
This chapter is extracted from Sommerville’s slides. Text book chapter
Software Testing Yonsei University 2 nd Semester, 2014 Woo-Cheol Kim.
INTRUDUCTION TO SOFTWARE TESTING TECHNIQUES BY PRADEEP I.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 22 Slide 1 Software Verification, Validation and Testing.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
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.
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)
SOFTWARE TESTING. Introduction Software Testing is the process of executing a program or system with the intent of finding errors. It involves any activity.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
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.
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.
Software Testing.
Software Testing.
Rekayasa Perangkat Lunak Part-13
Software Testing.
Software Engineering (CSI 321)
IS301 – Software Engineering V:
Chapter 13 & 14 Software Testing Strategies and Techniques
Types of Testing Visit to more Learning Resources.
Software testing.
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Software Testing (Lecture 11-a)
Chapter 14 Software Testing Techniques
Lecture 09:Software Testing
Software testing.
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.
Chapter 7 Software Testing.
Integration Testing.
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:

Software Testing “If you can’t test it, you can’t design it”

Software Testing Software testing is a popular risk management strategy. It is used to verify that functional requirements were met. The limitation of this approach, however, is that by the time testing occurs, it is too late to build quality into the product

What is a Risk? Risks are potential problems that may affect successful completion of a software project. Risks involve uncertainty and potential losses. Risk analysis and management are intended to help a software team understand and manage uncertainty during the development process.

Risk Strategies Reactive strategies Proactive strategies very common, also known as fire fighting. project team sets resources aside to deal with problems. team does nothing until a risk becomes a problem. Proactive strategies risk management begins long before technical work starts, risks are identified and prioritized by importance. team builds a plan to avoid risks if they can or to minimize risks if they turn into problems.

Software Testing Process Component testing Testing of individual program components; Usually the responsibility of the component developer (except sometimes for critical systems); Tests are derived from the developer’s experience. System testing Testing of groups of components integrated to create a system or sub-system; The responsibility of an independent testing team; Tests are based on a system specification.

Software Testing Process Component testing S ystem Software developer Independent testing team

Testing Process Goals Validation testing Defect testing To demonstrate to the developer and the system customer that the software meets its requirements; A successful test shows that the system operates as intended. Defect testing To discover faults or defects in the software where its behavior is incorrect or not in conformance with its specification; A successful test is a test that makes the system perform incorrectly and so exposes a defect in the system.

System Testing Software Testing Process

System Testing Involves integrating components to create a system or sub- system. May involve testing an increment to be delivered to the customer. Two phases: Integration testing - the test team have access to the system source code. The system is tested as components are integrated. Release testing - the test team test the complete system to be delivered as a black-box.

Integration Testing There are two groups of software integration strategies: - Non Incremental software integration - Incremental software integration Non Incremental software integration: Big bang integration approach Incremental software integration: Top- down software integration Bottom-up software integration Sandwich integration

Integration Testing Involves building a system from its components and testing it for problems that arise from component interactions. Top-down integration Develop the skeleton of the system and populate it with components. Use stubs to replace real components. Bottom-up integration Integrate infrastructure components then add functional components. Use drivers to test components To simplify error localisation, systems should be incrementally integrated.

Release Testing The process of testing a release of a system that will be distributed to customers. Primary goal is to increase the supplier’s confidence that the system meets its requirements. Release testing is usually black-box or functional testing Based on the system specification only; Testers do not have knowledge of the system implementation.

Testing Policies Only exhaustive testing can show a program is free from defects. However, exhaustive testing is impossible, Testing policies define the approach to be used in selecting system tests: All functions accessed through menus should be tested; Combinations of functions accessed through the same menu should be tested; Where user input is required, all functions must be tested with correct and incorrect input.

Component Testing Software Testing Process

Test Strategies Black-box or behavioral testing knowing the specified function a product is to perform and demonstrating correct operation based solely on its specification without regard for its internal logic White-box or glass-box testing knowing the internal workings of a product, tests are performed to check the workings of all possible logic paths

Black-Box Testing Functional Testing Test Strategies Black-Box Testing Functional Testing

Black Box testing Equivalence Partitioning Input data and output results often fall into different classes where all members of a class are related. Each of these classes is an equivalence partition or domain where the program behaves in an equivalent way for each class member. Test cases should be chosen from each partition.

Equivalence Partitioning Black-box technique divides the input domain into classes of data from which test cases can be derived. An ideal test case uncovers a class of errors that might require many arbitrary test cases to be executed before a general error is observed.

Boundary Value Analysis Black-box technique focuses on classes and also on the boundaries of the input domain. Guidelines: If input condition specifies a range bounded by values a and b, test cases should include a and b, values just above and just below a and b If an input condition specifies a number of values, test cases should exercise the minimum and maximum numbers, as well as values just above and just below the minimum and maximum values

Example: Factorial function: n!

Factorial of n: n! Equivalence partitioning – break the input domain into different classes: Class1: n<0 Class2: n>0 and n! doesn’t cause an overflow Class3: n>0 and n! causes an overflow Boundary Value Analysis: n=0 (between class1 and class2)

Factorial of n: n! Test cases Test case = ( ins, expected outs) Equivalence partitioning – break the input domain into different classes: From Class1: ((n = -1), “ function not defined for n negative”) From Class2: ((n = 3), 6) From Class3: ((n=100), “ input value too big”) Boundary Value Analysis: ((n=0), 1)

White-Box Testing Structural Testing Test Strategies White-Box Testing Structural Testing

White Box testing Structural Testing The objective of path testing is to ensure that the set of test cases is such that each path through the program is executed at least once. The starting point for path testing is a program flow graph that shows nodes representing program decisions and arcs representing the flow of control. Statements with conditions are therefore nodes in the flow graph.

Path testing – Control Flow Graph White-box technique is based on the program flow graph (CFG) Many paths between 1 (begin) and 6 (end) 1, 2, 5, 6 1, 2, 3, 4, 2, 6 1, 2, 3, 4, 2, 3, 4, 2, 5, 6 … Prepare test cases that will force the execution of each path in the basis set. Test case : ((inputs …) , (expected outputs …)) 2 3 4 5 1 6

Program flow graph Basic Control Flow Graphs 2 3 4 5 1 1 4 2 3 1 2 If condition: If … Then … Else End if A sequence: X = 1; Y = X * 10; While loop: While … do … statements End while

Example: Binary search pseudo-code

Binary search flow graph

Independent Paths 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 14 1, 2, 3, 4, 5, 14 1, 2, 3, 4, 5, 6, 7, 11, 12, 5, … 1, 2, 3, 4, 6, 7, 2, 11, 13, 5, … Test cases should be derived so that all of these paths are executed

Software Metrics McCabe’s cyclomatic number, introduced in 1976, is, after lines of code, one of the most commonly used metrics in software development. The cyclomatic complexity of the program is computed from its control flow graph (CFG) using the formula: V(G) = Edges – Nodes + 2 or by counting the conditional statements and adding 1 This measure determines the basis set of linearly independent paths and tries to measure the complexity of a program

Software Metrics How to evaluate quality? Fix a Threshold value An important aspect of a metric is guidance about when the values are reasonable and when the values are not reasonable. McCabe analyzed a large project and discovered that for modules with cyclomatic number over 10, the modules had histories of many more errors and many more difficulties in maintenance. Thus, 10 has been accepted as the threshold value for the cyclomatic number in a module. If the cyclomatic number is greater than 10, efforts should be made to reduce the value or to split the module.

Software Metrics 1 2 3 4 5 6 V(G) = 6 – 6 + 2 = 2 V(G) = Edges – Nodes + 2 V(G) = 6 – 6 + 2 = 2 V(G) = conditional statements + 1 = 1 + 1 = 2 Two linearly independent paths: 1, 2, 5, 6 1, 2, 3, 4, 2, 5, 6 Complexity = 2 < 10 => good quality 2 3 4 5 1 6

Software Metrics V(G) = 16 – 14 + 2 = 4 V(G) = Edges – Nodes + 2 V(G) = conditional statements + 1 = 3 + 1 = 4 four linearly independent paths Complexity = 4 < 10 => good quality

References K. Naik and P. Tripathy: “Software Testing and Quality Assurance”, Wiley, 2008. Ian Sommerville, Software Engineering, 8th edition, 2006. Aditya P. Mathur,“Foundations of Software Testing”, Pearson Education, 2009. D. Galin, “Software Quality Assurance: From Theory to Implementation”, Pearson Education, 2004 David Gustafson, “Theory and Problems of Software Engineering”, Schaum’s Outline Series, McGRAW-HILL, 2002.