Com1040 Systems Design and Testing Part II – Testing (Based on A.J. Cowling’s lecture notes) LN-Test4: Category-Partition Method Marian Gheorghe ©University.

Slides:



Advertisements
Similar presentations
Data Structures Lecture 13: QUEUES Azhar Maqsood NUST Institute of Information Technology (NIIT)
Advertisements

CSC141- Introduction to Computer Programming Teacher: AHMED MUMTAZ MUSTEHSAN Lecture – 25 Thanks for Lecture Slides: Dr. Sadaf Tanveer Dr. Sadaf Tanveer,
Recursive Definitions and Structural Induction
What we learn with pleasure we never forget. Alfred Mercier Smitha N Pai.
C o n f i d e n t i a l Developed By Nitendra NextHome Subject Name: Data Structure Using C Title : Overview of Stack.
Comp 335 File Structures Indexes. The Search for Information When searching for information, the information desired is usually associated with a key.
4. FREQUENCY DISTRIBUTION
Constants A constant is a variable whose value is expected to remain the same throughout a program It is considered “good programming style” to use constants.
1.2 Row Reduction and Echelon Forms
VBA Modules, Functions, Variables, and Constants
1 Query Languages. 2 Boolean Queries Keywords combined with Boolean operators: –OR: (e 1 OR e 2 ) –AND: (e 1 AND e 2 ) –BUT: (e 1 BUT e 2 ) Satisfy e.
1 Algorithm Efficiency and Sorting (Walls & Mirrors - Remainder of Chapter 9)
Kavita Hatwal Fall Sequences and Induction.
ECE122 L3: Expression Evaluation February 6, 2007 ECE 122 Engineering Problem Solving with Java Lecture 3 Expression Evaluation and Program Interaction.
Hashing General idea: Get a large array
CS5371 Theory of Computation Lecture 8: Automata Theory VI (PDA, PDA = CFG)
C++ for Engineers and Scientists Third Edition
Heaps and heapsort COMP171 Fall 2005 Part 2. Sorting III / Slide 2 Heap: array implementation Is it a good idea to store arbitrary.
C++ fundamentals.
‘C’ LANGUAGE PRESENTATION.  C language was introduced by Dennis Ritchie..  It is a programming language, which can make a interaction between user and.
Microsoft® Small Basic
Relations Chapter 9.
Introduction To Databases IDIA 618 Fall 2014 Bridget M. Blodgett.
Com1040 Systems Design and Testing Part II – Testing (Based on A.J. Cowling’s lecture notes) LN-Test3: Equivalence classes and boundary conditions Marian.
Chapter 7: Arrays. In this chapter, you will learn about: One-dimensional arrays Array initialization Declaring and processing two-dimensional arrays.
Design and Analysis of Algorithms CSC201 Shahid Hussain 1.
Chapter 8. Section 8. 1 Section Summary Introduction Modeling with Recurrence Relations Fibonacci Numbers The Tower of Hanoi Counting Problems Algorithms.
Chapter 17: Arrays Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University Name.
Analyzing the Requirements with Formal Specifications Vienna Development Method Specification Language (VDM-SL) Book: Formal Software Development From.
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 5 – Dental Payment Application: Introducing.
DATA STRUCTURE & ALGORITHMS (BCS 1223) CHAPTER 8 : SEARCHING.
Arrays 1 Multiple values per variable. Why arrays? Can you collect one value from the user? How about two? Twenty? Two hundred? How about… I need to collect.
Summer Computing Workshop. Introduction  Boolean Expressions – In programming, a Boolean expression is an expression that is either true or false. In.
1 Compiler Construction (CS-636) Muhammad Bilal Bashir UIIT, Rawalpindi.
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.
1 Mr. Muhammad Hanif Lecturer Information Technology MBBS Campus Dadu University of SIndh.
Data Structures and Algorithms Lecture 1 Instructor: Quratulain Date: 1 st Sep, 2009.
Software Testing Input Space Partition Testing. 2 Input Space Coverage Four Structures for Modeling Software Graphs Logic Input Space Syntax Use cases.
Com Functional Programming Regular Expressions and Abstract Data Types Marian Gheorghe Lecture 14 Module homepage Mole &
Chapter 10 Hashing. The search time of each algorithm depend on the number n of elements of the collection S of the data. A searching technique called.
Chapter 11 Hash Tables © John Urrutia 2014, All Rights Reserved1.
ECSE Software Engineering 1I HO 4 © HY 2012 Lecture 4 Formal Methods A Library System Specification (Continued) From Specification to Design.
C Programming – Part 3 Arrays and Strings.  Collection of variables of the same type  Individual array elements are identified by an integer index 
COSC 2007 Data Structures II Chapter 13 Advanced Implementation of Tables IV.
Java Language Basics By Keywords Keywords of Java are given below – abstract continue for new switch assert *** default goto * package.
Labcheck Next Generation Quick Start Guide Filters.
UNIT 5.  The related activities of sorting, searching and merging are central to many computer applications.  Sorting and merging provide us with a.
CS 103 Discrete Structures Lecture 13 Induction and Recursion (1)
CSCI 3327 Visual Basic Chapter 8: Introduction to LINQ and Collections UTPA – Fall 2011.
CPSC 252 Hashing Page 1 Hashing We have already seen that we can search for a key item in an array using either linear or binary search. It would be better.
1 CSCD 326 Data Structures I Hashing. 2 Hashing Background Goal: provide a constant time complexity method of searching for stored data The best traditional.
CHP-3 STACKS.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 240 Elementary Data Structures Array Lists Array Lists Dale.
LISTS. LEARNING OBJECTIVES Create a block that accepts a parameter Create a block that returns a value Create scripts that manipulates lists Incorporate.
1 Ch.19 Divide and Conquer. 2 BIRD’S-EYE VIEW Divide and conquer algorithms Decompose a problem instance into several smaller independent instances May.
Computer Programming for Engineers
Copyright © Cengage Learning. All rights reserved. CHAPTER 8 RELATIONS.
CompSci 102 Discrete Math for Computer Science March 13, 2012 Prof. Rodger Slides modified from Rosen.
Com1040 Systems Design and Testing Part II – Testing (Based on A.J. Cowling’s lecture notes) LN-Test5: Category-Partition Method Marian Gheorghe ©University.
1 CSC103: Introduction to Computer and Programming Lecture No 17.
Data Structure and Algorithm: CIT231 Lecture 6: Linked Lists DeSiaMorewww.desiamore.com/ifm1.
LINKED LISTS.
Dr Nazir A. Zafar Advanced Algorithms Analysis and Design Advanced Algorithms Analysis and Design By Dr. Nazir Ahmad Zafar.
Functional testing, Equivalence class testing
Relations Chapter 9 Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill.
Pushdown Automata.
Polyhedron Here, we derive a representation of polyhedron and see the properties of the generators. We also see how to identify the generators. The results.
Polyhedron Here, we derive a representation of polyhedron and see the properties of the generators. We also see how to identify the generators. The results.
Presentation transcript:

Com1040 Systems Design and Testing Part II – Testing (Based on A.J. Cowling’s lecture notes) LN-Test4: Category-Partition Method Marian Gheorghe ©University of SheffieldCom Testing

Equivalence partition & Boundary conditions - recap Category-partition: principles and testing methodology Example Summary

Equivalence classes and boundaries Equivalence classes (or partitions) are defined according to various entities (variables) and certain functionality of a program Testing will identify equivalence classes and may add boundary conditions (test values around boundaries) Data set boundaries are either explicitly defined in the application or provided by the programming language constructs or the programming environment Two situations were analysed: simple data and multiple entities – triangle problem (similarly, structured data can be used) Somehow multiple entities define a simple case of what we discuss now…

Short characterisation: refinement of the partition-based method More precisely, it relies on: identifying properties of data and program behaviour defining partitions according to properties identified Example: A program reads data about people: year of birth and name; are listed those born after 2000 and called Smith. So, (1) the first category is given by year, leads to two classes – one containing values  2000 and another one with values <2000; (2) second category is name and consists of two classes as well: with Smith and without it. We combine these partitions and get 4 partitions …Category-partition method

Category-partition principles The method, mostly black box, but can be defined for white box as well, has three basic steps, of which consider two here: – Construct test cases for the preconditions associated to functions: two partitions – values satisfying conditions & the other values; the first class is further analysed in the next step –Construct test cases for the individual sets of items Consider sets of values occurring in many use cases (books, copies, lecturers, students, tennis players, tickets etc) -- these refer to data Consider the following situations: 1.the set is displayed as it is 2.process an element from the set 3.add a new element to the set -- the above refer to functionality

Size category When a set is displayed (case 1, on the previous slide) then, if there is no upper limit, the following three partitions are considered empty set: {} set containing one element: {a} set with more than one element: {a, b, …} When there is an upper limit, Max, then two more cases are considered: set with Max elements and with Max-1 The above characteristic refers to the size of a set of values and is called size category

Size category for the Library system Library system at uses Book, Copy and User business classes and, in SysData, collection classes Use cases requiring to browse through the book set or to get the books written by an author Test the system with empty collection collection with one Book object collection with more than one Book object

Position category for selected element When an item is selected (case 2) or it is added to a set (case 3) then the order of elements can be considered – position category. In case 2 the empty set and the set with one element remain the same, but the case of more than one element will change: selected element is the first selected element is the last selected element is in between We can also consider the upper limit and obtain three more cases similar to those above Total number of test cases 5 or 8 (if upper limit included)

Position category for added element When an item is added to a set (case 3) and the order of elements is considered then the empty set and the set with one element remain the same, but the case of more than one element will change: for the empty set - 1 test for one element – 2 tests: before and after the element for more than one – 3-5 tests: before the first/last, in the middle, after the first/last Boundary – i.e., upper limit can also be considered What about deleting an item?

Example An array, indexed 0..M-1, contains L ( 0≤L≤M ) pairs (age,name), where age is an integer in the range min..Max and name a string, stored between 0..L-1. A new pair (newAge,newName) is inserted after the element at position p ( -1 ≤p ≤L-1 ; p=-1 means insertion in the first position, 0 ). After insertion the string is filtered such as to contain only uppercase characters. Let us take L=4, M=20 and min=0, Max=100 Index: … 19 Age: after p=1 insert 19 Name: JOHNJOHN LUCYLUCY JENNYJENNY SAMSAM AlexAlex

Example cont’d An array, indexed 0..M-1, contains L ( 0≤L≤M ) pairs (age,name), where age is an integer in the range min..Max and name a string, stored between 0..L-1. A new pair (newAge,newName) is inserted after the element at position p ( -1 ≤p ≤L-1 ; p=-1 means insertion in the first position, 0 ). After insertion the string is filtered such as to contain only uppercase characters. Now L=5, M=20 and min=0, Max=100 Index: … 19 Age: Name: JOHNJOHN LUCYLUCY JENNYJENNY SAMSAM ALEXALEX

Example cont’d An array, indexed 0..M-1, contains L ( 0≤L≤M ) pairs (age,name), where age is an integer in the range min..Max and name a string, stored between 0..L-1. A new pair (newAge,newName) is inserted after the element at position p ( -1 ≤p ≤L-1 ; p=-1 means insertion in the first position, 0 ). After insertion the string is filtered such as to contain only uppercase characters. Categories: 1.properties of the pairs (newAge,newName) 2.properties of the array of pairs (age,name) wrt insertion at position p 3.properties implied by filtering Each category involves a partition and finally combine them (will see this is not the product of the partitions)

Example cont’d – categories 1 st category: properties of the added pair (newAge,newName) newAge - an integer in the range min..Max; generate the following 4 partitions (hence 4 tests) - preconditions: 1.values outside the range 2.{min} 3.{Max} 4.values between min and Max newName – string; one partition Total 4 tests

Example cont’d – categories 2 nd category: properties of the array containing L pairs (age,name); the insertion is after position p ; partitions: empty array ( L=0 ); insert in the first position – 1 test array with one element integer; insert before and after that element – 2 tests array with arbitrary elements (more than 1, but less than M ); insert on the first, after the first, after an arbitrary element and after the L -th, also outside the range of L elements – 5 tests array full ( L=M ); same as above, but no insertion is possible – 5 tests Total tests = 13 Combining the first two categories = 52

Example cont’d – categories 3 rd category: properties of the filtering function (transforms lowercase into uppercase of newName ) empty newName or containing only uppercases – 2 tests only one lowercase, arbitrary lowercases, all chars are lowercase elements - 3 tests So, total = 5 tests Is it necessary to combine the previous 52 tests with the current 5 ?? Explain why not

Equivalence partitions are generalised to category partitions Combine partitions to get final test sets Do not always combine all test cases Conclusions