Functional testing, Equivalence class testing

Slides:



Advertisements
Similar presentations
2017/3/25 Test Case Upgrade from “Test Case-Training Material v1.4.ppt” of Testing basics Authors: NganVK Version: 1.4 Last Update: Dec-2005.
Advertisements

Defect testing Objectives
Test Case Design Methodologies (Black-box methods)
Software Testing Testing.
Testing in the Small (aka Unit Testing, Class Testing)
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.
Chapter 17 Software Testing Techniques
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
Software Testing and Quality Assurance
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.
Software Engineering Lecture 12 Software Testing Techniques 1.
1 Software Testing Techniques CIS 375 Bruce R. Maxim UM-Dearborn.
Black Box Software Testing
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
Verificarea şi Validarea Sistemelor Soft Tem ă Laborator 2 Testare Black Box Dat ă primire laborator: Lab 2 Dat ă predare laborator: Lab 2,3.
System/Software Testing
CMSC 345 Fall 2000 Unit Testing. The testing process.
CS4311 Spring 2011 Unit Testing Dr. Guoqiang Hu Department of Computer Science UTEP.
Black-Box Testing Techniques I Software Testing Lecture 4.
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.
CS /51 Illinois Institute of Technology CS487 Software Engineering Software Testing Techniques Mr. David A. Lash.
Software Testing Testing types Testing strategy Testing principles.
Black-Box Testing Techniques I
Black Box Testing Techniques Chapter 7. Black Box Testing Techniques Prepared by: Kris C. Calpotura, CoE, MSME, MIT  Introduction Introduction  Equivalence.
Black Box Testing Focuses in the functional requirements of the program It is not an alternative to white-box techniques It is a complementary approach.
Black-box Testing.
INTRUDUCTION TO SOFTWARE TESTING TECHNIQUES BY PRADEEP I.
Today’s Agenda  Reminder: HW #1 Due next class  Quick Review  Input Space Partitioning Software Testing and Maintenance 1.
Test Case Designing UNIT - 2. Topics Test Requirement Analysis (example) Test Case Designing (sample discussion) Test Data Preparation (example) Test.
Testing and inspecting to ensure high quality An extreme and easily understood kind of failure is an outright crash. However, any violation of requirements.
CS451 Lecture 10: Software Testing Yugi Lee STB #555 (816)
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.
Theory and Practice of Software Testing Chapter 14 Presman Software Testing Tactics BLACK BOX TESTING.
1 Phase Testing. Janice Regan, For each group of units Overview of Implementation phase Create Class Skeletons Define Implementation Plan (+ determine.
1 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Requirements-based Test Generation for Functional Testing W. Eric Wong Department of.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
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.
Dynamic Black-Box Testing Part 1 What is dynamic black-box testing? How to reduce the number of test cases using: Equivalence partitioning Boundary value.
Testing Data Structures
Software Engineering (CSI 321)
Chapter 17 Software Testing Techniques
Software TestIng White box testing.
Equivalence partitioning
Equivalence partitioning
Domain Testing Functional testing which tests the application by giving inputs and evaluating its appropriate outputs. system does not accept invalid and.
Testing Tutorial 7.
Software Testing.
Rekayasa Perangkat Lunak Part-13
Software Testing.
Software Engineering (CSI 321)
Input Space Partition Testing CS 4501 / 6501 Software Testing
Lecture on Black Box Testing
CS5123 Software Validation and Quality Assurance
Software engineering – 1
UNIT-4 BLACKBOX AND WHITEBOX TESTING
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.
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.
Software Testing “If you can’t test it, you can’t design it”
Chapter 1: Boundary Value Testing
CSE 1020:Software Development
TYPES OF TESTING.
Chapter 7 Software Testing.
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Presentation transcript:

Functional testing, Equivalence class testing

Functional Testing In this type of testing, the software is tested for the functional requirements. The tests are written in order to check if the application behaves as expected. Although functional testing is often done toward the end of the development cycle, it can—and should, —be started much earlier. Individual components and processes can be tested early on, even before it's possible to do functional testing on the entire system. Functional testing covers how well the system executes the functions it is supposed to execute—including user commands, data manipulation, searches and business processes, user screens, and integrations. Functional testing covers the obvious surface type of functions, as well as the back-end operations

Functional Testing Black-box testing, also called behavioural testing, focuses on the functional requirements of the software. Black-box testing attempts to find errors in the following categories: (1) incorrect or missing functions (2) interface errors (3) errors in data structures or external data base access (4) behaviour or performance errors, and (5) initialization and termination errors.

Functional Testing In black-box testing the structure of the program is not considered. Test cases are decided solely on the basis of the requirements or specifications of the program or module, and the internals of the module or the program are not considered for selection of test cases. the tester only knows the inputs that can be given to the system and what output the system should give. In other words, the basis for deciding test cases in functional testing is the requirements specifications of the system or module. The most obvious functional testing procedure is exhaustive testing, which as we have stated, is impractical. One criterion for generating test cases is to generate them randomly. This strategy has little chance of resulting in a set of test cases that is close to optimal

Functional Testing Hence, we need some other criterion or rule for selecting test cases. There are no formal rules for designing test cases for functional testing. However, there are a number of techniques or heuristics that can be used to select test cases that have been found to be very successful in detecting errors. Here we mention some of these techniques. 1) Equivalence Class Partitioning: Exhaustive testing is infeasible then the next natural approach is to divide the input domain into a set of equivalence classes, so that if the program works correctly for a value then it will work correctly for all the other values in that class. If we can indeed identify such classes, then testing the program with one value from each equivalence class is equivalent to doing an exhaustive test of the program. But without looking at the internal structure of the program, it is impossible to determine such ideal equivalence classes The equivalence class partitioning method tries to approximate this ideal.

Equivalence Class Partitioning An equivalence class is formed of the inputs for which the behaviour of the system is specified or expected to be similar. Each group of inputs for which the behaviour is expected to be different from others is considered a separate equivalence class. For example, the specifications of a module that determines the absolute value for integers specify one behaviour for positive integers and another for negative integers. In this case, we will form two equivalence classes—one consisting of positive integers and the other consisting of negative integers. We should define equivalence classes for invalid inputs also. Equivalence classes are usually formed by considering each condition specified on an input if an input condition specifies a range of values (say, 0 < count < Max), then form a valid equivalence class with that range and two invalid equivalence classes, one with values less than the lower bound of the range (i.e., count < 0) and the other with values higher than the higher bound (count > Max).

Equivalence Class Partitioning If the input specifies a set of values and the requirements specify different behaviour for different elements in the set, then a valid equivalence class is formed for each of the elements in the set and an invalid class for an entity not belonging to the set. One approach to determine the equivalence class is: If we know that the entire range of input will not be treated in same manner then range should be split into two or more equivalence classes, each consisting of values for which the behaviour is expected to be similar. For example, for a character input, if we have reasons to believe that the program will perform different actions if the character is an alphabet, a number, or a special character, then we should split the input into three valid equivalence classes.

Equivalence Class Partitioning Another approach for forming equivalence classes: consider any special value for which the behaviour could be different as an equivalence class For example, the value ‘0’ could be a special value for an integer input. Also, for each valid equivalence class, one or more invalid equivalence classes should be identified. Equivalence Classes in the output: For an output equivalence class, the goal is to have inputs such that the output for that test case lies in the output equivalence class. e.g. a program for determining rate of return for some investment. There are three clear output equivalence classes positive rate of return, negative rate of return, and zero rate of return. In testing we give three kinds of inputs so that such that each of the outputs are generated. It is difficult to determine the test cases for output classes. But output classes reveal those errors that are not revealed by input classes.

Equivalence Class Partitioning After selecting the Equivalence classes, now next to select is test cases. One strategy is selecting test case covering as many valid equivalence classes as it can and one separate test case for each invalid equivalence class. Another Strategy is to have a test case cover at most one valid equivalence class for each input, and have one separate test case for each invalid equivalence class. Here total no. of test cases for valid E: classes are : Largest no. of E: classes for any input + total no. of Invalid E: Classes. For Example: consider a program that takes two inputs—a string s of length up to N and an integer n. The program is to determine the top n highest occurring characters in s. 9

Equivalence Class Partitioning Now we have to select test cases: With first strategy, one test case can be ‘s’ as a string of length less than .N containing lower case, upper case, numbers, and special characters; and n as the number 5. This one test case covers all the valid equivalence classes (EQl through EQ6). Then we will have one test case each for covering lEQl, IEQ2, and IEQ3. That is, a total of 4 test cases is needed. In second approach, one test case we can cover one equivalence class for one input only. It could be : a string of numbers, and 5. This covers EQl and EQ6. Then we will need test cases for EQ2 through EQ5, and separate test cases for lEQl through IEQ3.

Boundary Value Analysis There are some values at the boundary of equivalence classes for which program does not work correctly. In Boundary Value Analysis we choose an input for a test case from an equivalence class, such that the input lies at the edge of the equivalence classes. It has to cover output equivalence classes also. Boundary value test cases are also called "extreme cases.“ Hence it is a test case of input data that lies on the edge or boundary of a class of input data or that generates output that lies at the boundary of a class of output data. Here it is useful to select the boundary elements of the range and an invalid value just beyond the two ends (for the two invalid equivalence classes). i.e. if the range is 0.0 < x < 1.0, then the test cases are 0.0, 1.0 (valid inputs), and -0.1, and 1.1 (for invalid inputs).

Boundary Value Analysis Also consider the outputs for boundary value analysis. we should try to generate test cases that will produce the output that lies at the boundaries of the equivalence classes. Also form test cases that will produce an output that does not lie in the equivalence class. It will tell you that there is an error. Here we first determine values for each of the variables that should be exercised during testing, But what to do if there multiple inputs covering boundary values. Suppose each input variable has a defined range. Then there are 6 boundary values—the extreme ends of the range, just beyond the ends, and just before the ends. If an integer range is min to max, then the six values are min-1, min, min+1 ,max -1, max, max + 1.

Test Case Execution and Analysis Suppose there are n such input variables. There are two strategies for combining the boundary values for the different variables in test cases. In the first strategy: we select the different boundary values for one variable, and keep the other variables at some nominal value. And we select one test case consisting of nominal values of all the variables. In this case, we will have 6n+1 test cases. For two variables X and Y, the 13 test cases will be as shown: A second strategy is to try all possible combinations for the values for the different variables. As there are 7 values for each variable (6 boundary values and one nominal value), if there are n variables, there will be a total of 7ntest cases.