Se Unit - 3
Se Unit - 3
Software testing can be stated as the process of verifying and validating that a
software or application is bug free, meets the technical requirements as
guided by it’s design and development and meets the user requirements
effectively and efficiently with handling all the exceptional and boundary
cases.
The process of software testing aims not only at finding faults in the existing
software but also at finding measures to improve the software in terms of
efficiency, accuracy and usability. It mainly aims at measuring specification,
functionality and performance of a software program or application.
1.
Verification:it refers to the set of tasks that ensure that software correctly
implements a specific function.
2.
Validation:it refers to a different set of tasks that ensure that the software
that has been built is traceable to customer requirements.
Validation:
“Are we building the right product?”
What are different types of software testing?
1.
Manual Testing:Manual testing includes testing a software manually, i.e.,
without using any automated tool or any script. In this type, the tester takes
over the role of an end-user and tests the software to identify any unexpected
behavior or bug. There are different stages for manual testing such as unit
testing, integration testing, system testing, and user acceptance testing.
Testers use test plans, test cases, or test scenarios to test a software to
ensure the completeness of testing. Manual testing also includes exploratory
testing, as testers explore the software to identify errors in it.
2.
Automation Testing:Automation testing, which is also known as Test
Automation, is when the tester writes scripts and uses another software to test
the product. This process involves automation of a manual process.
Automation Testing is used to re-run the test scenarios that were performed
manually, quickly, and repeatedly.
Apart from regression testing, automation testing is also used to test the
application from load, performance, and stress point of view. It increases the
test coverage, improves accuracy, and saves time and money in comparison
to manual testing.
2.
White-Box Testing:The technique of testing in which the tester is aware of
the internal workings of the product, has access to it’s source code and is
conducted by making sure that all internal operations are performed according
to the specifications is known as white box testing.white box testing which is
also known as glass box testing, structural testing, clear box testing, open box
● This testing is more thorough than other testing approaches as it covers all
code paths.
programming applications.
THis can only be done by trial and Data domains and internal boundaries
error method. can be better tested.
GreyBox Testing
Gray Box testing is a software testing method to test the software application with
cases as white box testing and testing practices are done at functionality level as
systems. For example; while testing, if the tester encounters any defect then he
makes changes in code to resolve the defect and then tests it again in real time. It
concentrates on all the layers of any complex software system to increase testing
coverage. It gives the ability to test both the presentation layer as well as internal
1.
Unit Testing:A level of the software testing process where individual
units/components of a software/system are tested. The purpose is to validate
that each unit of the software performs as designed.
2.
Integration Testing:A level of the software testing process where
individual units are combined and tested as a group. The purpose of this level
of testing is to expose faults in the interaction between integrated units.
3.
System Testing:A level of the software testing process where a complete,
integrated system/software is tested. The purpose of this test is to evaluate
the system’s compliance with the specified requirements.
4.
Acceptance Testing:A level of the software testing process where a
system is tested for acceptability. The purpose of this test is to evaluate the
system’s compliance with the business requirements and assess whether it is
acceptable for delivery.
Testing is the process of executing a program with the aim of finding errors.
To make our software perform well it should be error-free. If testing is done
successfully it will remove all the errors from the software.
Principles of Testing:-
(v) It follows the Pareto rule(80/20 rule) which states that 80% of errors come
from 20% of program components.
(vi) Start testing with small parts and extend it to large parts.
Types of Testing:-
1. Unit Testing:
It focuses on the smallest unit of software design. In this, we
test an individual unit or group of interrelated units. It is often done by the
programmer by using sample input and observing its corresponding outputs.
Example:
c) Incorrect initialization
2. Integration Testing
The objective is to take unit tested components and build a program structure
that has been dictated by design. Integration testing is testing in which a group
of components is combined to produce output.
Integration testing is of four types: (i) Top-down (ii) Bottom-up (iii) Sandwich
(iv) Big-Bang
Example
3. Regression Testing
Every time a new module is added leads to changes in the program. This type
of testing makes sure that the whole component works properly even after
adding components to the complete program.
Example
4. Smoke Testing
This test is done to make sure that software under testing is ready or stable
for further testing
It is called a smoke test as the testing of an initial pass is done to check if it
did not catch the fire or smoke in the initial switch on.
Example:
5. Alpha Testing
Example:
the organization
6. Beta Testing
The beta test is conducted at one or more customer sites by the end-user of
the software. This version is released for a limited number of users for testing
in a real-time environment
Example:
number of people
7. System Testing
This software is tested such that it works fine for the different operating
systems. It is covered under the black box testing technique. In this, we just
focus on the required input and output without focusing on internal working.
Example:
testing
8. Stress Testing
In this, we give unfavorable conditions to the system and check how they
perform in those conditions.
Example:
9. Performance Testing
Example:
● Testing of Requirements,
● Design and Analysis of Testing,
● Testing of Code,
● Integration testing,
● System testing,
● User Testing.
Next →← Prev
Test Case
The test case is defined as a group of conditions under which a tester determines
not. Test case designing includes preconditions, case name, input conditions, and
expected result. A test case is a first level action and derived from test scenarios.
negative) and the navigation steps, which are used for the test execution process.
Writing of test cases is a one-time attempt that can be used in the future at the
Test case gives detailed information about testing strategy, testing process,
preconditions, and expected output. These are executed during the testing process
to check whether the software application is performing the task for that it was
developed or not.
Test case helps the tester in defect reporting by linking defect with test case ID.
Detailed test case documentation works as a full proof guard for the testing team
because if developer missed something, then it can be caught during execution of
To write the test case, we must have the requirements to derive the inputs, and
the test scenarios must be written so that we do not miss out on any features for
testing. Then we should have the test case template to maintain the uniformity, or
every test engineer follows the same approach to prepare the test document.
Generally, we will write the test case whenever the developer is busy in writing the
code.
● When the customer gives the business needs then, the developer starts
developing and says that they need 3.5 months to build this product.
● And In the meantime, the testing team will start writing the test cases.
● Once it is done, it will send it to the Test Lead for the review process.
● And when the developers finish developing the product, it is handed over to
● The test engineers never look at the requirement while testing the product
document because testing is constant and does not depends on the mood of
Note: When writing the test case, the actual result should never be written as the
product is still being in the development process. That?s why the actual result should
To require consistency in the test case execution: we will see the test case
To make sure a better test coverage: for this, we should cover all possible
scenarios and document it, so that we need not remember all the scenarios again
and again.
tested an application during the first release, second release, and left the company
at the time of third release. As the test engineer understood a module and tested
the application thoroughly by deriving many values. If the person is not there for
the third release, it becomes difficult for the new person. Hence all the derived
To avoid giving training for every new test engineer on the product: When
the test engineer leaves, he/she leaves with a lot of knowledge and scenarios.
Those scenarios should be documented so that the new test engineer can test with
the given scenarios and also can write the new scenarios.
What is Mutation Testing?
Mutation testing is a structural testing technique, which uses the structure of the
code to guide the testing process. On a very high level, it is the process of rewriting
the source code in small ways in order to remove the redundancies in the source
code
These ambiguities might cause failures in the software if not fixed and can easily
pass through testing phase undetected.
Changed Code:
Decision Mutations:
In decisions mutations are logical or arithmetic operators are changed to
detect errors in the program.
Example:
Initial Code:
if(a < b)
c = 10;
else
c = 20;
Changed Code:
if(a > b)
c = 10;
else
2. c = 20;
Statement Mutations:
In statement mutations a statement is deleted or it is replaces by some other
statement.
Example:
Initial Code:
if(a < b)
c = 10;
else
c = 20;
Changed Code:
if(a < b)
d = 10;
else
3. d = 20;
Advantages of Mutation Testing:
● It brings a good level of error detection in the program.
● It discovers ambiguities in the source code.
A static code analysis often addresses code vulnerabilities and other code
weaknesses. It often uses data tracing tools that find many vulnerabilities that often
escape most human eyes.
● Automated tools- Static code analysis involves many automated tools that
help detect potential vulnerabilities in the source code.
○ Simple grep searches- Grep is a search utility that allows you to search
for specific terms. Grep style searches can help discover information
related to encryption, cryptography, SQL queries, URLs and sockets,
and file read and writes. While powerful, these simple grep searches
can lead to many false positives.
○ Tools with data flow analysis- Automated tools like PumaScan, Fortify
and Checkmarx actually trace data through the application and so it
can detect when untrusted data is used in a trusted manner, e.g., when
untrusted user input is sent to the browser unencoded (XSS
vulnerability) or inserted directly into a SQL query (SQL Injection). This
data flow analysis capability is essential for any serious assessment of
the security of an application.
● Static Code Review - A static code review is also known as white-box testing.
It includes checking the overall security of the application to identify potential
vulnerabilities and risks associated with it.
Static code analysis should be performed at all stages of the SDLC once the
development phase has begun. It should be incorporated into the SDLC before the
unit/component/integration testing phases begin.
In most cases, the static code analysis results are incorporated as a quality check
for code promotion in continuous integration (CI) and continuous delivery (CD)
pipelines.
Benefits
Static code analysis has plenty of benefits, and its ability to quickly discover
weaknesses in the code and to comply with security standards helps reduce
potential vulnerabilities.
What are some of the key benefits of using static code analysis?
Limitations
Despite its benefits, static code analysis has a few limitations that can impact your
software development lifecycle process.
One of the major limitations of static code analysis is that the use of automation
tools often gives a false assurance that everything is being validated. Often there are
a large number of business rules, standards, and expectations involved that
automated tools are not very efficient at analyzing in a code.
Dynamic Testing
Since the program can be run with multiple inputs, the scope of a dynamic
assessment can get quite large.
In addition to this, dynamic testing also helps identify security misconfiguration and
other common issues that might impact the overall security of the application.
Dynamic testing also includes manual test cases to detect vulnerabilities that are
otherwise not easily discovered by automated tools such as session management
issues, information leakage, authentication issues, access control, and more.
Benefits
Limitations
Although dynamic testing helps validate the reports by static code analysis, which
gives a better security assurance, there are still some limitations to dynamic testing.
Software Reliability
Software Reliability means Operational reliability. It is described as the ability of a
system or component to perform its required functions under static conditions for a
specific period.
Software reliability is also defined as the probability that a software system fulfills its
assigned task in a given environment for a predefined number of input cases,
assuming that the hardware and the input are free of error.
For example, large next-generation aircraft will have over 1 million source lines of
software on-board; next-generation air traffic control systems will contain between
one and two million lines; the upcoming International Space Station will have over
two million lines on-board and over 10 million lines of ground support software;
several significant life-critical defense systems will have over 5 million source lines
of software. While the complexity of software is inversely associated with software
reliability, it is directly related to other vital factors in software quality, especially
functionality, capability, etc.
Reliability Metrics
Reliability metrics are used to quantitatively express the reliability of the software
product. The option of which metric is to be used depends upon the type of system
to which it applies & the requirements of the application domain.
Some reliability metrics which can be used to quantify the reliability of the software
product are as follows:
1. Coutinho Model –
Coutinho adapted the Duane growth model to represent the software
testing process. Coutinho plotted the cumulative number of
deficiencies discovered and the number of correction actions made
vs the cumulative testing weeks on log-log paper. Let N(t) denote the
cumulative number of failures and let t be the total testing time. The
failure rate, (t), the model can be expressed as