Software testing techniques Spring 2009 Csci565: Theory and Practice of Software Testing1.

Slides:



Advertisements
Similar presentations
CompSci 230 Software Design and Construction Software Quality 2014S2 Black box testing.
Advertisements

Discrete Mathematics Lecture 5 Alexander Bukharovich New York University.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Structures & Algorithms Basics of Set Theory EECE 320 — UBC.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 1: (Part 2): The Foundations: Logic and Proofs.
Instructor: Hayk Melikya
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
The Engineering Design of Systems: Models and Methods
Relations.
Applied Discrete Mathematics Week 11: Graphs
CSE115/ENGR160 Discrete Mathematics 04/24/12 Ming-Hsuan Yang UC Merced 1.
Sets, Relation and Functions A set is a collection of objects (elements) or a container of objects. Defining sets –Empty set (Ø): no elements –Universal.
modified from UCI ICS/Math 6D, Fall Sets+Functions-1 Sets “Set”=Unordered collection of Objects “Set Elements”
CS104 : Discrete Structures Chapter II Fundamental Structures.
Discrete Mathematics Lecture#11.
1 Section 7.1 Relations and their properties. 2 Binary relation A binary relation is a set of ordered pairs that expresses a relationship between elements.
Discrete Maths Objective to re-introduce basic set ideas, set operations, set identities , Semester 2, Set Basics 1.
Equivalence Class Testing
Relations Chapter 9.
CS355 - Theory of Computation Lecture 2: Mathematical Preliminaries.
Logics for Data and Knowledge Representation Introduction to Algebra Chiara Ghidini, Luciano Serafini, Fausto Giunchiglia and Vincenzo Maltese.
Sets Set Operations Functions. 1. Sets 1.1 Introduction and Notation 1.2 Cardinality 1.3 Power Set 1.4 Cartesian Products.
Math 3121 Abstract Algebra I Section 0: Sets. The axiomatic approach to Mathematics The notion of definition - from the text: "It is impossible to define.
Chapter 3 – Set Theory  .
Week 15 - Wednesday.  What did we talk about last time?  Review first third of course.
Michaelmas Term 2004 Discrete Mathematics CSC 141 Discrete Mathematics Dr. Corina Sas and Ms. Nelly Bencomo
1 Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 1 Adaptation to this.
CS 103 Discrete Structures Lecture 10 Basic Structures: Sets (1)
Set Theory Dr. Ahmed Elmoasry. Contents Ch I: Experiments, Models, and Probabilities. Ch II: Discrete Random Variables Ch III: Discrete Random Variables.
Sets Define sets in 2 ways  Enumeration  Set comprehension (predicate on membership), e.g., {n | n  N   k  k  N  n = 10  k  0  n  50} the set.
Discrete Structure Sets. 2 Set Theory Set: Collection of objects (“elements”) a  A “a is an element of A” “a is a member of A” a  A “a is not an element.
Language: Set of Strings
Discrete Mathematics R. Johnsonbaugh
CompSci 102 Discrete Math for Computer Science
Chapter SETS DEFINITION OF SET METHODS FOR SPECIFYING SET SUBSETS VENN DIAGRAM SET IDENTITIES SET OPERATIONS.
Mathematical Preliminaries
Sets and Subsets Set A set is a collection of well-defined objects (elements/members). The elements of the set are said to belong to (or be contained in)
Chapter 2 With Question/Answer Animations. Section 2.1.
Rosen 1.6, 1.7. Basic Definitions Set - Collection of objects, usually denoted by capital letter Member, element - Object in a set, usually denoted by.
Discrete Mathematics SETS. What is a set? ^A set is a unordered collection of “objects”  People in a class: {A yşe, B arış, C anan }  Cities in Turkey.
Chapter Relations and Their Properties
Discrete Mathematics CS 2610 January 27, part 2.
Discrete Mathematics Set.
Set Theory Concepts Set – A collection of “elements” (objects, members) denoted by upper case letters A, B, etc. elements are lower case brackets are used.
1 Equivalence relations Binary relations: –Let S1 and S2 be two sets, and R be a (binary relation) from S1 to S2 –Not every x in S1 and y in S2 have such.
Equivalence Class Testing Use the mathematical concept of partitioning into equivalence classes to generate test cases for Functional (Black-box) testing.
Module #3 - Sets 3/2/2016(c) , Michael P. Frank 2. Sets and Set Operations.
1 Set Theory Second Part. 2 Disjoint Set let A and B be a set. the two sets are called disjoint if their intersection is an empty set. Intersection of.
Introduction to Graph Theory & its Applications
Advanced Digital Designs Jung H. Kim. Chapter 1. Sets, Relations, and Lattices.
Week 15 - Wednesday.  What did we talk about last time?  Review first third of course.
Chapter 2 1. Chapter Summary Sets (This Slide) The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions.
Week 8 - Wednesday.  What did we talk about last time?  Relations  Properties of relations  Reflexive  Symmetric  Transitive.
“It is impossible to define every concept.” For example a “set” can not be defined. But Here are a list of things we shall simply assume about sets. A.
Introduction to Set Theory (§1.6) A set is a new type of structure, representing an unordered collection (group, plurality) of zero or more distinct (different)
1.1 – SETS AND SYMBOLS. Goals SWBAT understand basic set notation and set symbols SWBAT solve simple sentences with a given domain SWBAT graph sets of.
Relations and Their Properties
Citra Noviyasari, S.Si, MT
Chapter 5 Relations and Operations
Formal Language & Automata Theory
Sets Section 2.1.
Cartesian product Given two sets A, B we define their Cartesian product is the set of all the pairs whose first element is in A and second in B. Note that.
Chapter 1 Logic and Proofs Homework 2 Given the statement “A valid password is necessary for you to log on to the campus server.” Express the statement.
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 2 Sets Slides are adopted from “Discrete.
CS100: Discrete structures
Mathematical Background 1
Mathematical Background 1
MCS680: Foundations Of Computer Science
Applied Discrete Mathematics Week 3: Sets
Equivalence Relations
Presentation transcript:

Software testing techniques Spring 2009 Csci565: Theory and Practice of Software Testing1

 Write a set of test cases (i.e., specific sets of data to test a simple program  Program description  The program reads three integer values from an input dialog  The three values represent the lengths of sides of a triangle  The program displays a message that states whether the triangle is ▪ Scalene ▪ Isosceles ▪ equilateral Csci565: Theory and Practice of Software Testing2

 A scalene triangle is one where no two sides are equal  Isosceles has two equal sides  Equilateral has three sides equal length  Angles opposite the equal sides in an isosceles also are equal Csci565: Theory and Practice of Software Testing3

 Give yourself one point for each “yes” answer 1. Do you have a test case that represent a valid scalene triangle? ( note test cases such as 1,2,3, and 2,5,10 do not warrant a “yes” 2. Do you have a test case that represents a valid equilateral triangle? 3. Do you have a test-case that represents a valid isosceles triangle ( 2,2, 4 would not count because it is not a valid triangle) 4. Do you have at least three test cases that represent valid isosceles triangles such that you have tried all three permutations of two equal sides (such as 3,3,4; 3,4,3, 4,3,3)? 5. Do you have a test case in which one side has a zero value? 6. Do you have a test case in which one side has a negative value? 7. Do you have a test case with three integers greater than zero such that the sum of two of the number is equal to the third? ( e.g. 1,2,3) Csci565: Theory and Practice of Software Testing4

8. Do you have at least three test cases in category 7 such that you have tried all three permutations where the length of one side is equal to the sum of the lengths of the other two sides (e.g. 1,2,3; 1,3,2; and 3,1,2)? 9. Do you have a test case with three integers greater than zero such that the sum of two of the numbers is less than the third (e.g. 1,2, 4 or 12, 15, 30)? 10. Do you have a t least three test cases in category 9 such that you have tried all three permutations (e.g. 1,2,4: 1,4,2: and 4,1,2)? 11. Do you have a test case in which all sides are zero (0,0,0)? 12. Do you have at least one test case specifying non-integer value ( such as 2.5, 3.5., 5.5)? 13. Do you have at least one test case specifying the wrong number of values (two rather than three integers) 14. For each test case did you specify the expected output from the program in addition to the input values Csci565: Theory and Practice of Software Testing5

 Highly qualified professional programmers score (on average ) 7.8 out of possible 14  Congratulations if you have done > 7.8  Now consider testing a 100,000 statement air traffic control system, a compiler, or even payroll system, C++ programs  Bottom line: complete testing of real-world program is very difficult test Csci565: Theory and Practice of Software Testing6

 Common Abstract Models that have used for various testing techniques include 1. Logical expressions (predicates/clauses) 2. Graphs 3. Input space partitioning ( possible values used as inputs) 4. Syntactic based testing ( use a syntactic description such BNF for recognizing /generating testing artifacts) Csci565: Theory and Practice of Software Testing7

 Discuss discrete math and functional testing  Set theory  Set definition  The empty set  Set operations  Set relations  Set partitions  Set identities  Functions and relations  Propositional logic Csci565: Theory and Practice of Software Testing8

 Sets are collections of objects or things  E.g.  A set of people  A set of shops  A set of numbers  All these sets characterized mathematically by  Their elements (or members)  Well-defined relation between elements (  ) ▪ Given an object “a” and a set S, a  S Csci565: Theory and Practice of Software Testing9

 There are (at least) two way to define sets  List the elements of sets ▪ E.g., ▪ set of rich European countries  {France, Germany, UK, Italy}  Or, write a predicate (condition) on membership of elements (set comprehension) ▪ {x| x  EU  rich(x)} ▪ Very precise (GOOD) ▪ Can be very complex (BAD) Csci565: Theory and Practice of Software Testing10

 The set contains no elements  It is a unique set  Denoted by  or {} Csci565: Theory and Practice of Software Testing11

 Much of the expressive power of set comes from basic operations  Union  Intersection  Complement  Difference Csci565: Theory and Practice of Software Testing12

 Difference: A – B = { x: x  A  x  B} Csci565: Theory and Practice of Software Testing13

 Works with notion of ordered pair ( )  The Cartesian product of two sets A and B is the set  A  B = { : x  A  y  B}  E.g., A = {a, b}, B= {1, 2}, ▪ A  B = {,,, }  Unordered pair (a, b)  for a  b,  (a, b) = (b,a) but  Csci565: Theory and Practice of Software Testing14

 Given two sets, A and B  A  B ( A is a subset of B) ▪ iff a  A  a  B  A  B ( A is a proper subset of B), ▪ iff A  B  B-A   A = B ( A and B are equal) ▪ iff A  B  B  A Csci565: Theory and Practice of Software Testing15

 Partition means to divide up a whole into pieces such that  everything is in some piece (completeness)  nothing is left out (no gap)  Set partitioning is very important for testers  Completeness (all requirements/things is specified)  Non-redundancy (no overlap)  Definition  Given a set A, and a set of subsets A1, A2,…An of A, the subsets are a partition of A iff ▪ A1  A2  …  An=A ▪ i  j  A i  A j =  Csci565: Theory and Practice of Software Testing16

NameExpression Identity laws A  =A; A  U=A Domination Laws A  U=U A  =  Idempotent laws A  A =A A  A=A Complementation Laws(A’)’=A Associative laws A  (B  C)= (A  B)  C Distributive laws A  (B  C)= (A  B)  (A  C) deMorgan’s Laws (A  B)’= A’  B’ (A  B)’= A’  B’ 17 Csci565: Theory and Practice of Software Testing

 Central notion to software development and testing  Associate elements of sets (domain and range)  A domain element cannot be associated with more than one range element (well-behaved)  Any program can be seen as a function  takes some input and generate some outputs ▪ F: A  B ▪ F  A  B Csci565: Theory and Practice of Software Testing18

 A set called image of A under f  F(A) = { b i : b i  B  a i  A  b i =f(a i ) }  F is a function from A onto B iff f(A) = B  F is a function from A into B iff f(A)  B  F is 1-to-1 function from A to B  iff,  a i, a j  A: a i  a j  f(a i )  f(a j )  F is M-to-1 function from A  iff,  a i, a j  A: a i  a j  f(a i ) =f(a j ) Csci565: Theory and Practice of Software Testing19

 The general form of function  One element in domain can be associated/mapped to one or more elements in the range  Given two sets A and B, a relation R is a subset of the A  B  Cardinality of R  One-to-one (e.g., relationship has between students and IDs)  Many-to-one (e.g., relationship teach between Instructor and course)  One-to-many (e.g., relationship dependence between Emp., and their dependents)  Many-to-many (e.g., relationship enroll between students and courses)  The participation of R  Total: iff every element of A is in some ordered pair in R  Partial: iff some element of A is not in some ordered pair in R  Onto: iff every element of B is in some ordered pair in R  Into: iff some elements of B is not in some ordered pair in R Csci565: Theory and Practice of Software Testing20

 Assume that R is relation on a set A  R is reflexive if for every a  A, aRa  R is symmetric if for every a and b  A, if aRb, then bRa  R is transitive if for every a, b, and c  A, then aRc  R is anti-symmetric if for every,a,b>,  R, then a=b  R is an ordering relation on A if R ▪ Reflexive, anti-symmetric and transitive ▪ E.g.,  Csci565: Theory and Practice of Software Testing21

 R is an equivalence relation on A if R ▪ Reflexive, symmetric and transitive  The equality relation on any set A is a simple example of an equivalence relation because all three properties can be checked easily  E.g., suppose employees is divided into groups (departments, D 1, D 2,..D n ) ▪ e1 and e2 is related if they work on the same department (e1 R e2) ▪ The relation is reflexive because any employee is in its own Di ▪ The relation is symmetric because if e1 and e2 are in the same D i, then e2 and e1 are in same D i ) ▪ The relation is transitive because if e1 and e2 are in the same D i, and e2 and e3 is also in the same D i, then e1 and e3 is same D i ) Csci565: Theory and Practice of Software Testing22

Csci565: Theory and Practice of Software Testing23 Q u e s t i o n sQ u e s t i o n sQ u e s t i o n s