Professional Documents
Culture Documents
Ourset: A Simple Set Adt in Python
Ourset: A Simple Set Adt in Python
Ourset: A Simple Set Adt in Python
Computing ID Name
With your partners, look at the methods from the API below and fill out the test plan on the next page. Discuss
your answers as you all work through the exercise.
Methods that exist but you cannot write tests for in this exercise:
Equivalence 0 Take a set and add an object that’s not already in the Function should return
(add) set. true and the object
should be added to the
set
Boundary 1 Take a set and an object that is already contained Function should return
(add) within that set. false and object should
not be added to the set
again
Equivalence Take a known set and divide it into two smaller sets. The returned set from the
(union) Compute the union operation between the smaller union function should be
2 sets and compare to the original set. equivalent to the original
large set.
Boundary Input two sets that are exactly the same. Function should return
(union) 3 union of these sets
without altering either of
them.
Boundary 4 Input two sets where one of the sets is a subset of Function should identify
(union) the other. the larger set and return
that one without altering
either of them.
Equivalence Take a known set and create two versions of it with Function should return a
(intersect 5 different additional values. Compute the intersection set equivalent to the
ion) function on the two new versions of the known set original known set
and compare to the original known set.
Boundary Input two sets that have no common values Function should return a
(intersect set that is empty without
ion) 6 altering either of original
sets.
Boundary Input two sets that are exactly the same Function should return
(intersect either of the sets without
ion) 7 altering them.
Exception Input a set and an object that is not a set Function should catch
(union) the exception and tell the
8 user not to input not-set
objects.