You are on page 1of 21

1

Software Testing
• What is Testing?
Many people understand many definitions of testing :

1. Testing is the process of demonstrating that errors are not present.

2. The purpose of testing is to show that a program performs its intended


functions correctly.

3. Testing is the process of establishing confidence that a program does what it


is supposed to do.

These definitions are incorrect.

2
Software Testing
A more appropriate definition is:

“Testing is the process of executing a program with


the intent of finding errors.”

3
Software Testing
• Why should We Test ?

Although software testing is itself an expensive activity, yet launching of software


without testing may lead to cost potentially much higher than that of testing,
specially in systems where human safety is involved.

In the software life cycle the earlier the errors are discovered and removed, the
lower is the cost of their removal.

4
Software Testing
• Who should Do the Testing ?
o Testing requires the developers to find errors from their software.
o It is difficult for software developer to point out errors from own creations.
o Many organisations have made a distinction between development and
testing phase by making different people responsible for each phase.

5
Software Testing
• What should We Test ?
We should test the program’s responses to every possible input. It means, we
should test for all valid and invalid inputs. Suppose a program requires two 8 bit
integers as inputs.
Total possible combinations are 28x28.

If only one second it required to execute one set of inputs, it may take 18 hours to
test all combinations.

Practically, inputs are more than two and size is also more than 8 bits. We have also
not considered invalid inputs where so many combinations are possible. Hence,
complete testing is just not possible, although, we may wish to do so.

6
Software Testing
Some Terminologies
➢ Error, Mistake, Bug, Fault and Failure
People make errors. A good synonym is mistake. This may be a syntax error or
misunderstanding of specifications. Sometimes, there are logical errors.

When developers make mistakes while coding, we call these mistakes “bugs”.

A fault is the representation of an error, where representation is the mode of


expression, such as narrative text, data flow diagrams, ER diagrams, source code
etc. Defect is a good synonym for fault.

A failure occurs when a fault executes. A particular fault may cause different
failures, depending on how it has been exercised.

9
Software Testing
➢ Test, Test Case and Test Suite
Test and Test case terms are used interchangeably. In practice, both are same and
are treated as synonyms. Test case describes an input description and an expected
output description.
Test Case ID
Section-I Section-II
(Before Execution) (After Execution)
Purpose : Execution History:
Pre condition: (If any) Result:
Inputs: If fails, any possible reason (Optional);

Expected Outputs: Any other observation:


Post conditions: Any suggestion:
Written by: Run by:
Date: Date:
Fig. 2: Test case template
The set of test cases is called a test suite. Hence any combination of test cases
may generate a test suite.
10
Testing Activities-STLC
• The Software Testing Life Cycle (STLC) is a systematic approach
to testing a software application to ensure that it meets the
requirements and is free of defects. It is a process that follows a
series of steps or phases, and each phase has specific objectives
and deliverables. The STLC is used to ensure that the software
is of high quality, reliable, and meets the needs of the end-
users.
• The main goal of the STLC is to identify and document any
defects or issues in the software application as early as possible
in the development process. This allows for issues to be
addressed and resolved before the software is released to the
public.
• The stages of the STLC include Requirement Analysis,Test
Planning, Test Analysis, Test Design, Test Environment Setup,
Test Execution, Test Closure, and Defect Retesting. Each of these
stages includes specific activities and deliverables that help to
ensure that the software is thoroughly tested and meets the
requirements of the end users.
• Overall, the STLC is an important process that helps to ensure
the quality of software applications and provides a systematic
approach to testing. It allows organizations to release high-
quality software that meets the needs of their customers,
ultimately leading to customer satisfaction and business
success.
Software Testing Types
 
 
• Black Box Testing is a software testing method in which the
internal structure/design/implementation of the item
being tested is not known to the tester. Only the external
design and structure are tested.
 
• White Box Testing is a software testing method in which
the internal structure/design/implementation of the item
being tested is known to the tester. Implementation and
impact of the code are tested.
S. No. Black Box Testing White Box Testing

It is a way of software testing in It is a way of testing the software in which


which the internal structure or the the tester has knowledge about the
1. program or the code is hidden and internal structure or the code or the
nothing is known about it. program of the software.

Implementation of code is not Code implementation is necessary for


2.
needed for black box testing. white box testing.

3. It is mostly done by software testers. It is mostly done by software developers.

No knowledge of implementation is
4. Knowledge of implementation is required.
needed.

It can be referred to as outer or It is the inner or the internal software


5.
external software testing. testing.
Software Testing
Functional Testing
Input Output
domain
domain
System
Input test under Output
data test test data

Fig. 3: Black box testing

13
FUNCTIONAL TESTING
• FUNCTIONAL TESTING is a type of software testing that validates
the software system against the functional
requirements/specifications. The purpose of Functional tests is to
test each function of the software application, by providing
appropriate input, verifying the output against the Functional
requirements.
• Functional testing mainly involves black box testing and it is not
concerned about the source code of the application. This testing
checks User Interface, APIs, Database, Security, Client/Server
communication and other functionality of the Application Under
Test. The testing can be done either manually or using automation.
Unit Testing

• Unit Testing is the first level of testing usually performed by the developers.

• In unit testing, a module or component is tested in isolation.

• As the testing is limited to a particular module or component, exhaustive


testing is possible.

• Advantage – Error can be detected at an early stage saving time and money
to fix it.

• Limitation – Integration issues are not detected in this stage, modules may
work perfectly on isolation but can have issues in interfacing between the
modules.
Integration Testing

• Integration testing is the second level of testing


in which we test a group of related modules.

• It aims at finding interfacing issues b/w the


modules i.e. if the individual units can be
integrated into a sub-system correctly.

• It is of four types – Big-bang, top-down, bottom-


up, and Hybrid.
Types of Integration testing
In big bang integration, all the modules are first required to be completed and
then integrated. After integration, testing is carried out on the integrated unit as
a whole.

In top-down integration testing, the testing flow starts from top-level modules


that are higher in the hierarchy towards the lower-level modules. As there is a
possibility that the lower-level modules might not have been developed while
beginning with top-level modules.

Bottom-up integration testing is also based on an incremental approach but it


starts from lower-level modules, moving upwards to the higher-level modules.

Hybrid integration testing is also called the Sandwich integration approach. This
approach is a combination of both top-down and bottom-up integration testing.
Here, the integration starts from the middle layer, and testing is carried out in
both directions, making use of both stubs and drivers, whenever necessary.
System Testing
• is the third level of testing.

• It is the level of testing where the complete integrated


application is tested as a whole.

• It aims at determining if the application conforms to


its business requirements.

• System testing is carried out in an environment that is


very similar to the production environment.
Debugging
• It is the process of identifying and resolving
errors, or bugs, in a software system. It is an
important aspect of software engineering
because bugs can cause a software system to
malfunction, and can lead to poor
performance or incorrect results. Debugging
can be a time-consuming and complex task,
but it is essential for ensuring that a software
system is functioning correctly.
Techniques used in debugging

• Code Inspection: This involves manually reviewing the source


code of a software system to identify potential bugs or errors.
• Debugging Tools: There are various tools available for
debugging such as debuggers, trace tools, and profilers that
can be used to identify and resolve bugs.
• Monitoring: This involves monitoring a software system for
unusual behavior or performance issues that can indicate the
presence of bugs or errors.
• Logging: This involves recording events and messages related
to the software system, which can be used to identify bugs or
errors.

You might also like