0% found this document useful (0 votes)
38 views46 pages

SQE Week 5 Lecture

Here are some key points to consider in the discussion: - Tests should ideally be written by multiple parties - developers to test their own code, independent testers to find issues developers may miss, and customers/users to ensure requirements are met. This helps catch more bugs. - Tests should be written both before and after the code. Writing tests before codes helps guide development towards testability. Writing tests after codes helps validate the code meets requirements and identifies bugs. A combination is most effective. - The goal is to have different perspectives test the software to improve quality. But developers testing their own code may miss issues others could find. Independence helps, but developers still understand the code best. It's about balancing involvement from various roles

Uploaded by

Javaria tanveer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views46 pages

SQE Week 5 Lecture

Here are some key points to consider in the discussion: - Tests should ideally be written by multiple parties - developers to test their own code, independent testers to find issues developers may miss, and customers/users to ensure requirements are met. This helps catch more bugs. - Tests should be written both before and after the code. Writing tests before codes helps guide development towards testability. Writing tests after codes helps validate the code meets requirements and identifies bugs. A combination is most effective. - The goal is to have different perspectives test the software to improve quality. But developers testing their own code may miss issues others could find. Independence helps, but developers still understand the code best. It's about balancing involvement from various roles

Uploaded by

Javaria tanveer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 46

TESTING

Testing
 What is  What ought to be

 Reasons :
◦ Quality
◦ Acceptability
◦ Discover problems

 Testing is the process to prove that the software works


correctly. Agree or disagree ?

 Testing is the process to prove that the software does


not works correctly
Purpose of Testing
Purpose of Testing

You can also take it as testing approaches or views or mindsets 

 Testing levels (Boris Beizer)


◦ LEVEL-0
◦ LEVEL-1
◦ LEVEL-2
◦ LEVEL-3
◦ LEVEL-4
Level 0

 No plan. Fix if found


Level 0
◦ No formalized effort of testing.
◦ No difference between testing and debugging
◦ Adopted by undergraduate CS students
◦ Get their programs to compile
◦ Debug with few arbitrarily chosen inputs or those
provided by the instructor
◦ Does little to help develop programs that are
reliable
Level 1
Level 1
◦ To show that software works

◦ Approach: software is correct

◦ But correctness is virtually impossible to either


achieve or demonstrate

◦ Suppose we run 100 test cases but find no failure


 Is program correct?
 Do we have bad tests?
Level 2
Purpose of software testing
 Level 2
◦ To show that software does not work
◦ Valid but negative goal
◦ Testers may like it but developers do not (level 1 is
natural for developers)
◦ Have adversarial relationship Bad for team morale

◦ What to do if no failures are found?


 Is software good? OR Is testing bad?
Level 3
Purpose of software testing
 Level 3
◦ Purpose of testing is not to prove anything specific
but to reduce the risk of using the software
◦ Accept fact that using software incurs some risk

◦ Impossible to check the whole system ? ?

◦ Entire team wants the same thing


◦ Reduce the risk
◦ Developer and tester work together
Level 4
Purpose of software testing
 Level 4
◦ Testing is a mental discipline that helps all IT
professionals develop higher quality software
◦ Primary responsibility is measuring and improving
software quality
◦ Improve the ability of developers to produce quality
software
In short, prevention is always better than
cure
Testing Terminologies
 Error /mistake
 Fault / Bug / Defect
◦ Fault of omission and fault of commission
 Failure
1        #include<stdio.h>
2       
3        int main ()
4        {
5        int value1, value2, ans;
6       
7        value1 = 5;
8        value2 = 3;
9       
10      ans = value1 - value2; 
11     
12      printf("The addition of 5 + 3 = %d.", ans);
13     
14      return 0;
15      }
Testing Process
 Test planning

 Test case development

 Running test cases

 Evaluating test results


Types of Testing
This is how a driver or user looks at
me. I am opaque or black box for him.
This is how an engineer looks at me. I
am transparent or white box for him.
Types of Testing
 Black Box Testing / Functional Testing
◦ Testing based on specification and requirements

 White Box Testing / Structural Testing


◦ Testing based on internal paths, structure and
implementation of the software
Test Cases
 Well designed test cases have
◦ Inputs
◦ Order of execution (steps to be followed)
◦ Outputs
 Expected
 Actual

◦ Example : Addition of two numbers.


Test Case Format
Black Box Testing

TC Title Input Expect Actual Status:


id ed Output
output
TC1 addition X=10 21 21 Pass
,
y=11
TC2 a=10 3 17 Fail
subtraction b=7
Test Case Format
White Box Testing

TC id Path Input Expect Actual Status:


ed Output
output
TC1 x-y-z X=10, 101 100 Fail
y=11
TC2 a-b-c a=10 13 13 Pass
Test Case Format
Black Box Testing
The purpose of testing should be to

a) Find the errors


b) Hide the errors
c) Increase the quality
Comparing the expected value with the actual
value is called

a) Debugging
b) Testing
c) Fixing the errors
d) None
e) All
You are presenting your application and trying
to hide the defects. It is

a) Level 0 testing
b) Level 1 testing
c) Level 2 testing
d) Level 3 testing
e) Level 4 Testing
For applications which deal with human life we
need.

a) Level 0 testing
b) Level 1 testing
c) Level 2 testing
d) Level 3 testing
e) Level 4 Testing
If some one tests your application with only
purpose to find out the bugs, it is

a) Level 0 testing
b) Level 1 testing
c) Level 2 testing
d) Level 3 testing
e) Level 4 Testing
A form has 3 fields and each field have 5 values in
drop down. What are total combinations to test

a) 5
b) 8
c) 15
d) 125
Testing Levels
Testing Levels
 Unit Testing

 For example, the tester will write some test code


that will call a method with certain parameters and
will ensure that the return value of this method is
as expected.

 It uses white box techniques.


Testing Levels
Integration Testing
usually white box testing techniques are used.
Example: DBMS front end and back end.
Testing Levels
System Testing
 Includes everything that has to be delivered to the
customer.
 Functionality
 Usability
 Security
 Reliability etc.
 Black box testing techniques are followed.

Acceptance testing
• Black box testing techniques are followed.
• Alpha Testing
• Beta Testing
Effective testing will reduce _______
cost.

a) maintenance
b) design
c) coding
d) documentation
All defects result in failure.

  True

  False
Problem
 Sue calls service desk and reports she cannot
log in to timesheet system because the
password field is missing from the login
screen.

 Error
 Fault of omission
 Fault of commission
 Fault
 Failure
Problem
 During a peer review for software requirements
for a new financial management system, Alice
discovers that values are in the requirements as
thousands of dollars instead of as millions of
dollars.

 Error
 Fault of omission
 Fault of commission
 Fault
 Failure
Problem
 During a peer review for software requirements
for a new financial management system, Alice
discovers that values are in the requirements as
thousands of dollars instead of as millions of
dollars.

 Error
 Fault of omission
 Fault of commission
 Fault
 Failure
To ponder...
 Discuss: Who should write tests? Developers?
The person who wrote the code? An
independent tester? The customer? The user?
Someone else? •

 Discuss: When should tests be written? Before


the code? After the code? Why?

You might also like