Software Testing U-1 P 1
Software Testing U-1 P 1
CONTENT
• Introduction
• What is Software Testing?
• Why do need to test software?
• What are the benefits of Software Testing?
• Terminologies
• Limitation of Testing
• Software Life –Cycle Model
• Types of Software Testing.
INTRODUCTION
• We cannot imagine a day without using cell phones, logging on to the
internet, sending e-mails, watching television and so on.
• All these activities are dependent on software, and software is not reliable.
The world has seen many software failures and some were even fatal to
human life
• Software organizations are regularly getting failure reports of their products
and this number is increasing day by day. All of us would appreciate that it
is extremely disappointing for the developers to receive such failure reports.
The developers normally ask: how did these bugs escape unnoticed?
• It is a fact that software developers are experiencing failures in testing their
coded programs and such situations are becoming threats to modern
automated civilization.
What is Software Testing?
• According to ANSI/IEEE 1059 standard – A process of analyzing a
software item to detect the differences between existing and required
conditions (i.e., defects) and to evaluate the features of the software
item.
• According to MYER – “Testing is the process of executing a program
with the intent of finding faults”.
• Software testing is a process, to evaluate the functionality of a
software application with an intent to find whether the developed
software met the specified requirements or not and to identify the
defects to ensure that the product is defect-free in order to produce a
quality product.
Example..
Continued
We again consider the program ‘Minimum’ and concentrate on some typical and critical
situations as discussed below:
(i) A very short list (of inputs) with the size of 1, 2, or 3 elements.
(ii) An empty list i.e. of size 0.
(iii) A list where the minimum element is the first or last element.
(iv) A list where the minimum element is negative.
(v) A list where all elements are negative.
(vi) A list where some elements are real numbers.
(vii) A list where some elements are alphabetic characters.
(viii) A list with duplicate elements.
(ix) A list where one element has a value greater than the maximum permissible limit of an
integer.
Continued
Continued
(i) The program has ignored the first and last values of the list
The program is not handling the first and last values of the list properly. If we see the
line numbers 22 and 23 of the program, we will identify the causes. There are two
faults. Line number 22 “i = 1;” should be changed to “i = 0;” in order to handle the
first
value of the list. Line number 23 “while (i<Number -1)” should be changed to “while
(i<=Number-1)” in order to handle the last value of the list.
(ii) The program proceeds without checking the size of the array
If we see line numbers 14 and 15 of the program, we will come to know that the
program
is not checking the size of the array / list before searching for the minimum value. A
list
cannot be of zero or negative size. If the user enters a negative or zero value of size or
value
greater than the size of the array, an appropriate message should be displayed.
(iii) Program has converted negative values to positive values
Line number 19 is converting all negative values to positive values. That is why the
program is not able to handle negative values. We should delete this line to remove
this fault.
Continued
Why do need to test software?
• As per the current trend, due to constant change and development in digitization, our lives are
improving in all areas. The way we work is also changed. For instance, we access our bank online,
we do shopping online, we order food online, and many more. We rely on software and systems.
What if these systems turn out to be defective. We all know that one small bug shows a huge
impact on business in terms of financial loss and goodwill.
• Testing is important because software bugs could be expensive or even dangerous.
• Software bugs can potentially cause monetary and human loss, and history is full of such
examples.
1. In April 2015, Bloomberg terminal in London crashed due to software glitch affected more than
300,000 traders on financial markets. It forced the government to postpone a 3bn pound debt
sale.
2. Nissan cars recalled over 1 million cars from the market due to software failure in the airbag
sensory detectors. There has been reported two accident due to this software failure.
Continued
• Starbucks was forced to close about 60 percent of stores in the U.S and Canada due to software failure in its
POS system. At one point, the store served coffee for free as they were unable to process the transaction.
• Some of Amazon's third-party retailers saw their product price is reduced to 1p due to a software glitch. They
were left with heavy losses.
• Vulnerability in Windows 10. This bug enables users to escape from security sandboxes through a flaw in the
win32k system.
• In 2015 fighter plane F-35 fell victim to a software bug, making it unable to detect targets correctly.
• China Airlines Airbus A300 crashed due to a software bug on April 26, 1994, killing 264 innocents live
• In 1985, Canada's Therac-25 radiation therapy machine malfunctioned due to software bug and delivered
lethal radiation doses to patients, leaving 3 people dead and critically injuring 3 others.
• In April of 1999, a software bug caused the failure of a $1.2 billion military satellite launch, the costliest
accident in history
• In May of 1996, a software bug caused the bank accounts of 823 customers of a major U.S. bank to be
credited with 920 million US dollars.
Why do need to test software? Continued.
• Software testing is a very expensive and critical activity; but releasing the software without testing is
definitely more expensive and dangerous.
• No one would like to do it. It is like running a car without brakes. Hence testing is essential; but how much
testing is required? Do we have methods to measure it? Do we have techniques to quantify it? The answer is
not easy. All projects are different in nature and functionalities and a single yardstick may not be helpful in all
situations. It is a unique area with altogether different problems.
Why do need to test software? Continued
• What Should We Test? - Is it possible to test the program for all possible valid and invalid
inputs? The answer is always negative due to a large number of inputs.
• We consider a simple example where a program has two 8 bit integers as inputs. Total combinations of inputs
are 28 * 28.
• “How to choose a reasonable number of test cases out of a large pool of test cases?”
• What is the bottom line for testing? At least, we may wish to touch this bottom line, which may incorporate
the following:
(i) Execute every statement of the program at least once.
(ii) Execute all possible paths of the program at least once.
(iii) Execute every exit of the branch statement at least once.
Example
• 1. if (x > 0)
• 2. {
• 3. a = a + b;
• 4. }
• 5. if (y>10)
• 6. {
• 7. c=c+d;
• 8. }
The possible paths are: ACE, ABCE, ACDE and ABCDE. However, if we choose x = 9 and y = 15, all
statements are covered. Hence only one test case is sufficient for 100% statement coverage by traversing only
one path ABCDE. Therefore, 100% statement coverage may not be sufficient, even though that may be difficult
to achieve in real life programs.
Objectives of testing
• To find any defects or bugs that may have been created when the software was
being developed
• To increase confidence in the quality of the software
• To prevent defects in the final product
• To ensure the end product meets customer requirements as well as the company
specifications
• To provide customers with a quality product and increase their confidence in the
company
TERMINOLOGIES
• Program and Software :- The software is the superset of the program(s). It consists of one or many program(s), documentation
manuals and operating procedure manuals. These components are shown in Figure.