Lecture - 3 - Basics of Software Testing
Lecture - 3 - Basics of Software Testing
Meti Dejene
[email protected]
Haramaya University
Lecture 3 – Basics of Software Testing
Introduction
From time to time Software is becoming complex and the demand for quality in
software products has increased.
This rise in customer awareness for quality increases the workload and responsibility of
the software development team and calls for implementation of software quality
assurance activities.
That’s when software testing techniques enter the picture since testing is the critical
element of quality.
What is Testing?
Many practitioners and researchers have defined software testing in their own way.
❖“Testing is the process of executing a program with the intent of finding errors.” Myers
❖“Software testing is an empirical investigation conducted to provide stakeholders with information about
the quality of the product or service under test, with respect to the context in which it is intended to
operate.” Cem Kaner
❖“Testing is a concurrent lifecycle process of engineering, using and maintaining test ware (i.e. testing
artifacts) in order to measure and improve the quality of the software being tested.” Craig
❖“Software testing is a process that detects important bugs with the objective of having better quality
software.” Naresh Chauhan
Cont.
➢ Reduced maintenance cost - Post-release errors are costlier to fix. Thus, if testing
has been done rigorously and effectively during production, then the chances of failure
are minimized during operation and in turn, the maintenance cost is reduced.
2. There are too Many Possible Paths Through the Program to Test
➢ From the start of a program to its termination the number of logic paths through a
program is too large.
➢ Exercising all these paths requires a significant amount of time and resources
because large number of possible test cases are needed to exercise all these paths.
Cont.
➢ Focuses on identifying the most critical areas to test, using a well-defined strategy
to maximize coverage and defect detection within practical constraints.
➢ It provides the flexibility to select only the subsets of the domain of tests based on
project priority and on the factors which are required in a particular environment.
➢ Aims to balance thoroughness with efficiency, optimizing the use of time and
resources.
Basic Terminologies and Concepts in Software Testing
A. Test case
➢After execution, observed results are compared with expected outputs mentioned in
the test case.
➢A collection of test cases intended to test a software program are collectively called
Test Suite.
Cont.
B. Test script: A set of instructions (code scripts) executed by automated testing tools.
C. Test ware
➢ Test ware are the documents that a test engineer produces during testing activities.
➢ It may include test plans, test specifications, test case design, test reports, etc.
D. Test oracle
➢ An oracle is the means to judge the success or failure of a test.
➢ It is a mechanism that determines the correctness of the system for some test (i.e.
whether the software executed correctly for a test case or not).
➢ The simplest oracle is comparing actual results with expected results.
Testing Principles
1. Effective testing, not exhaustive testing.
➢ The cost of bugs can be reduced tenfold by starting testing early, as bugs are
harder to detect in later stages if they go undetected.
➢ Testing should ensure that the software not only works correctly but also fulfills
its intended purpose.
Cont.
5. Probability of existence of an error in a section of a program is proportional to the
number of errors already previously found in that section.
➢ If some sections are found error-prone in testing, then our next testing effort
should give priority to these error-prone sections.
6. Testing strategy should start at the smallest module level and expand towards the
whole program.
➢ This principle supports the idea of incremental testing which states “Testing must
begin at the unit or module level, gradually progressing towards integrated modules
and finally the whole system”.
7. Testers must participate in specification and design reviews.
Cont.
8. Testing should also be performed by an independent team.
➢ Since developers are mostly biased towards testing their own work, it is always
recommended to have the software tested by an independent testing team.
9. Everything must be recorded in software testing.
➢ The record of every test case run and the bugs reported, the inputs provided
during testing and the corresponding outputs must be recorded as a lesson for other
projects.
10. Invalid inputs and unexpected behavior have a high probability of finding an error.
➢ Whenever a software is tested, we test for valid inputs and for the functionality
that the software is supposed to do. But we must also test the software with invalid
inputs and the behavior which is not expected in general.
Software Testing as a Process
With quality as the major driving force, Software testing has emerged as a complete
process in software engineering.
➢ This means, Testing is not just a phase in SDLC performed after coding, rather
software testing is a process which runs parallel with other SDLC activities.
➢ Because systematic execution of each step will result in saving time and effort.
Activities:
❖ Define roles, responsibilities and reporting procedures within the testing team.
Activities:
➢ Write test cases with specific inputs, execution steps, and expected results for each
test condition.
➢ Organize test cases into test suite based on test objectives, priority, or other criteria.
It is the decision of the test team to opt for automation or manual execution.
Test results are documented in the test incident reports, test logs, testing status, and
test execution report.
4. Post-Execution/Test Review
This phase is to get feedback and analyze error-related issues so that maximum
number of errors can be removed.
After successful test execution, errors will be reported to the concerned developers.
➢ As soon as the developers get the error report, they analyze the error reported and
starts the debugging process.
➢ After fixing the bug/error, the developer reports to the testing team and the
modified portion of the software is tested once again.
In the end, the final error report and associated metrics are reviewed and analyzed to
establish whether the software meets the predefined functionality, quality and
reliability goals or not.
5. Test Cycle Closure
➢ Archive test cases, test scripts, and other artifacts for future reference.
A strategy for software testing integrates software test case design and execution
methods into a well-planned series of testing steps that result in the successful
construction of software.
This test strategy provides a road map on what type of test to conduct and what
testing techniques and methods to implement.
Cont.
The rule for development of a test strategy is that
1. Testing ‘begins from the smallest unit and progresses to enlarge’.
➢ This means the testing strategy should start at the component level and
works "outward" toward the integration of the entire system.
2. Different testing techniques are appropriate at different points in time.
➢ A strategy for software testing must accommodate low-level tests that are
necessary to verify that a small source code segment has been correctly
implemented as well as high-level tests that validate major system functions
against customer requirements.