BLACK BOX TESTING K.KARTHIKEYAN. Black box testing technique Random testing Equivalence and...

31
BLACK BOX TESTING K.KARTHIKEYAN

Transcript of BLACK BOX TESTING K.KARTHIKEYAN. Black box testing technique Random testing Equivalence and...

BLACK BOX TESTING

K.KARTHIKEYAN

Black box testing technique

• Random testing • Equivalence and partitioning testing • Boundary value analysis • State transition testing • Cause and effect graphing • Error guessing

Random testing

All of the test inputs are generated randomly (often using a tool).

İt is a black box testing

Why we use RT ?

• Random testing gives us an advantage of easily estimating software reliability from test outcomes. Test inputs are randomly generated according to an operational profile, and failure times are recorded

• The data obtained from random testing can then be used to estimate reliability. Other testing methods cannot be used in this way to estimate software reliability

• Use of random test inputs may save some of the time and effort that more thoughtful test input selection methods require.(domain is well-structured)

How we use RT?

Random Testing can be summarized as a four-step procedure

1. The input domain is identified

2. Test inputs are selected independently from the domain

3. The system under test is executed on these inputs. This inputs constitude a random test set.

4. The results are compared to the system spesification. The test is a failure if any input leads to incorrect results; otherwise it is a success.

Main types of random testing techniques:

1. Random input data generation

2. Random sequence of data input (sometimes called as stochastic testing)

3. Random data selection from existing database

It is possible to combine all the above testing techniques.

• To provide an approach to design test case

• Understand how to apply equivalence partitioning

and boundary analysis to design test case

Purpose

Equivalence and partitioning testing

9

What is EP?

Input, output domain

Equivalence classes

Advantages of EP

- To reduce the number of test cases to a necessary minimum

- To select the right test cases to cover all possible scenarios ( of course not to be absolutely sure)

How to use to design testcase

Test case design by EP proceeds into 2 steps:

- Identify equivalence classes

- Define the test cases

12

• Input, output: clue from requirement• Equivalence classes are of 2 types: valid and

invalid• Ex: identify equivalence classes for this

requirement “ if a pupil has total score >= 75, he will pass the exam, otherwise will fail (total score is an integer)”

Identify equivalence classes

Identify equivalence classes

Total score Error messageSystem

Fail

Pass

14

Valid equivalence classes

Invalid equivalence classes

Total score 1. >=75 2. <753. Null4. String

Result of the exam

5. Pass6. Fail7. Error message

Identify equivalence classes

• Assign a unique number to each equivalence class• For valid case: until all valid equivalence classes have

been covered by test case, write a new test case covering as many uncover valid equivalence classes as possible.

• For invalid case: until all invalid equivalence classes have been covered by test case, write a new test case that cover one, and only one, of the uncovered invalid equivalence classes.

Define test cases

16

• Example: write test case for “ if a pupil has total score >= 75, he will be past the exam, otherwise will fail ”, using equivalence partitioning.

Define test cases

Conditions Valid equivalence class

Invalid equivalence class

Total score 1. >=75 2. <753. Null4. String

Result of the exam

5. Pass6. Fail7. Error message

Test case:

• 1, 5

• 2, 6

• 3, 7

• 4, 7

17

Boundary analyze and EP

Boundary values

Boundary analyze and EPBoundary value analysis?- Is to use input variable value at the

minimum, just above minimum, just below minimum, normal, at the maximum, just below maximum, just above maximum

20

Boundary analyze and EP

Example:• “ if a pupil has total score >= 75, he will pass the exam, otherwise will

fail (total score is an integer)”

Conditions Valid equivalence classes

Invalid equivalence classes

Total score 1. >=75 2. <753. Null4. String

Result of the exam

5. Pass6. Fail7. Error message

Test case:1. 1, 52. 2, 63. 3, 74. 4, 7

Data to test:1a. 75, pass1b. 76, pass 2. 74, fail 3. Null, error

message 4a. A, error message 4b. I am a tester of

EW and I love this job, error message

21

22

What is State Transition Testing?

• State Transition testing, a black box testing technique, in which outputs are triggered by changes to the input conditions or changes to 'state' of the system. In other words, tests are designed to execute valid and invalid state transitions.

Advantages•Allows testers to familiarize with the software design and enables them to design tests effectively.•It also enables testers to cover the unplanned or invalid states

Tests Test 1 Test 2 Test 3

Start State Off On On

Input Switch ON Switch Off Switch off

Output Light ON Light Off Fault

Finish State ON OFF On

Cause and Effect Graph Testing

Cause-Effect Graph graphically shows the connection between a given outcome and all issues that manipulate

A “Cause” stands for a separate input condition that fetches about an internal change in the system. An “Effect” represents an output condition, a system transformation or a state resulting from a combination of causes.

The Cause-Effect Diagram can be used under these Circumstances:•To determine the current problem so that right decision can be taken very fast.•To narrate the connections of the system with the factors affecting a particular process or effect.•To recognize the probable root causes, the cause for a exact effect, problem, or outcome.

Benefits of making cause-Effect Diagram •It finds out the areas where data is collected for additional study. •It motivates team contribution and uses the team data of the process. •Uses synchronize and easy to read format to diagram cause-and-effect relationships. •Point out probable reasons of difference in a process. It enhances facts of the procedure by helping everyone to learn more about the factors at work and how they relate. •It assists us to decide the root reasons of a problem or quality using a structured approach.

ERROR GUESSING

The Error guessing is a technique where the experienced and good testers are encouraged to think of situations in which the software may not be able to cope.Error guessing is a testing technique that makes use of a tester's skill, intuition and experience in testing similar applications to identify defects that may not be easy to capture by the more formal techniques. It is usually done after more formal techniques are completed.