Testing Techniques
Testing Techniques
Z = ((X + Y) /
200 )* 100
If (Z>50)
• Yes No
Print Print
(PASS) (FAIL)
DECISION COVERAGE
• Decision coverage evaluates the true or false outcomes of each Boolean
expression.
• Some times expressions can sometimes get complicated. Therefore, it is very
hard to achieve 100% coverage.
Demo(int a)
{
If(a>5)
a=a*3;
print(a);
else
print(a);
}
• Value of a is 2
The code highlighted in yellow will be executed.
Decision Coverage = 50%
• Value of a is 6
The code highlighted in yellow will be executed.
Decision Coverage = 50%
BRANCH COVERAGE
• Branch coverage is also known as Decision coverage or all-edges coverage.
• It covers both the true and false conditions unlikely the statement coverage.
• A branch is the outcome of a decision, so branch coverage simply measures
which decision outcomes have been tested.
• A decision is an IF statement, a loop control statement (e.g. DO-WHILE or
REPEAT-UNTIL), or a CASE statement, where there are two or more outcomes
from the statement.
Demo(int a)
{
If(a>5)
a=a*3;
print(a);
}
• Prints (int a, int b){
• int result = a+ b;
• If (result> 0)
• Print ("Positive", result)
• Else
• Print ("Negative", result)}
• READ Username
READ Password
IF Count (Username) < 8
PRINT “Enter a Valid Username”
ENDIF
IF Count (Password) < 5
PRINT “Enter a Valid Password”
ENDIF
IF Count(Username & Password) < 1
PRINT “Please Fill the Username & Password Fields”
ELSE
PRINT “Login Successfully”
ENDIF
• Read P
Read Q
IF P+Q > 50 THEN
Print “Large”
ENDIF
If P+Q< 50 THEN
Print “Small”
ENDIF
• Read P
Read Q
IF P+Q > 100 THEN
Print “Large”
ENDIF
If P > 50 THEN
Print “P Large”
ENDIF
• P=60,Q=50
• P=60,Q=30
• P=30,Q=80
• P=30,Q=60
• P=60,q=50, sc=100%
• P=40,q=50, sc=6/8=75%
• P=60,q=30, sc=7/8=88%
• P=40,q=70, sc=7/8=88%
• READ Username
READ Password
IF Count (Username) < 8
PRINT “Enter a Valid Username”
ENDIF
IF Count (Password) < 5
PRINT “Enter a Valid Password”
ENDIF
IF Count(Username & Password) < 1
PRINT “Please Fill the Username & Password Fields”
ENDIF
ELSE
PRINT “Login Successfully”
BLACK BOX TESTING
INTRODUCTION
• Structure of the program is not considered
• The expected behavior of the system is used to design test cases
• Test cases are decided solely on the basis of the requirements or specifications
• Tester only knows the inputs that can be given to the system and what output
the system should give
• Internal structure of code not used for test case design
• Also called functional or behavioral testing
EQUIVALENCE CLASS
PARTITIONING
• Reduces the huge (or infinite) set of possible test cases into a small, but equally
effective, set of test cases.
• Divides the input domain of a program into classes of data from which test cases
can be derived.
• Test case is based on an evaluation of equivalence classes for an input condition.
• An equivalence class represents a set of valid or invalid inputs for conditions.
• Input condition is either a specific numeric value, a range of values, a set of
related values, or a Boolean condition.
EQUIVALENCE CLASSES FOR RANGE
If an input condition specifies a range, one valid and two invalid equivalence classes are
defined.
If an input condition requires a specific value, one valid and two invalid equivalence
classes are defined.
• Rather than selecting any element of an equivalence class, BVA leads to the
selection of test cases at the "edges" of the class.
• In other word, Rather than focusing solely on input conditions, BVA derives
test cases from the output domain as well.
BOUNDARY VALUE ANALYSIS
• Programmers may improperly use < instead of <=
2. If an input condition specifies a number of values, test cases should be developed that
exercise the minimum and maximum numbers. Values just above and below minimum
and maximum are also tested.
• For a function that computes the square root of an integer in the range of 1
and 5000:
• test cases must include the values: {0,1,5000,5001}.
• TC1{0,1,5000,5001}
• TC1{17,18,56,57}
• TC1 {5,6,12,13}
• 11906426 TC1 {7,8,8,9}
1 5000
BVA RANGE
• To test a field which accepts Age 18 – 56
• A text field (Name) which accepts the length between 6-12 characters.
DECISION TABLE
• This is a systematic approach where various input combinations and their
respective system behavior are captured in a tabular form.
• Decision table technique is appropriate for the functions that have a logical
relationship between two and more than two inputs.
• This technique is related to the correct combination of inputs and determines
the result of various combinations of input.
• Decision tables are precise and compact way to model complicated logic.
• They are ideal for describing situations in which a number of combinations of
actions are taken under varying sets of conditions.
• It is also known as a cause-effect table.
STRUCTURE OF DECISION TABLE
Example 1
• Most of us use an email account, and when you want to use an email
account, for this you need to enter the email and its associated password.
• If both email and password are correctly matched, the user will be directed to
the email account's homepage;
• Otherwise, it will come back to the login page with an error message
specified with "Incorrect Email" or "Incorrect Password."
Example 2
• A company’s employees are paid bonuses if they work more than
a year in the company and achieve individually agreed targets.
• Conditions:
• Employment for more than 1 year?
• Agreed target?
• Achieved target?
• Actions / Outcome :
• Bonus payment?
Employment more T T T T F F F F
than 1 year?
Agreed Target? T T F F F T F T
Achieved Target? T F F T F T T F
Bonus paid? T F F F F F F F
Employment more Y Y Y N
than 1 year?
Agreed Target? Y Y N -
Achieved Target? Y N - -
Bonus paid? y N n n
Verification is to be done
• You agrees to pay the loan in given time period
• You agrees to pay the loan as per the given interest rate
• You are able to produce some guarantor
• Your credit history or score
You agrees Y Y Y Y y y y y n n n n n n n n
to pay the
loan in
given time
period
You agrees Y Y Y Y n n n n y y y y n n n n
to pay the
loan as per
the given
interest
rate
You are Y Y n n y y n n y y n n y y n n
able to
produce
some
guarantor
You are Y N y n y n y n y n y n y n y n
credit
history or
score
Loan? y
You agrees to Y Y Y Y n
pay the loan in
given time
period
You agrees to Y Y Y n -
pay the loan as
per the given
interest rate
Loan? y
1 Y y y n
2 Y Y N -
3 Y N - -
Result?
1 Y y y y n n n n
2 Y y n n y y n n
3 Y n y n y n y n
Result Y
pay the y y y y y y y y n n n n n n n n
loan in
given time
period
pay the y y y y n n n n y y y y n n n n
loan as
per the
given
interest
rate
able to y y n n y y n n y y n n y y n n
produce
some
guarantor
credit y n y n y n y n y n y n y n y n
history or
score
Loan ye n n n n n n n n n n n n n n n
granted? s
Uid valid invalid blank valid invalid blank valid invalid blank
pswd valid invalid blank invalid valid valid blank blank invalid
Login? successf Error Error Error Error Error Error Error Error
ull message message message message message message message message
Uid valid valid invalid blank valid
Login? yes no no no no
REGRESSION TESTING
• A type of software testing to confirm that a recent program or code change
has not adversely affected existing features.
• A full or partial selection of already executed test cases which are re-executed
to ensure existing functionalities work fine.
• This testing is done to make sure that new code changes should not have side
effects on the existing functionalities.
• It ensures that the old code still works once the latest code changes are done.
• Performed whenever there is requirement to change the code and we need to
test whether the modified code affects the other part of software application
or not.
• When a new feature is added to the software application and for defect fixing
as well as performance issue fixing.
CONFIGURATION TESTING
• Checks an application with multiple combinations of software and hardware to
find out the optimal configurations that the system can work without any flaws
or bugs.
• Desktop applications will be of 2 tier or 3 tier, here we will consider a 3 tier
Desktop application which is developed using Asp. Net and consists of Client,
Business Logic Server and Database Server where each component supports
below-mentioned platforms.
COMPATABILITY TESTING
• Compatibility Testing is a type of Software testing to check whether your
software is capable of running on different hardware, operating systems,
applications, network environments or mobile devices.
• Compatibility Testing is a type of Non-functional testing
TYPES OF COMPATIBILITY TESTS
•Hardware: It checks software to be compatible with different hardware
configurations.
• This testing mainly focuses on the user's ease to use the application, flexibility
in handling controls and the ability of the system to meet its objectives.
• Recommended during the initial design phase of SDLC, which gives more
visibility on the expectations of the users.
FOREIGN LANGUAGE TESTING
• Localization is defined as making a product, application or document content
adaptable to meet the cultural, lingual and other requirements of a specific
region or a locale.