Unit 1 & 2
Unit 1 & 2
Finding defects which may get created by the programmer while developing the
software.
Gaining confidence in and providing information about the level of quality.
To prevent defects.
To make sure that the end result meets the business and user requirements.
To ensure that it satisfies the BRS that is Business Requirement Specification and SRS
that is System Requirement Specifications.
To gain the confidence of the customers by providing them a quality product.
Software testing helps in finalizing the software application or product against business and
user requirements. It is very important to have good test coverage in order to test the software
appli atio o pletel a d ake it su e that it s pe fo i g ell a d as pe the spe ifi atio s.
While determining the test coverage the test cases should be designed well with maximum
possibilities of finding the errors or bugs. The test cases should be very effective. This objective
can be measured by the number of defects reported per test cases. Higher the number of the
defects reported the more effective are the test cases.
Once the delivery is made to the end users or the customers they should be able to operate it
without any complaints. In order to make this happen the tester should know as how the
customers are going to use this product and accordingly they should write down the test
scenarios and desig the test ases. This ill help a lot i fulfilli g all the usto e s
requirements.
Software testing makes sure that the testing is being done properly and hence the system is
ready for use. Good coverage means that the testing has been done to cover the various areas
like functionality of the application, compatibility of the application with the OS, hardware and
different types of browsers, performance testing to test the performance of the application and
load testing to make sure that the system is reliable and should not crash or there should not
be any blocking issues. It also determines that the application can be deployed easily to the
machine and without any resistance. Hence the application is easy to install, learn and use.
What is an error?
What is a fault?
Fault is incorrect step, process or data definition in a computer program which causes
the program to behave in an unintended or unanticipated manner.
It is the result of the error.
What is a bug?
Bug is a fault in the program which causes the program to behave in an unintended or
unanticipated manner.
It is an evidence of fault in the program.
What is a failure?
What is a defect?
The addition of 5 + 3 = 2.
So after compiling and running this program we realize the program has failed to do what it was
supposed to do.
The program was supposed to add two numbers but it certainly did not add 5 and 3. 5 + 3
should be 8, but the result is 2. There could be various reasons as to why the program displays
the answer 2 instead of 8. For now we have detected a failure.
As the failure has been detected a defect can be raised.
No let s go a k to the p og a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include<stdio.h>
int main ()
{
int value1, value2, ans;
value1 = 5;
value2 = 3;
ans = value1 - value2; // ----> Bug
printf("The addition of 5 + 3 = %d.", ans);
return 0;
}
We oti e at li e u e
, the e is a - sig p ese t i stead of + sig . o the fault i the
p og a is the - sig . Li e
has the fault hi h aused the p og a to de iate f o the
functionality.
E o is the istake I ade
t pi g - i stead of + sig . We ha e o se ed failu e i
execution of the program. And in this case we can also say we have found the bug.
o e t
A tester does not necessarily have access to the code and may be just testing the functionality
of the program. In that case the tester will realize the output is faulty and will raise a defect.
Due to the observed wrong result it is known of the fact that the program has an error which
resulted in the fault in the program and due to which the program failed to give the correct
result. But the tester may not know exactly what is causing the error.
IEEE Definitions
Basics
Software
Quality
Dimensions
of Quality
Software
Quality
Assurance
Software
Quality
Control
SQA and SQC
Differences
Summary
Learn how software quality is defined and what it means. Software quality is the
degree of conformance to explicit or implicit requirements and expectations.
Learn the dimensions of quality. Software quality has dimensions such as
A essi ilit , Co pati ilit , Co u e , Effi ie
Learn what it means and what its relationship is with Software Quality Control.
Software Quality Assurance is a set of activities for ensuring quality in software
engineering processes.
Learn what it means and what its relationship is with Software Quality
Assurance. Software Quality Control is a set of activities for ensuring quality in
software products.
Learn the differences between Software Quality Assurance and Software
Quality Control. SQA is process-focused and prevention-oriented but SQC is
product-focused and detection-oriented.
Software
Learn what SDLC means and what activities a typical SDLC model comprises of.
Development Software Development Life Cycle defines the steps/stages/phases in the
Life Cycle
building of software.
Software
Learn what STLC means and what activities a typical STLC model comprises of.
Testing Life Software Testing Life Cycle (STLC) defines the steps/ stages/ phases in testing of
Cycle
software.
Definition of Lea the a ious defi itio s of the te
test . Me ia We ste defines Test
Test
as a iti al e a i atio , o se atio , o e aluatio .
Software
Testing
Myths
Just as every field has its myths, so does the field of Software Testing. We
explain some of the myths along with their related facts.
PRINCIPLES OF TESTING
There are seven principles of testing. They are as follows:
1) Testing shows presence of defects: Testing can show the defects are present, but cannot
prove that there are no defects. Even after testing the application or product thoroughly we
cannot say that the product is 100% defect free. Testing always reduces the number of
undiscovered defects remaining in the software but even if no defects are found, it is not a
proof of correctness.
2) Exhaustive testing is impossible: Testing everything including all combinations of inputs and
preconditions is not possible. So, instead of doing the exhaustive testing we can use risks and
priorities to focus testing efforts. For example: In an application in one screen there are 15
input fields, each having 5 possible values, then to test all the valid combinations you would
need 30 517 578 125 (515) tests. This is very unlikely that the project timescales would allow
for this number of tests. So, accessing and managing risk is one of the most important activities
and reason for testing in any project.
3) Early testing: In the software development life cycle testing activities should start as early as
possible and should be focused on defined objectives.
4) Defect clustering: A small number of modules contains most of the defects discovered during
pre-release testing or shows the most operational failures.
5) Pesticide paradox: If the same kinds 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 o e o e this Pesti ide
Pa ado , it is eall e i po ta t to e ie the test ases egula l a d e a d diffe e t
tests need to be written to exercise different parts of the software or system to potentially find
more defects.
6) Testing is context depending: Testing is basically context dependent. Different kinds of sites
are tested differently. For example, safety critical software is tested differently from an ecommerce site.
7) Absence of errors fallacy: If the system built is unusable a d does ot fulfill the use s
needs and expectations then finding and fixing defects does not help.
STLC: SOFTWARE TESTING LIFE CYCLE
Software Testing Life Cycle (STLC) defines the steps/ stages/ phases in testing of software.
However, there is no fixed standard STLC in the world and it basically varies as per the
following:
Nevertheless, Software Testing Life Cycle, in general, comprises of the following phases:
Phase
Activity
Deliverables
Requirements/
Design Review
Test Planning
Necessity
Defe t
Curiosity
Farsightedness
Test Schedule
Test Designing
10
10
Test
Environment
Setup
Test Execution
Test Reporting
You
setup
the
test
environment (server/ client/
network, etc) with the goal
of replicating the end-use s
environment.
You execute your Test
Cases/ Scripts in the Test
Environment to see whether
they pass.
Test Environment
Test
(Incremental)
Rich company
Results Patience
Defect Reports
Diplomacy
11
11
Correctness
Software Correctness: A program P is considered with respect to a specification S, if and only if,
For each valid input, the output of P is in accordance with the specification S
Correctness is:
Note: If the software behaves incorrectly, it might get validated and verified. We cannot
guarantee correctness in the software development and testing process
Correctness from software engineering perspective can be defined as the adherence to the
specifications that determine how users can interact with the software and how the software
should behave when it is used correctly.
If the software behaves incorrectly, it might take considerable amount of time to achieve the
task or sometimes it is impossible to achieve it.
Below are some of the important rules for effective programming which are consequences of
the program correctness theory.
12
12
DEBUGGING
1. Debugging starts from possibly unknown initial conditions and its end
cannot be predicted, apart from
statistically.
2. The procedures for, and period of,
debugging cannot be so constrained.
3. It is the p og a
e s i di atio .
4. It is always treated as a deductive
process.
5. Debugging demands intuitive leaps,
conjectures, experimentation, and some
freedom also.
13
13
easu e .
SOFTWARE METRICS
Take the decision for next phase of activities such as, estimate the cost & schedule of
future projects.
Understand the kind of improvement required to success the project
Take decision on process or technology to be modified etc.
14
14
Suppose, if a project does not have any metrics, then how the quality of the work done by a
Test analyst will be measured?
For Example: A Test Analyst has to,
In above scenario, if metrics are not followed, then the work completed by the test analyst will
be subjective i.e. the test report will not have the proper information to know the status of his
work/project.
If Metrics are involved in the project, then the exact status of his/her work with proper
numbers/data can be published, i.e., in the Test report, we can publish:
1.
2.
3.
4.
5.
6.
7.
Based on the project needs we can have more metrics than above mentioned list, to know the
status of the project in detail.
Based on the above metrics, test lead/manager will get the understanding of the below
mentioned key points.
a.
b.
c.
d.
Based on the metrics, if the project is not going to complete as per the schedule, then the
manager will raise the alarm to the client and other stake holders by providing the reasons for
lagging to avoid the last minute surprises.
15
15
It makes sure that the product is designed to deliver all functionality to the customer.
Verification is done at the starting of the development process. It includes reviews and
meetings, walkthroughs, inspection, etc. to evaluate documents, plans, code,
requirements and specifications.
16
16
Suppose you are building a table. Here the verification is about checking all the parts of
the table, whether all the four legs are of correct size or not. If one leg of table is not of
the right size it will imbalance the end product. Similar behavior is also noticed in case of
the software product or application. If any feature of software product or application is
not up to the mark or if any defect is found then it will result into the failure of the end
product. Hence, verification is very important. It takes place at the starting of the
development process.
Am I accessing the data right (in the right place; in the right way).
According to the Capability Maturity Model(CMMI-SW v1.1) we can also define verification as
the process of evaluating software to determine whether the products of a given development
phase satisfy the conditions imposed at the start of that phase. [IEEE-STD-610].
ADVANTAGES OF SOFTWARE VERIFICATION:
1.
Verification helps in lowering down the count of the defect in the later stages of
development.
2.
Verifying the product at the starting phase of the development will help in
understanding the product in a better way.
3.
4.
It helps in building the product as per the customer specifications and needs.
17
17
VALIDATION
Determining if the system complies with the requirements and performs functions for
hi h it is i te ded a d eets the o ga izatio s goals a d use eeds.
Validation is done at the end of the development process and takes place after
verifications are completed.
It answers the question like: Am I building the right product?
Am I accessing the right data (in terms of the data required to satisfy the requirement).
It is a High level activity.
Performed after a work product is produced against established criteria ensuring that the
product integrates correctly into the environment.
Determination of correctness of the final software product by a development project
with respect to the user needs and requirements.
According to the Capability Maturity Model(CMMI-SW v1.1) we can also define validation as
The process of evaluating software during or at the end of the development process to
determine whether it satisfies specified requirements. [IEEE-STD-610].
A product can pass while verification, as it is done on the paper and no running or functional
application is required. But, when same points which were verified on the paper is actually
developed then the running application or product can fail while validation. This may happen
because when a product or application is build as per the specification but these specifications
are not up to the mark hence they fail to address the user requirements.
ADVANTAGES OF VALIDATION:
1.
During verification if some defects are missed then during validation process it can
be caught as failures.
18
18
2.
3.
4.
Validation is basically done by the testers during the testing. While validating the product if
some deviation is found in the actual result from the expected result then a bug is reported or
an incident is raised. Not all incidents are bugs. But all bugs are incidents. Incidents can also be
of t pe Questio
he e the fu tio alit is ot lea to the teste .
Hence, validation helps in unfolding the exact functionality of the features and helps the testers
to understand the product in much better way. It helps in making the product more user
friendly.
TYPES OF TESTING
BASICS OF SOFTWARE TESTING
There are two basics of software testing: blackbox testing and whitebox testing.
BLACKBOX TESTING
Black box testing is a testing technique that ignores the internal mechanism of the system and
focuses on the output generated against any input and execution of the system. It is also called
functional testing.
WHITEBOX TESTING
White box testing is a testing technique that takes into account the internal mechanism of a
system. It is also called structural testing and glass box testing.
Black box testing is often used for validation and white box testing is often used for verification.
TYPES OF TESTING
There are many types of testing like
1. Unit Testing
2. Integration Testing
3. Functional Testing
19
19
4. System Testing
5. Stress Testing
6. Performance Testing
7. Usability Testing
8. Acceptance Testing
9. Regression Testing
10. Beta Testing
UNIT TESTING
Unit testing is the testing of an individual unit or group of related units. It falls under the class
of white box testing. It is often done by the programmer to test that the unit he/she has
implemented is producing expected output against given input.
INTEGRATION TESTING
Integration testing is testing in which a group of components are combined to produce output.
Also, the interaction between software and hardware is tested in integration testing if software
and hardware components have any relation. It may fall under both white box testing and black
box testing.
FUNCTIONAL TESTING
Functional testing is the testing to ensure that the specified functionality required in the system
requirements works. It falls under the class of black box testing.
20
20
SYSTEM TESTING
System testing is the testing to ensure that by putting the software in different environments
(e.g., Operating Systems) it still works. System testing is done with full system implementation
and environment. It falls under the class of black box testing.
STRESS TESTING
Stress testing is the testing to evaluate how system behaves under unfavorable conditions.
Testing is conducted at beyond limits of the specifications. It falls under the class of black box
testing.
PERFORMANCE TESTING
Performance testing is the testing to assess the speed and effectiveness of the system and to
make sure it is generating results within a specified time as in performance requirements. It
falls under the class of black box testing.
USABILITY TESTING
Usability testing is performed to the perspective of the client, to evaluate how the GUI is userfriendly? How easily can the client learn? After learning how to use, how proficiently can the
client perform? How pleasing is it to use its design? This falls under the class of black box
testing.
ACCEPTANCE TESTING
Acceptance testing is often done by the customer to ensure that the delivered product meets
the requirements and works as the customer expected. It falls under the class of black box
testing.
REGRESSION TESTING
Regression testing is the testing after modification of a system, component, or a group of
related units to ensure that the modification is working correctly and is not damaging or
imposing other modules to produce unexpected results. It falls under the class of black box
testing.
BETA TESTING
Beta testing is the testing which is done by end users, a team outside development, or publicly
releasing full pre-version of the product which is known as beta version. The aim of beta testing
is to cover unexpected errors. It falls under the class of black box testing.
21
21
22
22
CONCLUSION: Both terms, reliable and quality, can be used to describe a software application
that has a low degree of error. But there is one fundamental difference between the two.
Software Reliability is objective, measurable, and can be estimated, whereas Software Quality is
based on primarily subjective criteria.
In the context of software engineering, software quality measures how well software is
designed (quality of design), and how well the software conforms to that design (quality of
conformance).
SOFTWARE DEFECT TRACKING
Defect logging, a process of finding defects in the application under test or product by testing or
recording feedback from customers and making new versions of the product that fix the defects
or the clients feedback.
23
23
24
24
Duplicate: If the bug is repeated twice or the two bugs mention the same concept of the
ug, the o e ug status is ha ged to dupli ate .
Rejected: If the developer feels that the bug is not genuine, he rejects the bug. Then the
state of the bug is cha ged to eje ted .
Deferred: The bug, changed to deferred state means the bug is expected to be fixed in
next releases. The reasons for changing the bug to this state have many factors. Some of
them are priority of the bug may be low, lack of time for the release or the bug may not
have major effect on the software.
Not a ug: The state gi e as Not a ug if the e is o ha ge i the fu tio alit of the
application. For an example: If customer asks for some change in the look and field of
the application like change of color of some text then it is not a bug but just some
change in the looks of the application.
END OF UNIT-1
CONTENTS
1.
2.
3.
4.
5.
6.
7.
8.
25
25
Testing can be commenced at an earlier stage. One need not wait for the GUI to be
available.
Testing is more thorough, with the possibility of covering most paths.
Since tests can be very complex, highly skilled resources are required, with thorough
knowledge of programming and implementation.
Test script maintenance can be a burden if the implementation changes too frequently.
Since this method of testing it closely tied with the application being testing, tools to
cater to every kind of implementation/platform may not be readily available.
26
26
STATIC TESTING
Static testing is a type of testing which requires only the source code of the product, not the
binaries or executables. Static testing does not involve executing the programs on computers
but involves select people going through the code to find out whether
The code works according to the functional requirement;
The code has been written in accordance with the design developed earlier in the
project life cycle;
The code for any functionality has been missed out;
The code handles errors properly.
Static testing is the testing of the software work products manually, or with a set of
tools, but they are not executed.
It starts early in the Life cycle and so it is done during the verification process.
It does not need computer as the testing of program is done without executing the
program. For example: reviewing, walk through, inspection, etc.
NOTE: Static testing can be done by humans or with the help of specialized tools.
METHODS TO ACHIEVE STATIC TESTING
27
27
DESK CHECKING
Normally done manually by the author of the code, desk checking is a method to verify the
portions of the code for correctness. Such verification is done by comparing the code with the
design or specifications to make sure that the code does what it is supposed to do and
effectively. This is the desk checking that most programmers do before compiling and executing
the code. Whenever errors are found, the author applies the corrections for errors on the spot.
This method of catching and correcting errors is characterized by:
No structured method or formalism to ensure completeness and
No maintaining of a log or checklist.
In effect, this method relies completely on the author's thoroughness, diligence, and skills.
There is no process or structure that guarantees or verifies the effectiveness of desk checking.
This method is effective for correcting" obvious" coding errors but will not be effective in
detecting errors that arise due to incorrect understanding of requirements or incomplete
requirements.
WALKTHROUGH:
To present the documents both within and outside the software discipline in order to
gather the information regarding the topic under documentation.
To explain or do the knowledge transfer and evaluate the contents of the document
To achieve a common understanding and to gather feedback.
To examine and discuss the validity of the proposed solutions
TECHNICAL REVIEW:
28
28
To ensure that an early stage the technical concepts are used correctly
To access the value of technical concepts and alternatives in the product
To have consistency in the use and representation of technical concepts
To inform participants about the technical content of the document
INSPECTION:
It helps the author to improve the quality of the document under inspection
It removes defects efficiently and as early as possible
It improve product quality
It create common understanding by exchanging information
It learn from defects found and prevent the occurrence of similar defects
29
29
4. Identifying potential software quality issues before the code moves to production.
STRUCTURAL TESTING
The structural testing is the testing of the structure of the system or component.
t u tu al testi g is ofte efe ed to as hite o o glass o o lea - o testi g
e ause i st u tu al testi g e a e i te ested i
hat is happe i g i side the
s ste /appli atio .
In structural testing the testers are required to have the knowledge of the internal
implementations of the code. Here the testers require knowledge of how the software is
implemented, how it works.
During structural testing the tester is concentrating on how the software does it. For
example, a structural technique wants to know how loops in the software are working.
Different test cases may be derived to exercise the loop once, twice, and many times.
This may be done regardless of the functionality of the software.
Structural testing can be used at all levels of testing. Developers use structural testing in
component testing and component integration testing, especially where there is good
tool support for code coverage. Structural testing is also used in system and acceptance
testing, but the structures are different. For example, the coverage of menu options or
major business transactions could be the structural element in system or acceptance
testing.
Expensive as one has to spend both time and money to perform white box testing.
Every possibility that few lines of code is missed accidentally.
In-depth knowledge about the programming language is necessary to perform white
box testing.
30
30
Issues are found at early stage. Since unit testing are carried out by developers where they
test their individual code before the integration. Hence the issues can be found very early
and can be resolved then and there without impacting the other piece of codes.
Unit testing helps in maintaining and changing the code. This is possible by making the
codes less interdependent so that unit testing can be executed. Hence chances of impact
of changes to any other code get reduced.
Since the bugs are found early in unit testing hence it also helps in reducing the cost of
bug fixes. Just imagine the cost of bug found during the later stages of development like
during system testing or during acceptance testing.
Unit testing helps in simplifying the debugging process. If suppose a test fails then only
latest changes made in code needs to be debugged.
31
31