CH05.L02.BBT-1-Equivalence Partitioning

MaharaTech - ITI MOOCA
23 Aug 202203:40

Summary

TLDRThe video script introduces the Equivalence Partitioning (EP) technique, a black box testing method used to efficiently test software by dividing input data into valid and invalid partitions. It emphasizes the importance of selecting representative samples from each partition to minimize the number of test cases needed. The script demonstrates how to apply EP to a range of numerical inputs, highlighting its effectiveness in reducing test case volume while maintaining coverage. It also mentions the technique's compatibility with boundary value analysis, setting the stage for the next video.

Takeaways

  • πŸ“š Equivalence Partitioning (EP) is a black box testing technique used to determine the probability of user input within a specific range.
  • πŸ” EP avoids writing extensive test cases by dividing inputs into valid and invalid partitions, reducing the number of tests needed.
  • πŸ“ˆ The valid partition includes numbers within the specified range, while the invalid partition includes numbers outside this range.
  • 🌐 Choosing a sample from each partition is sufficient to represent the entire group for testing purposes.
  • 🎯 If a test case for a number within a partition passes, it is highly likely that all other numbers in the same partition will also pass.
  • πŸ› Conversely, if a test case fails, it is probable that all numbers in the same partition will fail, indicating a bug.
  • πŸ“ The example given in the script involves testing a text field that accepts numbers from 1 to 100, dividing the inputs into three partitions: in-range, above-range, and below-range.
  • πŸ“‰ The number of test cases is minimized to the most effective number that can represent each part of the data range.
  • πŸ”‘ EP is not used in isolation but is often combined with boundary value analysis for more comprehensive testing.
  • πŸ”„ The division of inputs into partitions is not always into three; it depends on the nature of the input, such as number of sets or Boolean values.
  • πŸ“Œ For inputs requiring specific values, one valid partition is created for the identified value, with two invalid partitions for values outside this range.
  • πŸ” The script concludes by emphasizing the importance of using EP in conjunction with boundary value analysis for effective software testing.

Q & A

  • What is the abbreviation for Equivalence Partitioning?

    -The abbreviation for Equivalence Partitioning is EP.

  • Why is Equivalence Partitioning used in software testing?

    -Equivalence Partitioning is used to test the probability that the user's input falls within a specific range of data, reducing the number of test cases needed.

  • How does Equivalence Partitioning reduce the number of test cases?

    -It divides the data inputs into valid and invalid partitions, and only one sample from each partition is used in the test cases, representing the entire group.

  • What is the purpose of dividing the data into partitions in Equivalence Partitioning?

    -The purpose is to cover all possible input scenarios with the least number of test cases, ensuring that the test results can be generalized to all numbers within the same partition.

  • What are the three partitions created in the example provided in the script?

    -The three partitions are: valid partition for numbers within the range of data (1 to 100), invalid partition for numbers greater than 100, and another invalid partition for numbers less than 1.

  • How does testing one number in a partition represent the entire group in Equivalence Partitioning?

    -Testing one number in a partition is assumed to be representative of all numbers in that partition because the logic or behavior is expected to be the same for all numbers within the range.

  • What is the significance of choosing one number from each partition for testing?

    -Choosing one number from each partition ensures that all possible input scenarios are covered, which helps in identifying potential bugs or issues that might affect the entire group.

  • Can Equivalence Partitioning be used independently in software testing?

    -Equivalence Partitioning is not used separately; it is typically used in conjunction with boundary value analysis.

  • What is the relationship between Equivalence Partitioning and boundary value analysis?

    -Equivalence Partitioning is often used together with boundary value analysis to ensure that both the range and the boundaries of the input data are thoroughly tested.

  • How does Equivalence Partitioning apply to inputs like Boolean values or specific values?

    -For Boolean values, two partitions are created: one for the true value and one for all other values. For specific values, one valid partition is created for the identified value and two invalid partitions for values outside the specified range.

Outlines

00:00

πŸ” Introduction to Equivalence Partitioning (EP)

The video script introduces the Equivalence Partitioning (EP) technique, a black box testing method used to determine the probability of user input within a given range. It explains that instead of creating numerous test cases for every possible input, EP divides the input into 'valid' and 'invalid' partitions. The 'valid' partition includes inputs within the specified range, while the 'invalid' partition accounts for inputs outside this range. The script uses the example of a text field that accepts numbers from 1 to 100, suggesting that testing a single number from each partition is sufficient to represent the entire group within that partition. The technique is illustrated with three partitions: one for numbers within the range, one for numbers greater than 100, and one for numbers less than 1. The script emphasizes that if a test case from a group passes, it is highly likely that all numbers in that group will pass, and vice versa for failures. The video concludes by noting that EP is not used in isolation but in conjunction with boundary value analysis, which will be covered in a subsequent video.

Mindmap

Keywords

πŸ’‘Equivalence Partitioning (EP)

Equivalence Partitioning (EP) is a testing technique used to divide the input data of a software unit into partitions of data from which test cases can be derived. In the video, EP is used to test a range of data, such as a text field that accepts numbers from 1 to 100. The technique helps in reducing the number of test cases by selecting representative values from each partition. For example, testing the number 1 in the valid partition is equivalent to testing any number within the range, like 50 or 100.

πŸ’‘Test Cases

Test cases are specific scenarios or sets of conditions under which a software application is tested to determine whether it will perform as expected. In the context of the video, test cases are derived from the equivalence partitions. The script discusses how using EP can reduce the number of test cases needed to cover all possible input scenarios, thereby making the testing process more efficient.

πŸ’‘Valid Partition

A valid partition in the EP technique refers to the subset of data inputs that fall within the acceptable range of values for the software being tested. In the video's example, the valid partition includes numbers from 1 to 100. Testing a value from this partition is meant to represent all values within the range, making it a crucial part of the testing process.

πŸ’‘Invalid Partition

An invalid partition, in contrast to a valid partition, consists of data inputs that do not fall within the acceptable range of values. In the video, invalid partitions are created for numbers outside the range of 1 to 100, such as numbers less than 1 or greater than 100. These partitions are used to test how the software handles out-of-range inputs.

πŸ’‘Boundary Value Analysis

Boundary value analysis is a testing technique that focuses on testing the boundary conditions of the input data. Although not the primary focus of the video, it is mentioned as a technique that is often used in conjunction with EP. The script implies that after applying EP, boundary value analysis can further refine the testing process by focusing on the edges of the data range.

πŸ’‘Range of Data

The term 'range of data' in the video refers to the specific set of values that the software is designed to accept. For instance, the script mentions a text field that accepts numbers from 1 to 100. Understanding the range of data is essential for applying EP effectively, as it helps in determining the valid and invalid partitions.

πŸ’‘Input

In the context of software testing, 'input' refers to the data or values provided to the software system by the user or through automated processes. The video discusses how EP can be used to test various types of inputs, such as numbers, Boolean values, or specific values, by dividing them into valid and invalid partitions.

πŸ’‘Probability

Probability, as mentioned in the video, is the likelihood that a certain event will occur. In the context of EP, it refers to the likelihood that testing a representative value from a partition will yield results that can be generalized to all values in that partition. This is a key rationale behind using EP to reduce the number of test cases.

πŸ’‘Minimum Effective Number of Test Cases

The minimum effective number of test cases is the smallest set of test cases that can adequately cover all the necessary testing scenarios. The video uses this concept to explain how EP can help in reducing the number of test cases needed, while still ensuring that all possible input scenarios are considered.

πŸ’‘Boolean Value

A Boolean value is a data type that can only have one of two possible values: true or false. In the video, it is mentioned as an example of an input type where EP can be applied by creating two partitions: one valid partition for the correct Boolean value (true) and one invalid partition for any other value (false).

πŸ’‘Specific Value

A specific value in the context of the video refers to a single, predetermined value that the software is designed to accept. The script explains that when testing inputs that require a specific value, EP can be used to create one valid partition for that value and two invalid partitions for values outside the acceptable range.

Highlights

Introduction to the Equivalence Partitioning (EP) technique for black box testing.

EP is utilized for testing user input within a specific data range, such as a text field accepting numbers from 1 to 100.

Explanation of the inefficiency of writing 100 test cases for every number in a range.

The concept of dividing data inputs into two partitions: Valid and Invalid.

The valid partition includes numbers within the data range, while the invalid includes numbers outside the range.

Selecting one number from each partition as a sample for testing purposes.

The rationale behind reducing the number of test cases to cover all probabilities effectively.

Applying EP technique to the example of testing a range of numbers from 1 to 100.

Creating three partitions: one valid for 'in-range' numbers, and two invalid for numbers above and below the range.

The principle that testing one number in a partition is equivalent to testing all numbers in that partition.

Choosing specific numbers for test cases to represent the entire group within each partition.

The high probability that if a test case passes, all numbers in the same group are likely to pass.

The high probability that if a test case fails, all numbers in the same group are likely to fail.

Different cases of input division, such as for the number of sets or Boolean values.

The approach to inputs requiring a specific value, dividing into one valid and two invalid partitions.

Conclusion of the Equivalence Partitioning technique and its suitability for software with a range of data.

The importance of combining EP with boundary value analysis for effective testing.

Transcripts

play00:04

The first Black box technique we will train on it

play00:06

is the Equivalence Partitioning

play00:08

and its abbreviation is (EP)

play00:10

It is used when we test the probability that

play00:12

the user's input is for a range of data.

play00:14

such as: a text field takes

play00:16

inputs of numbers from 1 to 100.

play00:18

if we find such a range of data,

play00:20

there is no logic in writing

play00:22

100 test case to

play00:24

test all numbers.

play00:26

so how many tests will you make to

play00:28

test this range of numbers?

play00:30

Equivalence Partitioning Technique says:

play00:32

we will divide the data inputs into

play00:34

2 partitions: Valid & invalid

play00:36

the valid partition is for numbers

play00:38

inside the range of data.

play00:40

and the invalid is for numbers outside the range of data

play00:42

we will take one number

play00:44

from each partition, as a sample

play00:46

for the group it belongs to,

play00:48

to use in my test case. Therefore,

play00:50

instead of making a great number of test cases,

play00:52

we will shorten their number

play00:54

to the least number to cover all the probabilities.

play00:56

when we test this chosen number

play00:58

using the test case

play01:00

it is the same as if we tested

play01:02

all the numbers of this partition.

play01:04

Lets get back to our example

play01:06

to apply this technique on it.

play01:08

The range of numbers to be tested

play01:10

is from 1: 100, and the user may

play01:12

add a number from this range

play01:14

or bigger than this range or smaller

play01:16

than the range. so we should make

play01:18

a valid partition for the numbers

play01:20

that "in range of data"

play01:22

and an invalid partition for the numbers

play01:24

that user may input

play01:26

above 100. and finally,

play01:28

the numbers that user may input

play01:30

less than 1 to be the third partition

play01:32

and it will be invalid partition.

play01:34

In the first partition, when

play01:36

we test 1, it will be the same as

play01:38

testing 50, 43, or 100.

play01:40

so we 'll choose one number from the

play01:42

valid partition first to test in

play01:44

my first test case. Then we'll choose

play01:46

from the second "out of range" partition

play01:48

any number more than 100, to test

play01:50

in the second test case. And same thing for

play01:52

the final "out of range" partition,

play01:54

I'll choose any number less than 1

play01:56

and it will be enough to represent the whole group.

play01:58

so with the EP technique

play02:00

we can know that:

play02:02

if the group's test case results "pass",

play02:04

so there is a very high probability

play02:06

to all numbers of the same group

play02:08

to result "pass". if this test case

play02:10

results a bug, so there is a very high

play02:12

probability to all numbers of the same

play02:14

group to result a bug. In the previous

play02:16

example, we did 3 test cases

play02:18

which is the Minimum effective number

play02:20

of test cases that can represent each

play02:22

part of the range of data, but we have to notice that

play02:24

the division of input is not always

play02:26

into 3 partitions like range,

play02:28

but we'll find many different

play02:30

cases, such as:

play02:32

if the input is Number of sets,

play02:34

then we'll make only 2 partitions.

play02:36

a valid partitions for the group of

play02:38

the right numbers and we'll choose

play02:40

one number of them, and invalid partition

play02:42

for any number out of this

play02:44

group of numbers. Also,

play02:46

if the input is Boolean value ,

play02:48

we'll make only 2 partitions

play02:50

a valid partitions for the right value

play02:52

which is (true), and an invalid partition

play02:54

for the other values which is (false).

play02:56

finally, if the input requires

play02:58

a specific value, we'll deal with it

play03:00

like range. we'll divide it into

play03:02

one valid partition for the identified value

play03:04

and two invalid partitions;

play03:06

one for the bigger numbers, and one for the smaller numbers

play03:08

than this value.

play03:10

And by now, we have finished the first technique of

play03:12

Black box technique which is Equivalence Partitioning.

play03:14

we have to remember that it is suitable

play03:16

for the software with range of data,

play03:18

in which we divide the input into partitions

play03:20

and we choose numbers from it

play03:22

to represent their groups,

play03:24

to be able to write the minimum

play03:26

number of effective test cases.

play03:28

The EP technique is not used separately

play03:30

but it is used with boundary value analysis

play03:32

which we will apply in the next video.

Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
Software TestingEquivalence PartitioningTest CasesEfficiencyInput RangesBoundary ValuesQuality AssuranceTest OptimizationData ValidationTest DesignBlack Box