Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 16

Essential Mathematics

For Test Engineers


- Sundaresan Krishnaswami
• An omni-channel feature

Imagine • A payment page


• Business rules or complex algorithms
Testing • A semi conductor
A Tester’s Day

TEST DESIGN APPLY LOGIC


Does it ring a bell?

• Collections (Array, Lists)


• Data types
• Collection of objects

• Combinatorial testing
• Orthogonal Array
• Equivalence class
• Data-set
Walk down the memory lane

Set Algebra:

A set is a collection of objects known as elements


Example

• V = {cat, dog, fish}


• W = {1, 2}
• X = {1, 3, 5}
• Y = {n : n is an odd integer} = {. . . , −5, −3, −1, 1, 3, 5, . . .}
Defining Sets

• If ‘a’ is an element of set A, then a ∈ A denotes “a is an element


of A.”
• Sets can be finite or infinite.
• ∅ denotes the empty set { }, which does not contain any elements
Defining Sets contd…

• B is a subset of A if every element of B is an element of A. We


write B ⊆ A and show B ⊆ A by proving that if b ∈ B, then b ∈ A.

B
Defining Sets contd…

• A × B denotes the Cartesian product of A and B and


consists of the set of all ordered pairs with first-
coordinate in A and second-coordinate in B;
symbolically, we define A × B = {(a, b) : a ∈ A and b
∈ B}.
• The figure to the right shows the Cartesian product
of the sets A={1,2,3} and B={x,y}.
Defining Sets contd…

Intersection: If A = {2, 4, 6, 8, 10} and B = {1, 3, 8,


4, 6}. Find intersection of two set A and B. 
Solution:

A ∩ B = {4, 6, 8}

Union: If A = {1, 3, 7, 5} and B = {3, 7, 8, 9}. Find


union of two set A and B. 
Solution:

A ∪ B = {1, 3, 5, 7, 8, 9} 


Where can you use Set Algebra

• In creating equivalence classes


• A empty set
• And a superset with subset
• While testing a credit card
• Credit Card is the super set
• Subset: {Master, Visa, Amex}
• All Card Types are Universal Set
• Evolve the Cartesian product of all sets
Where can you use Set Algebra

• In your automation
• JSON
• Add/edit Arrays and lists
• (Ordered pair, unordered pair etc…)

• Feature relationships
• Evolve intersection or union of features
Logic: Truth Table

• Definition: A chart that shows the truth-value of one or


more compound propositions for every possible combination of
truth-values of the propositions making up the compound ones.
Where to use Truth Table

• Can be used to test the validity of arguments


• For ex: There are a combination of business rules to test.
• Feature configurator
• P=When X is checked and Q=when Y is checked feature A must be available
• P=When X is checked or Q=when Y is checked feature A must not be
available
How to use

And Or

P Q T or F P Q T or F
T T T T T T
T F F T F T
F T F F T T
F F F F F F
Further Reading

• https://www.javatpoint.com/algebra-of-sets
• https://www.britannica.com/topic/truth-table

You might also like