You are on page 1of 13

Application Development and Emerging Technologies Lesson 5

Software Testing

The Big Picture proper process of development, testing


and bug fixing. Testing looks at areas
All software problems can be termed as such as performance, stability and error
bugs. A software bug usually occurs handling by setting up test scenarios
when the software does not do what it is under controlled conditions and
intended to do or does something that it assessing the results. This is why
is not intended to do. Flaws in exactly any software has to be tested. It
specifications, design, code or other is important to note that software is
reasons can cause these bugs. mainly tested to see that it meets the
Identifying and fixing bugs in the early customers’ needs and that it conforms
stages of the software is very important to the standards. It is a usual norm that
as the cost of fixing bugs grows over software is considered of good quality if
time. So, the goal of a software tester is it meets the user requirements.
to find bugs and find them as early as
possible and make sure they are fixed. What is Quality? How important is it?

Testing is context-based and risk-driven. Quality can briefly be defined as “a


It requires a methodical and disciplined degree of excellence”. High quality
approach to finding bugs. A good software usually conforms to the user
software tester needs to build credibility requirements. A customer’s idea of
and possess the attitude to be quality may cover a breadth of features -
explorative, troubleshooting, relentless, conformance to specifications, good
creative, diplomatic and persuasive. performance on
platform(s)/configurations, completely
What is software? Why should it be meets operational requirements (even if
tested? not specified!), compatibility to all the
Software is a series of instructions for end-user equipment, no negative impact
the computer that perform a particular on existing end-user base at
task, called a program; the two major introduction time.
categories of software are system Quality software saves good amount of
software and application software. time and money. Because software will
System software is made up of control have fewer defects, this saves time
programs. Application software is any during testing and maintenance phases.
program that processes data for the Greater reliability contributes to an
user (spreadsheet, word processor, immeasurable increase in customer
payroll, etc.). satisfaction as well as lower
A software product should only be maintenance costs. Because
released after it has gone through a maintenance represents a large portion
Application Development and Emerging Technologies Lesson 5

of all software costs, the overall cost of used metric units for a key spacecraft
the project will most likely be lower than operation.
similar projects.
What exactly does a software tester
Following are two cases that do?
demonstrate the importance of software
quality: Apart from exposing faults (“bugs”) in a
software product confirming that the
Ariane 5 crash June 4, 1996 program meets the program
specification, as a test engineer you
- Maiden flight of the European Ariane 5 need to create test cases, procedures,
launcher crashed about 40 seconds scripts and generate data. You execute
after takeoff test procedures and scripts, analyze
- Loss was about half a billion dollars - standards and evaluate results of
Explosion was the result of a software system/integration/regression testing.
error • Speed up development process by
- Uncaught exception due to floating- identifying bugs at an early stage (e.g.
point error: conversion from a 64-bit specifications stage)
integer to a 16-bit signed integer applied • Reduce the organization's risk of legal
to a larger than expected number liability
- Module was re-used without proper • Maximize the value of the software
testing from Ariane 4
• Assure successful launch of the
- Error was not supposed to happen with product, save money, time and
Ariane 4 reputation of the company by
- No exception handler Mars Climate discovering bugs and design flaws at an
Orbiter early stage before failures occur in
production, or in the field
- September 23, 1999
• Promote continual improvement
- Mars Climate Orbiter, disappeared
as it began to orbit Mars. What makes a good tester?

- Cost about $US 125-million As software engineering is now being


considered as a technical engineering
- Failure due to error in a transfer of profession, it is important that the
information between a team in Colorado software test engineer’s posses certain
and a team in California traits with a relentless attitude to make
them stand out. Here are a few.
- One team used English units (e.g.,
inches, feet and pounds) while the other
Application Development and Emerging Technologies Lesson 5

• Know the technology. Knowledge of • Posses people skills and tenacity.


the technology in which the application Testers can face a lot of resistance from
is developed is an added advantage to programmers. Being socially smart and
any tester. It helps design better and diplomatic doesn't mean being
powerful test cases basing on the indecisive. The best testers are
weakness or flaws of the technology. bothsocially adept and tenacious where
Good testers know what it supports and it matters.
what it doesn’t, so concentrating on
these lines will help them break the • Organized. Best testers very well
application quickly. realize that they too can make mistakes
and don’t take chances. They are very
• Perfectionist and a realist. Being a well organized and have checklists, use
perfectionist will help testers spot the files, facts and figures to support their
problem and being a realist helps know findings that can be used as an
at the end of the day which problems evidence and double-check their
are really important problems. You will findings.
know which ones require a fix and which
ones don’t. • Objective and accurate. They are
very objective and know what they
• Tactful, diplomatic and persuasive. report and so convey impartial and
Good software testers are tactful and meaningful information that keeps
know how to break the news to the politics and emotions out of message.
developers. They are diplomatic while Reporting inaccurate information is
convincing the developers of the bugs losing a little credibility. Good testers
and persuade them when necessary make sure their findings are accurate
and have their bug(s) fixed. It is and reproducible.
important to be critical of the issue and
not let the person who developed the • Defects are valuable. Good testers
application be taken aback of the learn from them. Each defect is an
findings. opportunity to learn and improve. A
defect found early substantially costs
• An explorer. A bit of creativity and an less when compared to the one found at
attitude to take risk helps the testers a later stage. Defects can cause serious
venture into unknown situations and find problems if not managed properly.
bugs that otherwise will be looked over. Learning from defects helps –
prevention of future problems, track
• Troubleshoot. Troubleshooting and improvements, improve prediction and
figuring out why something doesn’t work estimation.
helps testers be confident and clear in
communicating the defects to the Guidelines for new testers
developers.
Application Development and Emerging Technologies Lesson 5

• Testing can’t show that bugs don’t were unable to get the software to work.
exist. An important reason for testing is It worked on a few systems – likely the
to prevent defects. You can perform ones that the Disney programmers used
your tests, find and report bugs, but at to create the game – but not on the
no point can you guarantee that there most common systems that the general
are no bugs. public used.

• It is impossible to test a program • No application is 100% bug free. It is


completely. Unfortunately this is not more reasonable to recognize there are
possible even with the simplest program priorities, which may leave some less
because – the number of inputs is very critical problems unsolved or
large, number of outputs is very large, unidentified. Simple case is the Intel
number of paths through the software is Pentium bug. Enter the following
very large, and the specification is equation into your PC’s calculator:
subjective to frequent changes. (4195835 / 3145727) * 3145727 –
4195835. If the answer is zero, your
• You can’t guarantee quality. As a computer is just fine. If you get anything
software tester, you cannot test else, you have an old Intel Pentium CPU
everything and are not responsible for with a floating-point division bug.
the quality of the product. The main way
that a tester can fail is to fail to report • Be the customer. Try to use the
accurately a defect you have observed. system as a lay user. To get a glimpse
It is important to remember that we of this, get a person who has no idea of
seldom have little control over quality. the application to use it for a while and
you will be amazed to see the number of
• Target environment and intended end problems the person seem to come
user. Anticipating and testing the across. As you can see, there is no
application in the environment user is procedure involved. Doing this could
expected to use is one of the major actually cause the system to encounter
factors that should be considered. Also, an array of unexpected tests –
considering if the application is a single repetition, stress, load, race etc.
user system or multi user system is
important for demonstrating the ability • Build your credibility. Credibility is like
for immediate readiness when quality that includes reliability,
necessary. The error case of Disney’s knowledge, consistency, reputation,
Lion King illustrates this. Disney trust, attitude and attention to detail. It is
Company released it first multimedia not instant but should be built over time
CD-ROM game for children, The Lion and gives voice to the testers in the
King Animated Storybook. It was highly organization. Your keys to build
promoted and the sales were huge. credibility – identify your strengths and
Soon there were reports that buyers weaknesses, build good relations,
Application Development and Emerging Technologies Lesson 5

demonstrate competency, be willing to What is a bug? Why do bugs occur?


admit mistakes, re-assess and adjust.
A software bug may be defined as a
• Test what you observe. It is very coding error that causes an unexpected
important that you test what you can defect, fault, flaw, or imperfection in a
observe and have access to. Writing computer program. In other words, if a
creative test cases can help only when program does not perform as intended,
you have the opportunity to observe the it is most likely a bug. There are bugs in
results. So, assume nothing. software due to unclear or constantly
changing requirements, software
• Not all bugs you find will be fixed. complexity, programming errors,
Deciding which bugs will be fixed and timelines, errors in bug tracking,
which won’t is a risk-based decision. communication gap, documentation
Several reasons why your bug might not errors, deviation from standards etc.
be fixed is when there is no enough
time, the bug is dismissed for a new • Unclear software requirements are due
feature, fixing it might be very risky or it to miscommunication as to what the
may not be worth it because it occurs software should or shouldn’t do. In many
infrequently or has a work around where occasions, the customer may not be
the user can prevent or avoid the bug. completely clear as to how the product
Making a wrong decision can be should ultimately function. This is
disastrous. especially true when the software is a
developed for a completely new product.
• Review competitive products. Gaining Such cases usually lead to a lot of
a good insight into various products of misinterpretations from any or both
the same kind and getting to know their sides.
functionality and general behavior will
help you design different test cases and • Constantly changing software
to understand the strengths and requirements cause a lot of confusion
weaknesses of your application. This and pressure both on the development
will also enable you to add value and and testing teams. Often, a new feature
suggest new features and added or existing feature removed can
enhancements to your product. be linked to the other modules or
components in the software.
• Follow standards and processes. As a Overlooking such issues causes bugs.
tester, your need to conform to the
standards and guidelines set by the • Also, fixing a bug in one
organization. These standards pertain to part/component of the software might
reporting hierarchy, coding, arise another in a different or same
documentation, testing, reporting bugs, component. Lack of foresight in
using automated tools etc. anticipating such issues can cause
Application Development and Emerging Technologies Lesson 5

serious problems and increase in bug • Programmers usually tend to rush as


count. This is one of the major issues the deadline approaches closer. This is
because of which bugs occur since the time when most of the bugs occur. It
developers are very often subject to is possible that you will be able to spot
pressure related to timelines; frequently bugs of all types and severity.
changing requirements, increase in the
number of bugs etc. • Designing and re- • Complexity in keeping track of all the
designing, UI interfaces, integration of bugs can again cause bugs by itself.
modules, database management all This gets harder when a bug has a very
these add to the complexity of the complex life cycle i.e. when the number
software and the system as a whole. of times it has been closed, reopened,
not accepted, ignored etc goes on
• Fundamental problems with software increasing.
design and architecture can cause
problems in programming. Developed Bug Life Cycle
software is prone to error as Bug Life Cycle starts with an
programmers can make mistakes too. unintentional software bug/behavior and
As a tester you can check for, data ends when the assigned developer fixes
reference/declaration errors, control flow the bug. A bug when found should be
errors, parameter errors, input/output communicated and assigned to a
errors etc. developer that can fix it. Once fixed, the
• Rescheduling of resources, re-doing problem area should be re-tested. Also,
or discarding already completed work, confirmation should be made to verify if
changes in hardware/software the fix did not create problems
requirements can affect the software elsewhere. In most of the cases, the life
too. Assigning a new developer to the cycle gets very complicated and difficult
project in midway can cause bugs. This to track making it imperative to have a
is possible if proper coding standards bug/defect tracking system in place.
have not been followed, improper code Following are the different phases of a
documentation, ineffective knowledge Bug Life Cycle:
transfer etc. Discarding a portion of the
existing code might just leave its trail Open: A bug is in Open state when a
behind in other parts of the software; tester identifies a problem area
overlooking or not eliminating such code
Accepted: The bug is then assigned to
can cause bugs. Serious bugs can
a developer for a fix. The developer then
especially occur with larger projects, as
accepts if valid.
it gets tougher to identify the problem
area. Not Accepted/Won’t fix: If the
developer considers the bug as low
Application Development and Emerging Technologies Lesson 5

level or does not accept it as a bug, thus Pending state. Fixed: Programmer will
pushing it into Not Accepted/Won’t fix fix the bug and resolves it as Fixed.
state.
Close: The fixed bug will be assigned to
Such bugs will be assigned to the the tester who will put it in the Close
project manager who will decide if the state.
bug needs a fix. If it needs, then assigns
it back to the developer, and if it doesn’t, Re-Open: Fixed bugs can be re-opened
then assigns it back to the tester who by the testers in case the fix produces
will have to close the bug. problems elsewhere.

Pending: A bug accepted by the The image below clearly shows the Bug
developer may not be fixed immediately. Life Cycle and how a bug can be
In such cases, it can be put under tracked using Bug Tracking Tools

(BTT)

There are basically three levels of


testing i.e.

Unit Testing, Integration Testing and


System Testing.

Various types of testing come under


these levels.

Unit Testing

To verify a single program or a section


of a single program

Integration Testing

To verify interaction between system


components Prerequisite: unit testing
completed on all components that
compose a system
Software Testing Levels, Types, System Testing
Terms and Definitions
To verify and validate behaviors of the
Testing Levels and Types entire system against the original
system objectives
Application Development and Emerging Technologies Lesson 5

Software testing is a process that interface, etc. independently as a stand-


identifies the correctness, alone component/program. The types
completeness, and quality of software. and degrees of unit tests can vary
among modified and newly created
Following is a list of various types of programs. Unit testing is mostly
software testing and their definitions in a performed by the programmers who are
random order: also responsible for the creation of the
• Formal Testing: Performed by test necessary unit test data.
engineers • Incremental Testing: Incremental
• Informal Testing: Performed by the testing is partial testing of an incomplete
developers product. The goal of incremental testing
is to provide an early feedback to
• Manual Testing: That part of software software developers.
testing that requires human input,
analysis, or evaluation. • System Testing: System testing is a
form of black box testing. The purpose
• Automated Testing: Software testing of system testing is to validate an
that utilizes a variety of tools to application's accuracy and
automate the testing process. completeness in performing the
Automated testing still requires a skilled functions as designed.
quality assurance professional with
knowledge of the automation tools and • Integration Testing: Testing two or
the software being tested to set up the more modules or functions together with
test cases. the intent of finding interface defects
between the modules/functions.
• Black box Testing: Testing software
without any knowledge of the back-end • System Integration Testing: Testing
of the system, structure or language of of software components that have been
the module being tested. Black box test distributed across multiple platforms
cases are written from a definitive (e.g., client, web server, application
source document, such as a server, and database server) to produce
specification or requirements document. failures caused by system integration
defects (i.e. defects involving distribution
• White box Testing: Testing in which and back-office integration).
the software tester has knowledge of the
back-end, structure and language of the • Functional Testing: Verifying that a
software, or at least its purpose. module functions as stated in the
specification and establishing
• Unit Testing: Unit testing is the confidence that a program does what it
process of testing a particular complied is supposed to do.
program, i.e., a window, a report, an
Application Development and Emerging Technologies Lesson 5

• End-to-end Testing: Similar to system • Configuration Testing: Testing to


testing - testing a complete application determine how well the product works
in a situation that mimics real world use, with a broad range of
such as interacting with a database, hardware/peripheral equipment
using network communication, or configurations as well as on different
interacting with other hardware, operating systems and software.
application, or system.
• Load Testing: Testing with the intent
• Sanity Testing: Sanity testing is of determining how well the product
performed whenever cursory testing is handles competition for system
sufficient to prove the application is resources. The competition may come
functioning according to specifications. in the form of network traffic, CPU
This level of testing is a subset of utilization or memory allocation.
regression testing. It normally includes
testing basic GUI functionality to Stress Testing: Testing done to
demonstrate connectivity to the evaluate the behavior when the system
database, application servers, printers, is pushed beyond the breaking point.
etc The goal is to expose the weak links
and to determine if the system manages
. • Regression Testing: Testing with to recover gracefully.
the intent of determining if bug fixes
have been successful and have not • Performance Testing: Testing with
created any new problems. the intent of determining how efficiently
a product handles a variety of events.
• Acceptance Testing: Testing the Automated test tools geared specifically
system with the intent of confirming to test and fine-tune performance are
readiness of the product and customer used most often for this type of testing.
acceptance. Also known as User
Acceptance Testing. • Usability Testing: Usability testing is
testing for 'user-friendliness'. A way to
• Adhoc Testing: Testing without a evaluate and measure how users
formal test plan or outside of a test plan. interact with a software product or site.
With some projects this type of testing is Tasks are given to users and
carried out as an addition to formal observations are made.
testing. Sometimes, if testing occurs
very late in the development cycle, this • Installation Testing: Testing with the
will be the only kind of testing that can intent of determining if the product is
be performed – usually done by skilled compatible with a variety of platforms
testers. Sometimes ad hoc testing is and how easily it installs.
referred to as exploratory testing. • Recovery/Error Testing: Testing how
well a system recovers from crashes,
Application Development and Emerging Technologies Lesson 5

hardware failures, or other catastrophic cooperation with the software


problems. engineering department.

• Security Testing: Testing of database Beta Testing: Testing after the product
and network software in order to keep is code complete. Betas are often widely
company data and resources secure distributed or even distributed to the
from mistaken/accidental users, public at large.
hackers, and other malevolent
attackers. • Gamma Testing: Gamma testing is
testing of software that has all the
• Penetration Testing: Penetration required features, but it did not go
testing is testing how well the system is through all the in-house quality checks.
protected against unauthorized internal
or external access, or willful damage. • Mutation Testing: A method to
This type of testing usually requires determine to test thoroughness by
sophisticated testing techniques. measuring the extent to which the test
cases can discriminate the program
• Compatibility Testing: Testing used from slight variants of the program.
to determine whether other system
software components such as browsers, • Independent Verification and
utilities, and competing software will Validation (IV&V): The process of
conflict with the software being tested. exercising software with the intent of
ensuring that the software system meets
• Exploratory Testing: Any testing in its requirements and user expectations
which the tester dynamically changes and doesn't fail in an unacceptable
what they're doing for test execution, manner. The individual or group doing
based on information they learn as this work is not part of the group or
they're executing their tests. organization that developed the
software.
• Comparison Testing: Testing that
compares software weaknesses and • Pilot Testing: Testing that involves the
strengths to those of competitors' users just before actual release to
products. ensure that users become familiar with
the release contents and ultimately
• Alpha Testing: Testing after code is accept it. Typically involves many users,
mostly complete or contains most of the is conducted over a short period of time
functionality and prior to reaching and is tightly controlled. (See beta
customers. Sometimes a selected group testing)
of users are involved. More often this
testing will be performed in-house or by • Parallel/Audit Testing: Testing where
an outside testing firm in close the user reconciles the output of the
new system to the output of the current
Application Development and Emerging Technologies Lesson 5

system to verify the new system • Defect: Defect is the variance from a
performs the operations correctly. desired product attribute (it can be a
wrong, missing or extra data). It can be
• Glass Box/Open Box Testing: Glass of two types – Defect from the product
box testing is the same as white box or a variance from customer/user
testing. It is a testing approach that expectations. It is a flaw in the software
examines the application's program system and has no impact until it affects
structure, and derives test cases from the user/customer and operational
the application's program logic. system. 90% of all the defects can be
• Closed Box Testing: Closed box caused by process problems.
testing is same as black box testing. A • Failure: A defect that causes an error
type of testing that considers only the in operation or negatively impacts a
functionality of the application. user/ customer.
• Bottom-up Testing: Bottom-up • Quality Assurance: Is oriented
testing is a technique for integration towards preventing defects. Quality
testing. A test engineer creates and Assurance ensures all parties
uses test drivers for components that concerned with the project adhere to the
have not yet been developed, because, process and procedures, standards and
with bottom-up testing, low-level templates and test readiness reviews.
components are tested first. The
objective of bottom-up testing is to call • Quality Control: quality control or
low-level components first, for testing quality engineering is a set of measures
purposes. taken to ensure that defective products
or services are not produced, and that
• Smoke Testing: A random test the design meets performance
conducted before the delivery and after requirements.
complete testing.
• Verification: Verification ensures the
Testing Terms product is designed to deliver all
• Bug: A software bug may be defined functionality to the customer; it typically
as a coding error that causes an involves reviews and meetings to
unexpected defect, fault or flaw. In other evaluate documents, plans, code,
words, if a program does not perform as requirements and specifications; this
intended, it is most likely a bug. can be done with checklists, issues lists,
walkthroughs and inspection meetings.
• Error: A mismatch between the
program and its specification is an error • Validation: Validation ensures that
in the program. functionality, as defined in requirements,
is the intended behavior of the product;
validation typically involves actual
Application Development and Emerging Technologies Lesson 5

testing and takes place after Failure to block or un-block interrupts,


verifications are completed. Comparison sometimes yields wrong
result, Missing/wrong default, Data Type
Most common software errors errors.
Types of errors with examples • Errors in Handling or Interpreting
• User Interface Errors: Data: Un-terminated null strings,
Missing/Wrong Functions, Doesn’t do Overwriting a file after an error exit or
what the user expects, Missing user abort.
information, Misleading, Confusing • Race Conditions: Assumption that
information, Wrong content in Help text, one event or task finished before
Inappropriate error messages. another begins, Resource races, Tasks
Performance issues - Poor starts before its prerequisites are met,
responsiveness, Can't redirect output, Messages cross or don't arrive in the
Inappropriate use of key board order sent.
• Error Handling: Inadequate - • Load Conditions: Required resources
protection against corrupted data, tests are not available, No available large
of user input, version control; Ignores – memory area, Low priority tasks not put
overflow, data comparison, Error off, Doesn't erase old files from mass
recovery – aborting errors, recovery storage, Doesn't return unused memory.
from hardware problems.
• Hardware: Wrong Device, Device
• Boundary related errors: Boundaries unavailable, Underutilizing device
in loop, space, time, memory, intelligence, Misunderstood status or
mishandling of cases outside boundary. return code, Wrong operation or
• Calculation errors: Bad Logic, Bad instruction codes.
Arithmetic, Outdated constants, • Source, Version and ID Control: No
Calculation errors, Incorrect conversion Title or version ID, Failure to update
from one data representation to another, multiple copies of data or program files.
Wrong formula, Incorrect approximation.
• Testing Errors: Failure to
• Initial and Later states: Failure to - notice/report a problem, Failure to use
set data item to zero, to initialize a loop- the most promising test case, Corrupted
control variable, or re-initialize a pointer, data files, Misinterpreted specifications
to clear a string or flag, Incorrect or documentation, Failure to make it
initialization. clear how to reproduce the problem,
• Control flow errors: Wrong returning Failure to check for unresolved
state assumed, Exception handling problems just before release, Failure to
based exits, Stack underflow/overflow,
Application Development and Emerging Technologies Lesson 5

verify fixes, Failure to provide summary


report.

You might also like