Module 1
Module 1
Module Number: 01
1
Introduction to Software Testing
AIM:
• To familiarize students with the fundamentals and characteristics of the Software Testing.
2
Introduction to Software Testing
Objectives:
The Objectives of this module are to understand:
• The key concepts of Testing as an Engineering Activity.
• The Software Testing Principles.
• Tester’s role in a Software Development Organization
• The concept of Defects.
• Tester’s Role in a Software Development Organization.
3
Introduction to Software Testing
Outcome:
At the end of this module, you are expected to define/describe:
• Basic definition of software testing.
• Explain the Software Testing Principles.
• How to deal with Defect Classes.
• Use Access Defect Prevention strategies for users.
4
Introduction to Software Testing
Contents:
• Testing as an Engineering Activity
• Basic definitions of Software Testing
• Software Testing Principles
• The Tester’s Role in a Software Development Organization
• Defect Prevention strategies.
• The Defect Repository and Test Design
5
Introduction to Software Testing
6
Introduction to Software Testing
7
Definition of Bug
• A software bug occurs when one or more of the following five rules is true:
• 1. The software doesn’t do something that the product specification says it
should do.
• 2. The software does something that the product specification says it
shouldn’t do.
• 3. The software does something that the product specification doesn’t
mention.
• 4. The software doesn’t do something that the product specification doesn’t
mention but should.
• 5. The software is difficult to understand, hard to use, slow, or---in the
software tester’s eyes---will be viewed by the end user as just plain not right.
8
Introduction to Software Testing
9
Introduction to Software Testing
• Highly qualified staff ensures that software testing products are built on time, within budget, and are
of the highest quality with respect to attributes such as reliability, correctness, usability, and the
ability to meet all user requirements.
10
Introduction to Software Testing
11
Introduction to Software Testing
• End User
12
Introduction to Software Testing
13
Introduction to Software Testing
14
Introduction to Software Testing
15
Introduction to Software Testing
• Bug rate falls below a certain level and no high-priority bugs are identified.
• Management decision.
16
Introduction to Software Testing
17
Introduction to Software Testing
18
19
• A test specialist is one whose education is based on the principles,
practices and processes that constitute the software engineering
discipline and whose specific focus is on one area of that discipline,
software testing.
• A test specialist who is trained as an engineer should have knowledge
on the following
I. Test related principles,
II. Processes,
III. Measurements,
IV. Standards,
V. Plans,
VI. Tools and methods
VII. How to apply them to the testing tasks.
20
Introduction to Software Testing
Testing as a Process
• When Testing is treated as just another ‘phase’, the implementation of this business-critical task
suffers.
• A product that has not been tested fully will naturally not be robust.
21
Introduction to Software Testing
Testing as a Process
22
Introduction to Software Testing
Testing as a Process
Requirements Gathering phase:
• A process of collecting the user needs to solve problem or issues of an objective.
• The main focus of this phase is to gather the business requirements such as who will use what
type of data in which manner.
• The output of this phase is a Requirement Specification document that acts as the guidelines for
the product development.
23
Introduction to Software Testing
Testing as a Process
Design phase:
• The Design phase uses the Requirement Specification document to prepare the layout of the
system and software design.
• Once the analysis is complete, the step of designing takes over, which is basically building the
architecture of the project.
• This step helps remove possible flaws by setting a standard and attempting to stick to the
software.
24
Introduction to Software Testing
Testing as a Process
Development phase:
• As the name suggests, the development phase involves the actual writing of code for the
different modules.
• A lot of code is generated in this phase that covers implementation of different features, it
makes sense to test the features being developed.
• Once the software is developed, the stage of implementation comes in where the product
goes through a pilot study to see if it is functioning properly.
25
Introduction to Software Testing
Testing as a Process
Testing Phase:
• A testing process which has specific steps to be executed in a definite sequence to ensure that the
quality goals have been met.
• The testing stage assesses the software for errors and documents bugs if there are any.
26
Introduction to Software Testing
Testing as a Process
Maintenance:
• Once the software passes through all the stages without any issues, it is to undergo a
maintenance process.
• A maintenance process, wherein it will be maintained and upgraded from time to time to adapt
to changes.
• During the maintenance phase, errors or defects may exist, which would require repairs during
additional testing of the software.
27
Introduction to Software Testing
a. 1
b. 2
c. 4
d. 5
Answer: 5
28
Introduction to Software Testing
29
Introduction to Software Testing
30
Introduction to Software Testing
31
Introduction to Software Testing
32
Introduction to Software Testing
33
Reasons of bugs
• You'll be surprised to find out is that most of bugs aren't caused by
________________________
• Numerous studies have been performed on very small to extremely
large projects and the results are always the same.
• The number one cause of software bugs is….
•the specification.
35
• There are several reasons specifications are the largest bug
producer.
1. In many instances a spec simply isn't written.
2. Other reasons may be that the spec isn't thorough enough.
3. It's constantly changing.
4. It's not communicated well to the entire development team.
5. Planning software is vitally important. If it's not done correctly, bugs
will be created.
• The next largest source of bugs is the design. This is where the
programmers lay out their plan for the software.
• Bugs occur here for the same reason they occur in the specification.
It's rushed, changed, or not well communicated.
• Coding errors may be more familiar to you if you're a programmer.
• Typically, these can be traced to:
-- Software's complexity.
-- Poor documentation (especially in code that's being updated or
revised),
-- Schedule pressure,
-- Just plain dumb mistakes.
It's important to note that many bugs that appear on the surface to
be programming errors can really be traced to specification and
design errors
The other category is the catch-all for what's left.
Some bugs can be blamed on false positives, conditions that were
thought to be bugs but really weren't.
There may be duplicate bugs, multiple ones that resulted from the
same root cause.
Some bugs can also be traced to testing errors. In the end, these bugs
(or what once were thought of as bugs) turn out to not be bugs at all
and make up a very small percentage of all the bugs reported.
The Cost of Bugs
• As you must understand software doesn't just magically appear,
there's usually a planned, methodical development process used to
create it.
• From its inception, through the planning, programming, and testing,
to its use by the public, there's the potential for bugs to be found.
• The costs are logarithmic that is, they increase tenfold as time
increases.
• A bug found and fixed during the early stages when the specification
is being written might cost next to nothing.
• The same bug, if not found until the software is coded and tested,
might cost a lot of money.
• If a customer finds it, the cost could easily be thousands or even
millions of dollars.
What Exactly Does a Software Tester Do?
• The goal of a software tester is to find bugs.
• The goal of a software tester is to find bugs and find them as early as
possible.
• The goal of a software tester is to find bugs, find them as early as
possible, and make sure they get fixed.
• It's important to note that "fixing" a bug does not necessarily imply
correcting the software. It could mean adding a comment in the user
manual or providing special training to the customers.
• It could require changing the statistics that the marketing group
advertises or even postponing the release of the buggy feature
What Makes a Good Software Tester?
• It may appear that a software tester's job would be easier than a
programmer's. Breaking code and finding bugs must surely be easier
than writing the code in the first place.
• Surprisingly, it's not. The methodical and disciplined approach to
software testing requires the same hard work and dedication that
programming does.
• It involves very similar skills, and although a software tester doesn't
necessarily need to be a full-fledged programmer, having that
knowledge is a great benefit
List of traits that most software testers should have:
• They are explorers. Software testers aren't afraid to venture into
unknown situations.
• They love to get a new piece of software, install it on their PC, and see
what happens.
• They are trouble shooters. Software testers are good at figuring out
why something doesn't work. They love puzzles.
• They are relentless. Software testers keep trying. They may see a bug
that quickly vanishes or is difficult to re-create. Rather than dismiss it
as a fluke, they will try every way possible to find it.
• They are creative. Testing the obvious isn't sufficient for software
testers. Their job is to think up creative and even off-the-wall
approaches to find bugs.
• They are (mellowed) perfectionists. They strive for perfection, but
they know when it becomes unattainable and they're okay with
getting as close as they can.
• They exercise good judgment.
• Software testers need to make decisions about what they will test,
how long it will take, and if the problem they're looking at is really a
bug.
• They are tactful and diplomatic. Software testers are always the
bearers of bad news. They have to tell the programmers that their
code is ugly. Good software testers know how to do so tactfully and
professionally and know how to work with programmers who aren't
always tactful and diplomatic.
• They are persuasive. Bugs that testers find won't always be viewed as
severe enough to be fixed.
• Testers need to be good at making their points clear, demonstrating
why the bug does indeed need to be fixed, and following through on
making it happen.
• In addition to these traits, having some education in software
programming is a big plus.
• Knowing how software is written can give you a different view of
where bugs are found, thus making you a more efficient and effective
tester. It can also help you develop the testing tools.
• Lastly, if you're an expert in some non-computer field, your
knowledge can be invaluable to a software team creating a new
product.
• Software is being written to do just about everything today. Your
knowledge of teaching, cooking, airplanes, carpentry, medicine, or
whatever would be a tremendous help finding bugs in software for
those areas.
Introduction to Software Testing
Testing axioms
• Testing Axioms have been formulated as a context-neutral set of rules for testing systems and
they represent the critical thinking processes required to test any system.
• The Axioms enumerate the key areas of test strategy and provide a checklist of concerns to be
addressed in any test approach.
55
Introduction to Software Testing
Testing axioms
• Any company can use the Axioms as the basis of context-neutral testing assessment and to identify
areas requiring improvement without using artificial maturity levels.
• Axioms define skills areas required by testers, and could form the basis of a tester development
framework and a certification regime that has meaning to practitioners.
56
Axioms of Software Testing
57
Testing Axioms
• It's Impossible to Test a Program Completely.
• As a new tester, you may believe that you can take a piece of
software, fully test it, find all the bugs, and assure that the software is
perfect.
• Unfortunately, this isn't possible, even with the simplest programs,
due to four key reasons:
• The number of possible inputs is very large.
• The number of possible outputs is very large.
• The number of paths through the software is very large.
• The software specification is subjective.
• Multiply all these "very large" possibilities together and you get a set
of test conditions that's too large to attempt
• Software Testing: Is a Risk-Based Exercise
• If you decide not to test every possible test scenario, you've chosen to
take on risk.
• If you don't test a particular input, a customer may eventually enter
it, and he or she will discover the bug.
• It'll be a costly bug, too, since it wasn't found until the software was
in the customer's hands.
• One key concept that software testers need to learn is how to reduce
the huge domain of possible tests into a manageable set, and how to
make wise risk-based decisions on what's important to test and
what's not.
Case Study:
Intel Pentium Floating-Point Division Bug, 1994
• Enter the following equation into your PC's calculator:
• (4195835 / 3145727) * 3145727 - 4195835
If the answer is zero, your computer is just fine.
• If you get anything else, you have an old Intel Pentium CPU
with a floating-point division bug a software bug burned into
a computer chip and reproduced over and over in the
manufacturing process.
• What makes this story notable isn't the bug, but the
way Intel handled the situation:
• Their software test engineers had found the problem
while performing their own tests before the chip was
released.
• Intel's management decided that the problem wasn't
severe enough or likely enough to warrant fixing it or
even publicizing it.
• Once the bug was found, Intel attempted to diminish
its perceived severity through press releases and
public statements.
• When pressured, Intel offered to replace the faulty
chips, but only if a user could prove that he was
affected by the bug.
• On August 28th, 2000,, Intel announced a recall of all
the 1.13MHz Pentium III processors it had shipped
after the chip had been in production for a month.
• A problem was discovered with the execution of
certain instructions that could cause running
applications to freeze.
• Computer manufacturers were creating plans for
recalling the PCs already in customers' hands and
calculating the costs of replacing the defective chips
• Testing Can't Show That Bugs Don't Exist:
• Software testing can show that bugs exist, but it can't show that bugs
don't exist.
• You can perform your tests, find and report bugs, but at no point can
you guarantee that there are no longer any bugs to find.
• You can only continue your testing and possibly find more bugs.
• The More Bugs You Find, the More Bugs There Are:
• Convoy Effect:
• There are similarities between real bugs and software bugs. Both
types tend to come in groups. If you see one, chances are there will
be more nearby.
• Frequently, a tester will go for long spells without finding a bug. He'll
then find one bug, then quickly another and another. There are
several reasons for this:
• Programmers have bad days. Like all of us, programmers can have off
days. Code written one day may be perfect; code written another may
be sloppy. One bug can be a tell-tale sign that there are more nearby.
• Programmers often make the same mistake. Everyone has habits. A
programmer who is prone to a certain error will often repeat it.
• Some bugs are really just the tip of the iceberg. Very often the
software's design or architecture has a fundamental problem.
• A tester will find several bugs that at first may seem unrelated but
eventually are discovered to have one primary serious cause.
• It's important to note that the inverse of this "bugs follow bugs" idea
is true, as well.
• If you fail to find bugs no matter how hard you try, it may very well be
that the feature you're testing was cleanly written and that there are
indeed few if any bugs to be found.
• The Pesticide Paradox:
• It means that the more you test software, the more immune it
becomes to your tests.
• The same thing happens to insects with pesticides.
• Software undergoing the same repetitive tests eventually builds up
resistance to them.
• To overcome the pesticide paradox, software testers must continually
write new and different tests to exercise different parts of the
program and find more bugs.
• Not All the Bugs You Find Will Be Fixed:
• One of the sad realities of software testing is that even after all your
hard work, not every bug you find will be fixed.
• It does not mean that you've failed in achieving your goal as a
software tester, nor does it mean that you or your team will release a
poor quality product.
• It does mean, however, that you'll need to rely on a couple of traits of
a software tester:
• 1) Exercising good judgment and
• 2) knowing when perfection isn't reasonably attainable.
• You and your team will need to make trade-offs, risk-based decisions
for each and every bug, deciding which ones will be fixed and which
ones won't.
• There are several reasons why a team might choose not to fix a bug:
• There's not enough time.
• It's really not a bug.
• It's too risky to fix.
• It's just not worth it
• When a Bug's a Bug Is Difficult to Say:
93
Introduction to Software Testing
94
Introduction to Software Testing
95
Introduction to Software Testing
To find defects early, testing activities shall be started as early as possible in the software or system
development life cycle, and shall be focused on defined objectives. If the testing team is involved
right from the beginning of the requirement gathering and analysis phase they have better
understanding and insight into the product and moreover the cost of quality will be much less if the
defects are found as early as possible rather than later in the development life cycle.
96
Introduction to Software Testing
Testing effort shall be focused proportionally to the expected and later observed defect density
of modules. A small number of modules usually contains most of the defects discovered during
pre-release testing, or is responsible for most of the operational failures.
The Pareto principle of 80:20 works here, that is 80 percent of defects are due to 20 percent of
code. This information could prove to be very helpful while testing, if we find one defect in a
particular module/area there is pretty high chance of getting many more there itself.
97
Introduction to Software Testing
If the same kind of tests are repeated again and again, eventually the same set of test cases will
no longer be able to find any new bugs. To overcome this “Pesticide Paradox”, test cases needs
to be regularly reviewed and revised, and the new and different tests need to be written to
exercise different parts of the software or system to find potentially more defects.
98
Introduction to Software Testing
Testing is done differently in different contexts. For example, safety critical software is tested
differently from an e-commerce site. Very true, testing effort should be based on what is to be
tested. Testing focus will depend on what is more important for that type of application.
99
Introduction to Software Testing
If the system built is unusable and does not fulfill the user’s needs and expectations then, finding and
fixing defects does not help. As said, if the product does not meet user’s requirements explicitly
mentioned and implicitly implied, that is if it is not fit for use, there is no point in testing, finding
defects and fixing it.
100
Introduction to Software Testing
a. 4
b. 5
c. 6
d. 7
Answer: 7
101
Introduction to Software Testing
a. True
b. False
Answer: True
102
Introduction to Software Testing
103
Introduction to Software Testing
104
Introduction to Software Testing
105
Introduction to Software Testing
106
Introduction to Software Testing
107
Introduction to Software Testing
108
Introduction to Software Testing
109
Introduction to Software Testing
110
Introduction to Software Testing
• Execute all the test case and report defects, define severity and priority for each defect.
• Carry out regression testing every time when changes are made to the code to fix defects.
111
Introduction to Software Testing
• Without proper testing, produced software can be dangerous to the users. They will be confused
and lose credibility towards that particular software.
• Any product can be turned into a strong and consistent product with the help of testing in software
development.
112
Introduction to Software Testing
a. Only i
b. Only ii
c. Only i and ii
d. All i, ii and iii
Origins of Defects
• Defects have negative effects on software users. Software engineers work very hard to produce high-
quality software with a low number of defects.
• The term defect and its relationship to the terms error and failure in the context of the software
development domain.
• But even under the best of development circumstances errors are made, resulting in defects being
injected in the software during the phases of the software life cycle.
114
Introduction to Software Testing
Origins of Defects
Origins of Defects
Education:
The software engineer did not have the proper educational background to prepare the software artifact.
For example, a software engineer who did not understand the precedence order of operators in a
particular programming language could inject a defect in an equation that uses the operators for a
calculation.
116
Introduction to Software Testing
Origins of Defects
Communication:
The software engineer was not informed about something by a colleague. For example, if engineer 1
and engineer 2 are working on interfacing modules, and engineer 1 does not inform engineer 2 that a
no error checking code will appear in the interfacing module he is developing, engineer 2 might make
an incorrect assumption relating to the presence/absence of an error check, and a defect will result.
117
Introduction to Software Testing
Origins of Defects
Oversight
The software engineer omitted to do something. For example, a software engineer might omit an
initialization statement.
Transcription
The software engineer knows what to do, but makes a mistake in doing it. A simple example is a
variable name being misspelled when entering the code.
Process
The process used by the software engineer misdirected her actions. For example, a development process
that did not allow sufficient time for a detailed specification to be developed and reviewed could lead to
specification defects.
118
Introduction to Software Testing
Origins of Defects
A tester develops hypotheses about possible defects. Test cases are then designed based on the
hypotheses. The hypotheses are used for the following:
• Design test cases
• Design test procedures
• Assemble test sets
• Select the testing levels suitable for the tests
• Evaluate the results of the tests
119
Introduction to Software Testing
Origins of Defects
Fault Model:
A fault (defect) model can be described as a link between the error made, and the fault/defect in the
software.
The fault models are often used to generate a fault list or dictionary. From that dictionary faults can be
selected, and test inputs developed for digital components.
The effectiveness of a test can be evaluated in the context of the fault model, and is related to the
number of faults as expressed in the model, and those actually revealed by the test.
120
Introduction to Software Testing
Origins of Defects
Defect Repository
To increase the effectiveness of their testing and debugging processes, software organizations need
to initiate the creation of a defect database, or defect repository.
The defect repository supports storage and retrieval of defect data from all projects in a centrally
accessible location.
121
Introduction to Software Testing
Cost of defects
122
Introduction to Software Testing
Cost of defects
The cost of defects can be measured by the impact of the defects and when we find them.
Example: If error is found in the requirement specifications during requirements gathering and
analysis, then it is somewhat cheap to fix it.
The correction to the requirement specification can be done and then it can be re-issued.
123
Introduction to Software Testing
124
Introduction to Software Testing
125
Introduction to Software Testing
Cost of defects
Similarly, if a requirement specification error is made and the consequent defect is found in the design
phase then the design can be corrected and reissued with relatively little expense.
126
Introduction to Software Testing
Cost of defects
• If a defect is introduced in the requirement specification and it is not detected until acceptance
testing or even once the system has been implemented then it will be much more expensive to fix.
• This is because rework will be needed in the specification and design before changes can be made in
construction.
127
Introduction to Software Testing
Cost of defects
Advantages of Finding Defects Early
The cost of finding and fixing defects rises considerably across the life cycle. A single defect in the
requirements may well propagate into several places in the design and code and, because of that, all the
testing work done up until that point will need to be repeated in order to reach the confidence level in the
software that we require.
128
Introduction to Software Testing
Cost of defects
The Importance of Reviews
“It is better to try to keep a bad thing from happening than it is to fix the bad thing once it has
happened.”
This proverb definitely applies to defects in the software development life cycle.
129
Introduction to Software Testing
130
Introduction to Software Testing
131
Introduction to Software Testing
132
Introduction to Software Testing
134
Introduction to Software Testing
• Feature defects are due to feature descriptions that are missing, incorrect, incomplete, or
unnecessary.
135
Introduction to Software Testing
These are due to an incorrect description of how the features should interact with each other.
136
Introduction to Software Testing
These are defects that occur in the description of how the target software is to interface with external
software, hardware, and users.
137
Introduction to Software Testing
• System components
138
Introduction to Software Testing
139
Introduction to Software Testing
Data Defects
These are associated with incorrect design of data structures.
140
Introduction to Software Testing
141
Introduction to Software Testing
142
Introduction to Software Testing
143
Introduction to Software Testing
144
Introduction to Software Testing
145
Introduction to Software Testing
146
Introduction to Software Testing
147
Introduction to Software Testing
148
Introduction to Software Testing
149
Introduction to Software Testing
150
Introduction to Software Testing
151
Introduction to Software Testing
152
Introduction to Software Testing
153
Introduction to Software Testing
154
Introduction to Software Testing
155
Introduction to Software Testing
156
Introduction to Software Testing
a. Only i
b. Only ii
c. Only ii and iv
158
Introduction to Software Testing
159
Introduction to Software Testing
160
Introduction to Software Testing
161
Introduction to Software Testing
162
Introduction to Software Testing
163
Introduction to Software Testing
164
Introduction to Software Testing
165
Introduction to Software Testing
166
Introduction to Software Testing
167
Introduction to Software Testing
168
Introduction to Software Testing
169
Introduction to Software Testing
• It helps manage the quality of the software product in a “sooner and cheaper” manner with the help
of the techniques.
170
Introduction to Software Testing
• To maintain the quality of software is the responsibility of the core management and entire team
including project lead, client, and every team member.
171
Introduction to Software Testing
a. Only i
b. Only ii
c. Only i and ii
d. None of the above
172
Introduction to Software Testing
a. True
b. False
Answer : True
173
Introduction to Software Testing
Assignment
1. Define Pareto Analysis and Fishbone Analysis in detail.
2. List out few Review and Inspection in defect detection strategy.
3. Case study on the Defect Repository and Test Design.
4. Explain Typographical Defects in details.
5. Draw the flow chart on Error detection strategy.
174
Introduction to Software Testing
Document Links
175
Introduction to Software Testing
Document Links
176
Introduction to Software Testing
Video Links
177
Introduction to Software Testing
E-Book Links
Topics URL
178