Software Testing.

Slides:



Advertisements
Similar presentations
Software Testing Techniques
Advertisements

Chapter 14 Software Testing Techniques - Testing fundamentals - White-box testing - Black-box testing - Object-oriented testing methods (Source: Pressman,
Software Testing Technique. Introduction Software Testing is the process of executing a program or system with the intent of finding errors. It involves.
Unit-V testing strategies and tactics.
Chapter 14 Testing Tactics
Lecture 8: Testing, Verification and Validation
Chapter 6 Path Testing Software Testing
CYCLOMATIC COMPLEXITY 1. Invented by Thomas McCabe (1974) to measure the complexity of a program ’ s conditional logic Cyclomatic complexity of graph.
SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
Creator: ACSession No: 13 Slide No: 1Reviewer: SS CSE300Advanced Software EngineeringFebruary 2006 Testing - Techniques CSE300 Advanced Software Engineering.
IMSE Week 18 White Box or Structural Testing Reading:Sommerville (4th edition) ch 22 orPressman (4th edition) ch 16.
BASIS PATH TESTING ● By Tom McCabe ● McCabe, T., "A Software Complexity Measure," IEEE Trans. Software Engineering, vol. SE-2, December 1976, pp
Testing an individual module
Chapter 18 Testing Conventional Applications
Unit Testing CS 414 – Software Engineering I Don Bagert Rose-Hulman Institute of Technology January 16, 2003.
1 Software Testing Techniques CIS 375 Bruce R. Maxim UM-Dearborn.
Software Systems Verification and Validation Laboratory Assignment 3
Software Testing Techniques
CMSC 345 Fall 2000 Unit Testing. The testing process.
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 Reviews & testing Software Reviews & testing An Overview.
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
1 Chapter : Testing Tactics. 2 Testing Fundamental Software engineer attempts to build software from an abstract concept to a tangible product. Next is.
Black-box Testing.
INTRUDUCTION TO SOFTWARE TESTING TECHNIQUES BY PRADEEP I.
White-box Testing.
1 Program Testing (Lecture 14) Prof. R. Mall Dept. of CSE, IIT, Kharagpur.
BASIS PATH TESTING.
Software Engineering Saeed Akhtar The University of Lahore.
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.
 Software Testing Software Testing  Characteristics of Testable Software Characteristics of Testable Software  A Testing Life Cycle A Testing Life.
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.
SOFTWARE TESTING. SOFTWARE Software is not the collection of programs but also all associated documentation and configuration data which is need to make.
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.
Verification vs. Validation Verification: "Are we building the product right?" The software should conform to its specification.The software should conform.
1 Software Testing. 2 What is Software Testing ? Testing is a verification and validation activity that is performed by executing program code.
Based on slides created by Ian Sommerville & Gary Kimura
PREPARED BY G.VIJAYA KUMAR ASST.PROFESSOR
Software Testing.
BASIS PATH TESTING.
Software Testing.
Software Testing Techniques
Software Engineering (CSI 321)
Software Testing An Introduction.
Testing Conventional Applications
Effective Modular Design
Chapter 13 & 14 Software Testing Strategies and Techniques
Structural testing, Path Testing
Types of Testing Visit to more Learning Resources.
White Box Testing.
UNIT-IV ECS-602 Software engineering PART-I
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Software Testing (Lecture 11-a)
Chapter 14 Software Testing Techniques
Static Testing Static testing refers to testing that takes place without Execution - examining and reviewing it. Dynamic Testing Dynamic testing is what.
User Interface Design & Testing Technique
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 14 Software Testing Techniques
Chapter 18 Testing Conventional Applications.
Software Testing “If you can’t test it, you can’t design it”
Software Testing.
UNIT-4 BLACKBOX AND WHITEBOX TESTING
By: Lecturer Raoof Talal
Chapter 13 & 14 Software Testing Strategies and Techniques 1 Software Engineering: A Practitioner’s Approach, 6th edition by Roger S. Pressman.
Unit III – Chapter 3 Path Testing.
Presentation transcript:

Software Testing

Introduction Software Testing is the process of executing a program or system with the intent of finding errors. It involves any activity aimed at evaluating an attribute or capability of a program or system and determining that it meets its required results

Testing Objectives Testing is a process of executing a program with the intent of finding an error. A good test case is one that has high probability of finding an undiscovered error. A successful test is one that uncovers an as-yet undiscovered error. The major testing objective is to design tests that systematically uncover types of errors with minimum time and effort.

Test Charactaristics A good test has a high probability of finding an error The tester must understand the software and how it might fail A good test is not redundant Testing time is limited; one test should not serve the same purpose as another test A good test should be “best of breed” Tests that have the highest likelihood of uncovering a whole class of errors should be used A good test should be neither too simple nor too complex Each test should be executed separately; combining a series of tests could cause side effects and mask certain errors

Characteristics of Testable Software Operable The better it works (i.e., better quality), the easier it is to test Observable Incorrect output is easily identified; internal errors are automatically detected Controllable The states and variables of the software can be controlled directly by the tester Decomposable The software is built from independent modules that can be tested independently

Characteristics of Testable Software Simple The program should exhibit functional, structural, and code simplicity Stable Changes to the software during testing are infrequent and do not invalidate existing tests Understandable The architectural design is well understood; documentation is available and organized

Levels of Testing Unit Testing Integration Testing Validation Testing Acceptance Testing

Unit Testing Algorithms and logic Data structures (global and local) Interfaces Independent paths Boundary conditions Error handling

Why Integration Testing Is Necessary One module can have an adverse effect on another Subfunctions, when combined, may not produce the desired major function Interfacing errors not detected in unit testing may appear Timing problems (in real-time systems) are not detectable by unit testing

Validation Testing Determine if the software meets all of the requirements defined in the SR Having written requirements is essential Regression testing involves selectively repeating existing validation tests, not developing new tests

Acceptance Testing Similar to validation testing except that customers are present or directly involved. Usually the tests are developed by the customer

Test technique White box or glass box testing Black box testing

Two Unit Testing Techniques Black-box testing Knowing the specified function that a product has been designed to perform, test to see if that function is fully operational and error free Not concerned with internal logical structure of the software White-box testing Knowing the internal workings of a product, test that all internal operations are performed according to specifications and all internal components have been exercised Logical paths through the software are tested Test cases exercise specific sets of conditions and loops

Black-box Testing

Black Box Testing Test cases are derived from formal specification of the system. Test case selection can be done without any reference to the program design or code. Only tests the functionality and features of the program. Not the internal operation. Advantages Test case selection is done before the implementation of a program. Help in getting the design and coding correct with respect to the specification.

Black box

Black-box Testing Categories Incorrect or missing functions Interface errors Errors in data structures or external data base access Behavior or performance errors Initialization and termination errors

Questions answered by Black-box Testing How is functional validity tested? How are system behavior and performance tested? What classes of input will make good test cases? Is the system particularly sensitive to certain input values? How are the boundary values of a data class isolated? What data rates and data volume can the system tolerate? What effect will specific combinations of data have on system operation?

White-box Testing

White Box Testing Test cases are derived from the internal design specification or actual code for the program. Advantages Tests the internal details of the code; Checks all paths that a program can execute. Limitations Wait until after designing and coding the program under test in order to define test cases.

White box testing

White Box Testing White-box test design techniques include: Control flow testing Data flow testing Branch testing Path testing

White-box Testing These test cases Guarantee that all independent paths within a module have been exercised at least once Exercise all logical decisions on their true and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Basis Path Testing White-box testing technique proposed by Tom McCabe enables the test case designer to derive a logical complexity measure of a procedural design Uses this measure as a guide for defining a basis set of execution paths Test cases derived to exercise the basis set are guaranteed to execute every statement in the program at least one time during testing

Flow Graph Notation A circle in a graph represents a node, which stands for a sequence of one or more procedural statements A node containing a simple conditional expression is referred to as a predicate node Each compound condition in a conditional expression containing one or more Boolean operators (e.g., and, or) is represented by a separate predicate node A predicate node has two edges leading out from it (True and False) An edge, or a link, is a an arrow representing flow of control in a specific direction An edge must start and terminate at a node An edge does not intersect or cross over another edge

Flow Graph Example FLOW CHART FLOW GRAPH 1 1 2 2 3 3 6 4 6 4 7 8 5 7 8 1 1 2 2 3 3 6 4 6 4 7 8 5 7 8 5 9 9 11 10 11 10

Independent Program Paths Defined as a path through the program from the start node until the end node that introduces at least one new set of processing statements or a new condition (i.e., new nodes) Must move along at least one edge that has not been traversed before by a previous path Basis set for flow graph on previous slide Path 1: 0-1-11 Path 2: 0-1-2-3-4-5-10-1-11 Path 3: 0-1-2-3-6-8-9-10-1-11 Path 4: 0-1-2-3-6-7-9-10-1-11 The number of paths in the basis set is determined by the cyclomatic complexity

Cyclomatic Complexity Provides a quantitative measure of the logical complexity of a program Defines the number of independent paths in the basis set Provides an upper bound for the number of tests that must be conducted to ensure all statements have been executed at least once Can be computed two ways V(G) = E – N + 2, where E is the number of edges and N is the number of nodes in graph G Results in the following equations for the example flow graph V(G) = 14 edges – 12 nodes + 2 = 4

Deriving the Basis Set and Test Cases Using the design or code as a foundation, draw a corresponding flow graph Determine the cyclomatic complexity of the resultant flow graph Determine a basis set of linearly independent paths Prepare test cases that will force execution of each path in the basis set

Cyclomatic Complexity Invented by Thomas McCabe (1974) to measure the complexity of a program’s conditional logic Cyclomatic complexity of graph G equals #edges - #nodes + 2 V(G) = e – n + 2 Also corresponds to the number of linearly independent paths in a program

Converting Code to Graph FLOWCHART GRAPH if expression1 then statement2 else statement3 end if statement4 T expr1 ? F n1 (a) statm2 statm3 n2 n3 statm4 n4 switch expr1 case 1: statement2 case 2: statm3 case 3: statm4 end switch statm5 1 expr1 ? 3 n1 n2 n4 n5 n3 2 (b) statm2 statm3 statm4 statm5 n1 n2 n3 statm1 do statement1 while expr2 end do statement3 (c) T expr2 ? F statm3

Example Paths V(G) = e – n + 2 = 9 – 7 + 2 = 4 if expression1 then statement2 end if do statement3 while expr4 end do if expression5 then statement6 statement7 e1 n1 n2 e3 e2 n3 e4 e5 n4 e6 e7 n5 n6 e9 e8 n7 V(G) = e – n + 2 = 9 – 7 + 2 = 4

Example 1

V=e-n+2=11-9+2=4

V=e-n+2=11-9+2=4