Boundary Value Analysis

Slides:



Advertisements
Similar presentations
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 1 Chapter 20 Software Testing.
Advertisements

Equivalence Partitioning
Testing Constrained Combinations Vera Pironska QA Engineer XAML Team 1 XAML Team 1 Telerik QA Academy Telerik QA Academy.
Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page: Lecture.
Chapter 2: Boundary Value Testing : BVT Software Testing
Murach’s ASP.NET 4/C#, C6© 2011, Mike Murach & Associates, Inc.Slide 1.
Murach’s ASP.NET 4/C#, C3© 2011, Mike Murach & Associates, Inc.Slide 1.
Murach’s ASP.NET 2.0/C#, C3© 2006, Mike Murach & Associates, Inc.Slide 1.
Murach’s ASP.NET 4/C#, C2© 2011, Mike Murach & Associates, Inc.Slide 1.
Testing and Quality Assurance
Murach’s ASP.NET 3.5/C#, C4© 2008, Mike Murach & Associates, Inc.Slide 1.
Automated Shot Boundary Detection in VIRS DJ Park Computer Science Department The University of Iowa.
Nov R McFadyen1 A Traditional Software Development Process Unit test Integration test System test Detailed design Architectural design Analysis.
Software Testing and Quality Assurance
Testing an individual module
(a) (b) (c) (d). What is (1,2,3)  (3,4,2)? (a) (1, 2, 3, 4) (b) (1,2)  (3,4) (c) (1,3,4,2) (d) (3,1)  (4,2)
Software Testing Prasad G.
How do you simplify? Simple Complicated.
Test Design Techniques
Trees, Tre-Like Structures, Binary Search Trees, Balanced Trees, Tree Traversals, DFS and BFS Svetlin Nakov Telerik Software Academy academy.telerik.com.
Ivan Stanchev QA Engineer System Integration Team Telerik QA Academy Telerik QA Academy.
White-box Testing Black-box Testing Extensions
Let us start from the V-Model Verification Phases Requirements analysis System Design Architecture Design Module Design Coding Validation phases Unit.
Testing by Splitting Data Into Equivalence Classes Telerik Software Academy Software Quality Assurance.
Introduction Telerik Software Academy Software Quality Assurance.
Software testing basic. Main contents  Why is testing necessary?  What is testing?  Test Design techniques  Test level  Test type  How to write.
Unit Testing -Ranjit Shewale Contents  Scope  Owner  Approach  Conventional approach  Object oriented approach  Tips for the.
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.
A General Discussion on Functional (Black-box) Testing What are some of the concerns of testers ? –Have we got enough time to test (effort & schedule)?
Introduction to Software Testing. Types of Software Testing Unit Testing Strategies – Equivalence Class Testing – Boundary Value Testing – Output Testing.
Software testing techniques Software testing techniques Equivalence partitioning Presentation on the seminar Kaunas University of Technology.
Testing Testing Techniques to Design Tests. Testing:Example Problem: Find a mode and its frequency given an ordered list (array) of with one or more integer.
Black Box Testing Techniques Chapter 7. Black Box Testing Techniques Prepared by: Kris C. Calpotura, CoE, MSME, MIT  Introduction Introduction  Equivalence.
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 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.
Loops, Databases, Procedures, and Lists Dr. José M. Reyes Álamo.
CS 217 Software Verification and Validation Week 7, Summer 2014 Instructor: Dong Si
ISV for ERP Software. setting the goal ●Creating additional ERP modules providing extra functionality ●Co-development for extending existing ERP modules.
Storage Centre HKOI 2007 Senior Q1 Kelly Choi. The Problem The COW Team are going to look for treasures in N ruins in a rectangular map. The COW Team.
 J Tuzo Wilson- lithosphere is broken into separate sections called plates.  Combine all information from continental drift, sea-floor spreading, and.
1. Black Box Testing  Black box testing is also called functional testing  Black box testing ignores the internal mechanism of a system or component.
Signing Numbers: When you are signing a quantity, your palm faces in. “I have 3 brothers.” When the number is within a group of numbers,
Testing Constrained Combinations Telerik Software Academy Software Quality Assurance.
1 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Requirements-based Test Generation for Functional Testing W. Eric Wong Department of.
1 Math Review: mean, median, mode, range. 2 Average Number of s  x x x x x x x___x___x_____x__________ s sent today  What is the.
Making Smoke in PhotoShop How To Make It Look Real.
Equivalence Partitioning
Software Engineering (CSI 321)
Thin Film Interference
Equivalence partitioning
Equivalence partitioning
WARNING These slides are not optimized for printing or exam preparation. These are for lecture delivery only. These slides are made for PowerPoint 2010.
Boundary Value Analysis
Lecture on Black Box Testing
CSE 403 Software Engineering
Entity-Relationship Modeling
Types of Testing Visit to more Learning Resources.
Team 1: 32 responses Team 2: 55 responses Team 3: 29 responses
Software Quality Engineering
MBML_Efficient Testing Methodology for Machine Learning
Nate Brunelle Today: Slicing, Debugging, Style
Chapter 10 – Software Testing
Instantaneous Rates & Concept of Derivative
Topic 1: Be able to combine functions and determine the resulting function. Topic 2: Be able to find the product of functions and determine the resulting.
Mutation Testing The Mutants are Coming! Copyright © 2017 – Curt Hill.
Chapter 1: Boundary Value Testing
Java & Testing.
Software Testing and QA Theory and Practice (Chapter 5: Data Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
Presentation transcript:

Boundary Value Analysis Testing on the Edge Mihail Parvanov Team Lead ASP. NET Team 2 Telerik QA Academy

Table of Contents Boundary Value Analysis – Main Concepts Boundary Values and Conditions Ordered Sets Sub-boundary conditions How many Boundary Values? BVA With Floating Point Data Examples of Boundary Conditions Deriving Test Cases With BVA

What is BVA? Boundary value analysis (BVA) is a black-box test design technique in which test cases are designed based on boundary values Conceptually, boundary value analysis is about testing the edges of equivalence classes

Why Test the Boundaries? If an operation is performed on a range of numbers: Odds are the programmer got it right for the vast majority of the numbers in the middle, But maybe made a mistake at the edges

Common Mistake Example This is an example of a simple, but very common mistake: Many bugs occur due to careless usage of indexes, operators ( for example < instead of <= ), etc. int[] arr = new int[10]; for(i = 1; i < 10; i++) { arr[i] = 1; } Console.WriteLine(arr[0]); // 0 The value at index [0] is not changed to 1.

Why Should This Work? If a software can operate on the edge of its capabilities, it will almost certainly operate well under normal conditions

What is a Boundary Value? An input value or output value that is on the edge of an equivalence partition Or at the smallest incremental distance on either side of an edge E.g., the minimum or maximum value of a range

What is a Boundary Value? (2) The point where the expected behavior of the system changes The values could be either input or output ranges of a software component

Valid / Invalid Values If the boundary values are members of a valid equivalence class, they are valid If they are members of an invalid equivalence class, they are invalid invalid valid invalid 1 31 …-2-1 0 2 3 4 …. …28 29 30 32 33 … Days of a month

Boundary Conditions Boundary conditions are the situations at the edge of the planned operational limits of the software Types of data with boundary conditions: Numeric Speed Character Location Position Size Quantity Etc.

Characteristics of Boundary Conditions First/Last Largest/Smallest Start/Finish Highest/Lowest Min/Max Next-To/Farthest- From Over/Under Etc. Empty/Full Shortest/Longest Slowest/Fastest Soonest/Latest

Ordered Sets Only Not all equivalence classes have boundary values! Boundary value analysis is an extension of equivalence partitioning Applies only when the members of an equivalence class are ordered

Ordered Sets Only (2) An ordered set is one where we can say that one member is greater than or less than some other member If those two members are not the same

Ordered Sets Only (3) Just because some item is right above or below some other item on a pull-down menu does not mean that, within the program, the two items have a greater- than/less-than relationship

Ordered Sets Examples Ranges of numbers Amount of available memory How many times something is done Speed of data entry (time between keystrokes, menus, etc.) Size of a number to enter (number of digits) Etc. Size of a character string Size of a file Size of a file name

Sub-Boundary Conditions Some boundaries, that are internal to the software aren't necessarily apparent to an end user but still need to be checked by the software tester These are known as sub-boundary conditions or internal boundary conditions

Sub-Boundary Conditions (2) If internal program data structures have prescribed boundaries (e.g., an array has a defined limit of 100 entries), be certain to design a test case to exercise the data structure at its boundary 0 1 2 … … … 98 99 …

How Many Boundary Values Exist At A Boundary?

Number Of Boundary Values How many boundary values should be considered at the edge of a partition? There are two main approaches The difference mainly occurs due to difference in the way the data is being presented: graphical or mathematical

Graphical Representation The boundary lies between the largest member of one equivalence class and the smallest member of the equivalence class above it The boundary itself doesn't correspond to any member of any class and Only two boundary values are considered at each edge of a partition class valid invalid invalid 1 99 x 100

Mathematical Representation The mathematical analysis sets three values at each edge: The value corresponding to the boundary itself; The closest value inside the partition; The closest value outside the partition. 0 < = x < = 100 -1 1 99 101 100

Boundary Values With Floating Point Data Be careful when you set boundary values for floating point data! Floating point numbers, like integers, are also ordered sets. However, while integers do not have decimal points, floating point numbers do 0.0000001 -0.0000001

Boundary Values With Floating Point Data (2) How many decimal points? That is a question of the particular field's precision This is sometimes referred to as epsilon or the smallest recognizable difference We can't figure out what the boundary values are without knowing the answer to this question Problems with precision, and particularly ambiguity about it, are fertile ground for bugs

Examples Of Boundary Conditions

Text Entry Field If a text entry field allows 1 to 255 characters: Try entering 1 character and 255 characters as the valid partition You might also try 2 and 254 characters as a valid choice Enter 0 and 256 characters as the invalid partitions

CD-R Writing / Reading If a program reads and writes to a CD-R: Try saving a file that's very small, maybe with one entry Save a file that's very large just at the limit for what the disc holds Try saving an empty file and a file that's too large to fit on the disc

Printing If a program allows you to print multiple pages onto a single page: Try printing just one (the standard case) Try printing the most pages that it allows If you can, try printing zero pages and one more than it allows

ZIP code If the software has a data-entry field for a 9- digit ZIP code: Try 00000-0000, the simplest and smallest Try entering 99999-9999 as the largest Try entering one more or one less digit than what's allowed

Flight Simulator If you're testing a flight simulator - try flying: Right at ground level At the maximum allowed height for your plane Below ground level below sea level Into outer space

Output BVA Testing boundary conditions of an output data Adjust the input to produce particular output results E.g., assume that a temperature vs. pressure table is required as output from a program Test cases should be designed to create an output report that produces the maximum (and minimum) allowable number of table entries

Deriving Test Cases With BVA

Deriving Test Cases With BVA Similar to deriving tests with equivalence partitioning We test valid boundary values together Then combine one invalid boundary value with other valid boundary values

The Coverage Criterion Each boundary value must be represented in at least one test case Both – valid and invalid test cases

Types of Improper Handling Deriving test cases we are testing for situations where some equivalence class is handled improperly Improper hanlding could mean: Acceptance of values that should be rejected Rejection of values that should be accepted Proper acceptance or rejection, but improper handling subsequently

Boundary Value Analysis MS Word Font Size Menu Boundary Value Analysis Live Demo

Font Size Menu BVA Applying Equivalence Partitioning and BVA: 1 -1 8 72 Valid Invalid (low) Invalid (high) Menu entry BVA EP Not integer EP { letters, decimal, null .. } EP Direct entry Integer BVA 1 Valid Invalid (neg.) Invalid (high) 1638 -1 1639 max min

Limitations of BVA: Boolean and logical variables present a problem for Boundary Value Analysis BVA assumes the variables to be truly independent This is not always possible BVA test cases have been found to be rudimentary Obtained with very little insight and imagination

Keep Looking It's vitally important that you continually look for boundaries in every piece of software you work with The more you look, the more boundaries you'll discover, and the more bugs you'll find Usually there are a few obvious ones If you dig deeper you'll find the more obscure, interesting, and often bug-prone boundaries

Boundary Value Analysis ? ? ? ? ? Questions? ? ? ? ? ? ?

Exercises Why does the boundary value analysis provide good test cases? Because it is an industry standard Because errors are frequently made during programming of the different cases near the ‘edges’ of the range of values Because only equivalence classes that are equal from a functional point of view are considered in the test cases Because the test object is tested under maximal load up to its performance limits

Exercises (2) Boundary value testing: Is the same as equivalence partitioning tests Test boundary conditions on, below and above the edges of input and output equivalence classes Tests combinations of input circumstances Is used in white box testing strategy

Exercises (3) In a flight reservation system, the number of available seats in each plane model is an input. A plane may have any positive number of available seats, up to the given capacity of the plane. Using Boundary Value analysis, a list of available – seat values were generated. Which of the following lists is correct? 1, 2, capacity -1, capacity, capacity plus 1 0, 1, capacity, capacity plus 1 0, 1, 2, capacity plus 1, a very large number 0, 1, 10, 100, capacity, capacity plus one

Exercises (4) A thermometer measures temperature in whole degrees only. If the temperature falls below 18 degrees, the heating is switched on. It is switched off again when the temperature reaches 21 degrees. What are the best values in degrees to cover all equivalence partitions?

Exercises (5) A wholesaler sells printer cartridges. The minimum order quantity is 5. There is a 20% discount for orders of 100 or more printer cartridges. You have been asked to prepare test cases using various values for the number of printer cartridges ordered. Generate test inputs using Boundary Values Analysis.

Exercises (6) An input field takes data on a person age, which should be between 1 to 99. Which are the appropriate boundary values for testing the field? An input field takes the year of birth between 1900 and 2011. Which are the appropriate boundary values for testing the field?

Exercises (7) In a system designed to work out the tax to be paid: An employee has $4000 of salary tax free. The next $1500 is taxed at 10% The next $28000 is taxed at 22% Any further amount is taxed at 40%. Define the boundary values for testing the system.

Exercises (8) Implement BVA for the following examples: Text entry field with allowed limits from 1 to 100 symbols Integer number entry field with value limit from 0 to 150 Number entry field of type float with limits from 0.0 to 10.0 Size of a file name from 1 up to 40 symbols

Exercises (9) Implement BVA for the MS Word Insert Table dialog box. Look for information about the minimum and maximum values allowed.

Exercises (10) Define the boundaries, and suitable boundary value test cases for the following: ZIP Code - five numeric digits First consider ZIP Code just in terms of digits. Then, determine the lowest and highest legitimate ZIP Codes in the United States Last Name - one through fifteen characters (including alphabetic characters, periods, hyphens, apostrophes, spaces, and numbers). Try to create a few very complex Last Names. Can you determine the "rules" for legitimate Last Names?

Exercises (11) User ID - eight characters at least two of which are not alphabetic (numeric, special, nonprinting) University Course ID - three alpha characters representing the department followed by a six- digit integer which is the unique course identification number. The possible departments are: PHY - Physics CHM - Chemistry EGR - Engineering MAT - Mathematics ENG - English PED - Physical education LAN - Foreign languages SOC - Sociology