Types of Testing Visit to more Learning Resources.

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.
SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
David Woo (dxw07u).  What is “White Box Testing”  Data Processing and Calculation Correctness Tests  Correctness Tests:  Path Coverage  Line Coverage.
CMSC 345, Version 11/07 SD Vick from S. Mitchell Software Testing.
IMSE Week 18 White Box or Structural Testing Reading:Sommerville (4th edition) ch 22 orPressman (4th edition) ch 16.
Testing an individual module
SOFTWARE TESTING WHITE BOX TESTING 1. GLASS BOX/WHITE BOX TESTING 2.
1 Software Testing Techniques CIS 375 Bruce R. Maxim UM-Dearborn.
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.
Software Systems Verification and Validation Laboratory Assignment 3
System/Software Testing
CMSC 345 Fall 2000 Unit Testing. The testing process.
Prof. Mohamed Batouche Software Testing.
CS4311 Spring 2011 Unit Testing Dr. Guoqiang Hu Department of Computer Science UTEP.
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.
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.
Unit Testing 101 Black Box v. White Box. Definition of V&V Verification - is the product correct Validation - is it the correct product.
Black-box Testing.
INTRUDUCTION TO SOFTWARE TESTING TECHNIQUES BY PRADEEP I.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 22 Slide 1 Software Verification, Validation and Testing.
White-box Testing.
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.
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.
Dynamic Testing.
Chapter 12: Software Testing Omar Meqdadi SE 273 Lecture 12 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
White-Box Testing Techniques I Prepared by Stephen M. Thebaut, Ph.D. University of Florida Software Testing and Verification Lecture 7.
Dynamic White-Box Testing What is code coverage? What are the different types of code coverage? How to derive test cases from control flows?
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.
Verification vs. Validation Verification: "Are we building the product right?" The software should conform to its specification.The software should conform.
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.
Testing Integral part of the software development process.
Software Engineering (CSI 321)
PREPARED BY G.VIJAYA KUMAR ASST.PROFESSOR
Software TestIng White box testing.
BASIS PATH TESTING.
Software Testing.
Software Testing.
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 4 Control Flow Testing
Software Engineering (CSI 321)
Chapter 13 & 14 Software Testing Strategies and Techniques
Structural testing, Path Testing
White-Box Testing Techniques
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
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.
White-Box Testing Techniques I
CSE403 Software Engineering Autumn 2000 More Testing
Software Testing “If you can’t test it, you can’t design it”
Chapter 10: Testing and Quality Assurance
UNIT-4 BLACKBOX AND WHITEBOX TESTING
08120: Programming 2: SoftwareTesting and Debugging
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:

Types of Testing Visit to more Learning Resources

White-box testing: Summary statement coverage path coverage branch testing condition coverage Cyclomatic complexity Summary

Input test data to the system. Observe the output: How do you test a system? Input test data to the system. Observe the output: Check if the system behaved as expected.

How do you test a system? Input System Output

If the program does not behave as expected: How do you test a system? If the program does not behave as expected: note the conditions under which it failed. later debug and correct.

A failure is a manifestation of an error (aka defect or bug). Errors and Failures A failure is a manifestation of an error (aka defect or bug). mere presence of an error may not lead to a failure.

White-box Testing Designing white-box test cases: requires knowledge about the internal structure of software. white-box testing is also called structural testing.

Static white box testing Static white box testing which involves only the source code of the product and not the binaries or executable, static white box testing will be done before the code is executed or completed. For static white box testing only selected peoples are involved to find out the defects in the code. The main aim of the static testing is to check whether the code is according to the Functional requirements, design, coding standards, all functionalities covered and error handling

Desk checking Desk checking is the primary testing done on the code. Static checking will be done by programmers before compiled or executed, if any error is find it is going to check by author and he will correct the code, in this process the code is compared with requirements specification or design to see that the designed code is according to client adhoc requests

Code walkthrough This testing is also known as technical code walkthrough, in this testing process a group of technical people go through the code. This is one type of semi-formal review technique. In Code walkthrough process a high level employees involved such as technical leads, database administrators and one or more peers. The people who involved in this technical code walkthrough they raise questions on code to author, in this process author explains the logic and if there is any mistake in the logic, the code is corrected immediately

Formal Inspections Inspection is a formal, efficient and economical method of finding errors in design and code. It’s a formal review and aimed at detecting all faults, violations and other side effects. According to M. E. Fagan “A defect is an instance in which a requirement is not satisfied”. Fagan inspection process is a structured process of finding defects in the provided source code.

White-Box Testing Statement coverage branch coverage path coverage There exist several popular white-box testing methodologies: Statement coverage branch coverage path coverage condition coverage mutation testing data flow-based testing

Statement coverage methodology: design test cases so that every statement in a program is executed at least once.

Statement Coverage The principal idea: unless a statement is executed, we have no way of knowing if an error exists in that statement.

Statement coverage criterion Based on the observation: an error in a program can not be discovered: unless the part of the program containing the error is executed.

Statement coverage criterion Observing that a statement behaves properly for one input value: no guarantee that it will behave correctly for all input values.

Example int f1(int x, int y){ 1 while (x != y){ 2 if (x>y) then 3 x=x-y; 4 else y=y-x; 5 } 6 return x; }

Euclid's GCD computation algorithm By choosing the test set {(x=3,y=3),(x=4,y=3), (x=3,y=4)} all statements are executed at least once.

Branch Coverage Test cases are designed such that: different branch conditions given true and false values in turn.

Branch Coverage Branch testing guarantees statement coverage: a stronger testing compared to the statement coverage-based testing.

Stronger testing discovers at least as many errors as a weaker testing Test cases are a superset of a weaker testing: discovers at least as many errors as a weaker testing contains at least as many significant test cases as a weaker test.

Example int f1(int x,int y){ 1 while (x != y){ 2 if (x>y) then 3 x=x-y; 4 else y=y-x; 5 } 6 return x; }

Example Test cases for branch coverage can be: {(x=3,y=3),(x=3,y=2), (x=4,y=3), (x=3,y=4)}

Condition Coverage Test cases are designed such that: each component of a composite conditional expression given both true and false values.

Example Consider the conditional expression ((c1.and.c2).or.c3): Each of c1, c2, and c3 are exercised at least once, i.e. given true and false values.

Branch testing Branch testing is the simplest condition testing strategy: compound conditions appearing in different branch statements are given true and false values.

Branch testing Condition testing Branch testing stronger testing than branch testing: Branch testing stronger than statement coverage testing.

Consider a boolean expression having n components: Condition coverage Consider a boolean expression having n components: for condition coverage we require 2n test cases.

Condition coverage-based testing technique: practical only if n (the number of component conditions) is small.

Path Coverage Design test cases such that: all linearly independent paths in the program are executed at least once.

Path coverage-based testing To understand the path coverage-based testing: we need to learn how to draw control flow graph of a program.

Path A path through a program: a node and edge sequence from the starting node to a terminal node of the control flow graph. There may be several terminal nodes for program.

Independent path Any path through the program: introducing at least one new node: that is not included in any other independent paths.

Independent path It is straight forward: to identify linearly independent paths of simple programs. For complicated programs: it is not so easy to determine the number of independent paths.

McCabe's cyclomatic metric An upper bound: for the number of linearly independent paths of a program Provides a practical way of determining: the maximum number of linearly independent paths in a program.

McCabe's cyclomatic metric Given a control flow graph G, cyclomatic complexity V(G): V(G)= E-N+2 N is the number of nodes in G E is the number of edges in G

Example Control Flow Graph 1 2 3 4 5 6

Example Cyclomatic complexity = 7-6+2 = 3.

Cyclomatic complexity Another way of computing cyclomatic complexity: inspect control flow graph determine number of bounded areas in the graph V(G) = Total number of bounded areas + 1

Bounded area Any region enclosed by a nodes and edge sequence.

Example Control Flow Graph 1 2 3 4 5 6

Example From a visual examination of the CFG: the number of bounded areas is 2. cyclomatic complexity = 2+1=3.

Cyclomatic complexity McCabe's metric provides: a quantitative measure of testing difficulty and the ultimate reliability Intuitively, number of bounded areas increases with the number of decision nodes and loops.

Cyclomatic complexity The first method of computing V(G) is amenable to automation: you can write a program which determines the number of nodes and edges of a graph applies the formula to find V(G).

Cyclomatic complexity The cyclomatic complexity of a program provides: a lower bound on the number of test cases to be designed to guarantee coverage of all linearly independent paths.

Cyclomatic complexity Defines the number of independent paths in a program. Provides a lower bound: for the number of test cases for path coverage.

Cyclomatic complexity Knowing the number of test cases required: does not make it any easier to derive the test cases, only gives an indication of the minimum number of test cases required.

Black Box Testing: Black box testing plays a significant role in software testing, it aid in overall functionality validation of the system. Black box testing is done based on customers’ requirements-so any incomplete or unpredictable requirements can be easily identified and it can be addressed later. Black box testing is done based on end user perspective. The main importance of black box testing it handles both valid and invalid inputs from customer’s perspective

Equivalence Class Partitioning Equivalence class testing is based upon the assumption that a program’s input and output domains can be partitioned into a finite number of (valid and invalid) classes such that all cases in a single partition exercise the same functionality or exhibit the same behaviour . The partitioning is done such that the program behaves in a similar way to every input value belonging to an equivalence class. Test cases are designed to test the input or output domain partitions. Equivalence class is determined by examining and analysing the input data range. Only one test case from each partition is required, which reduces the number of test cases necessary to achieve functional coverage . The success of this approach depends upon the tester being able to identify partitions of the input and output spaces for which, in reality, cause distinct sequences of program source code to be executed

Boundary Value Analysis Boundary value analysis is performed by creating tests that exercise the edges of the input and output classes identified in the specification. Test cases can be derived from the ‘boundaries’ of equivalence classes. Typically programming errors occur at the boundaries of equivalence classes are known as “Boundary Value Analysis”. Generally some time programmers fail to check special processing required especially at boundaries of equivalence classes. A general example is programmers may improperly use < instead of <=. The choices of boundary values include above, below and on the boundary of the class

Decision Tables Decision tables are human readable rules used to express the test experts or design experts knowledge in a compact form. Decision Tables can be used when the outcome or the logic involved in the program is based on a set of decisions and rules which need to be followed. Decision table mainly consists of four areas called the condition stub, the condition entry, the action stub and finally action entry For more Details Contact Us