You are on page 1of 30

Software Testing

BY SHAYMAA
What is Software Testing
•“ The process of executing a program or system with the intent of
finding errors ” Glen Myers, 1979

• Testing can reveal the presence of errors NOT their absence.


Testing Vs Debugging
• Testing: Is concerned with establishing the existence of defects in a
program.
• Debugging: Is concerned with locating and repairing these errors.
V&V
Verification
• Verification is any checking process conducted on software artifacts in an attempt to
determine if they work as specified.
- Are we building the product right?
- Does the software conform to its specification?

➢ Includes reviews, inspections, walkthroughs, unit testing and integration testing.


➢ Main purpose is to detect defects in the artifacts of the system under development.
V&V
Validation
• Validation is the process of evaluating software artifacts during the software
development process in an attempt to determine if the system works as required by the
customers.
- Are we building the right product?
- Does the software meet the customer requirements?

➢ Any evaluation activity that involves the customer can be used for validation purposes.
➢ Includes program reviews, and acceptance testing.
Why Do We Test?
• Make sure the software works as expected.

• Make sure that software meets the requirements.

• Find as many problems as possible.

• Make sure the application is a quality application.

• We test to try to minimize the risk that our customers would have by
using the system.
Test early and test often
Common Testing terms
• Error: a mistake made by a human (in a software development activity)
• Defect(or fault): the result of introducing an error into a software artifact
• Failure: a departure from the required behavior for a system. A failure occurs
when a fault executes.
• Incident: when a failure occurs, it may or may not be readily apparent to the user.
An incident is the symptom associated with a failure that alerts the user to the
occurrence of a failure..
• Test case: is a set of inputs, expected output, execution conditions, and a pass/fail
criterion.
• Test Plan: Describes scope, approach, resources, test schedule, items to be tested,
deliverables, responsibilities, approvals needed, …etc.
Black Box Vs White Box Testing

Black Box Testing White Box Testing


Is a software testing method Is a software testing method
in which the internal in which the internal
structure/ design/ structure/ design/
implementation of the item implementation of the item
being tested is NOT known to being tested is known to the
the tester. tester.
Testing: A Simple Example
• Suppose you are a tester in a company that wants to sell pens.
• You are given one of these pens with an instruction to test it.
• This pen is called the test object.
• As a tester, take a few minutes and write down what you will be
testing in that pen.
Testing: A Simple Example
• As a tester, you could test many different things about the pen, for
instance:
– Does the pen write in the right color, with the right line thickness?
– Is it safe to chew on the pen?
– Does the click-mechanism still work after 100 000 clicks?
– Does it still write after a car has run over it?
How to Test a Requirement (Example 01)
Let’s consider the following requirement:
System shall charge for flight and hotel reservations at the time reservations are
made. Car reservations will be made with the credit card guarantee, but charges
will not be posted to that card until car is actually picked up.
Answer:
• Test making reservations for a flight and hotel together
• Test making a reservation for a flight only
• Test making reservations for a flight, hotel, and car, etc
How to Test a Requirement (Example 02)
Requirement: System shall allow customers to check the status of their
orders.
Answer:
• Check the status of an order that does not exist.
• Check the status of an order that was shipped.
• Check the status of an order that has not been shipped.
• Check the status of an order that has been cancelled.
How to Test a Requirement (Example 03)
Requirement :
• Seniors will receive a 10% on all tickets.
• Children under the age 12will be charged only 60% of the price unless they are
traveling by them selves in which case, they will be charged 80% of the price.
Answer:
Test a reservation for a child under the age of12 traveling with a senior.
How to Test a Requirement (Example 04)
Requirement : The system shall allow customer to search for round trip
tickets.

Answer:
• Search for a round trip from one city that has one airport to another that has more
than one airport.
• Search for a round trip from one city that has more than one airport to another that
has more than one airport.
• Search for round trip going to a city that does not have an airport
Test Case
Documenting Test case
Different states of a test case results
Example of a test case
Consider the following requirements (Round Trip):
• The system shall allow customer to search for round trip tickets.

Test Case No.: 1


Dept. City: Minneapolis Arrival City: Chicago, IL
Departure Date: 8/12/04 Return Date: 8/16/04
Pre-condition: There is at least one seat available on at least one flight
to each of the two airports.
Post-condition: The number of seats is reduced by one.

Note:
We can write many other test cases for above requirement
The above is not complete testcase
IEEE 829 test plan structure
❑ IEEE 829-2008, also known as the 829 Standard for Software Test
Documentation,
IEEE 829 test plan structure
Testing Types
• There are number of categories of testing that can be accomplished for
software.
• Each category addresses the software from a unique perspective.
• The four basic tests that are accomplished for almost all systems are Unit,
Integration, Validation, and System Testing.
• There are a variety of other tests as well that may be performed as part of, or in
addition to, these four basic tests
Unit Testing
Unit Testing refers to the testing of individual modules to ensure that
they operate correctly independently of other modules.
This is the first level of testing and is normally accomplished
by the developer.
Unit testing is white box testing technique.
Integration Testing
Integration testing ensures that all modules interoperate
properly and can be integrated successfully into a functioning
system.
The development team performs integration testing once unit testing is
complete and prior to validation testing
Validation Testing
Validation testing is black box testing that ensures the customers requirement is met.
The end user or representatives of the end user normally perform validation
testing.
Validation testing is the most important testing phase from the perspective of user
acceptance of the system.
System Testing
❑ Ensures that the software will operate properly within the overall target
environment, including other existing systems.
Acceptance Testing
Acceptance Testing is a formal approach to validation testing where the test becomes the
official basis for user acceptance of the completed software.
It is commonly used when a formal contract is in place for the development of software.
Once the customer signs off on the acceptance test, they are certifying that the
contract is complete.
Alpha Vs Beta Testing
Alpha Testing Is a type of software testing performed to identify bugs
before releasing the product to real users or to the public. (White &
Black box)
Beta Testing Is performed by real users of the software application in
a real environment. (Black Box)
Test Case Template
Task (Individual)
ATM
• A customer must be able to access his account using any ATM machine, valid card and correct pin code
• A customer must be able to Change Pin-Code
• A customer must be able to Check balance
• A customer must be able to Withdraw
• A customer must be able to Print balance report
• A customer must be able to abort a transaction in progress by pressing the Exit key instead of
responding to a request from the machine.
• A customer must be able to make a deposit to any account linked to the card
• A customer must be able to make a transfer of money between any two accounts linked to the card.

You might also like