UNIT 1 Software Testing
UNIT 1 Software Testing
Software
Software is a set of instructions, data or programs used to operate computers and
execute specific tasks. It is the opposite of hardware, which describes the physical
aspects of a computer. Software is a generic term used to refer to applications, scripts and
programs that run on a device. It can be thought of as the variable part of a computer,
while hardware is the invariable part
TYPES OF SOFTWARE:
Software Development life cycle:
In the below table, we have listed some of the important difference between the Software
Development Life Cycle and Software Testing Life Cycle:
2. Representation SDLC stands for Software STLC stands for Software Testing
Development Life Cycle. Life cycle.
3. Resources While performing the SDLC process, The STLC process needed a smaller
we needed a greater number of number of testers to complete the
developers to complete the testing process.
development process.
4. Focuses on Besides the development phase, other The STLC concentrate only on testing
phases like testing are also included. the software.
5. Objective The objective of the Software The objective of the Software testing
development life cycle is to complete life cycle is to complete the testing of
the development of software software successfully.
successfully.
6. Help in The SDLC will help us to develop a The STLC will helps to create the
good quality software product. software bug-free.
7. Different phases The various phase includes in Software The various phase includes
Development Life Cycle are as in Software Testing Life Cycle are as
follows: follows:
10. Coding phase In the SDLC coding phase, the In STLC, the QA team writes the test
developer will start writing the code as scenarios to authenticate the quality of
per the designed document and the product.
beginning of building the software.
11. Environment Set After writing the code, the Based on the prerequisites, the Test
up development team sets up a test team confirms the environment set up.
environment with the developed And do one round of smoke testing to
product to validate the code. ensure that the environment is stable
for the product and ready for testing.
12. Testing Phase Once the environment has been set, the Based on the test cases, the tester will
test engineer will perform various types do one round of integration and system
of testing, such as Unit, Integration, testing.
System, Retesting, Regression testing, While performing the testing, if they
and so on. encounter with any bugs, it will be
And the development team is also reported and fixed after the retesting.
involving to fixing the bugs and report
back to the tester.
13. Deployment/ In the SDLC deployment phase, when In STLC, the Smoke and sanity
Product Release we received sign-off from various testing are performed in the
phase testing teams, the application is production environment as soon as the
deployed or installed in a production product is deployed.
environment for real end-users. And the testing team will prepare the
test reports and matrix to analyze the
product.
14. Maintenance Once the product has been deployed, To check maintenance code deployed,
Phase the development team includes support the QA team performs the regression
and release updates. suites.
15. Performed The SDLC phases are done before the The STLC phases are completed after
STLC phases. SDLC phases.
Selenium
Selenium is one of the most widely used open source Web UI (User Interface) automation
testing suite.
It was originally developed by Jason Huggins in 2004 as an internal tool at Thought Works.
Selenium supports automation across different browsers, platforms and programming
languages.
Selenium can be easily deployed on platforms such as Windows, Linux, Solaris and
Macintosh. Moreover, it supports OS (Operating System) for mobile applications like iOS,
windows mobile and android.
Selenium supports a variety of programming languages through the use of drivers specific to
each language.Languages supported by Selenium include C#, Java, Perl, PHP, Python and
Ruby.Currently, Selenium Web driver is most popular with Java and C#.
Selenium test scripts can be coded in any of the supported programming languages and can
be run directly in most modern web browsers. Browsers supported by Selenium include
Internet Explorer, Mozilla Firefox, Google Chrome and Safari.
Selenium can be used to automate functional tests and can be integrated with automation test
tools such as Maven, Jenkins, & Docker to achieve continuous testing.
It can also be integrated with tools such as TestNG, & JUnit for managing test cases and
generating reports.
It allows testers to export recorded scripts in many languages like HTML, Java,
Ruby, RSpec, Python, C#, JUnit and TestNG. You can use these exported
script in Selenium RC or Webdriver.
>Selenium IDE has limited scope and the generated test scripts are not very
robust and portable.
Selenium RC had been considered quite effective for testing complex AJAX-based web user
interfaces under a Continuous Integration System.
3. Selenium WebDriver
Selenium WebDriver (Selenium 2) is the successor to Selenium RC and is by far the most
important component of Selenium Suite.
Test scripts are written in order to identify web elements on web pages and then desired
actions are performed on those elements.
RC on the other hand needs an RC server to interact with the web browser.
4. Selenium Grid
Selenium Grid is also an important component of Selenium Suite which allows us to run our
tests on different machines against different browsers in parallel.
In simple words, we can run our tests simultaneously on different machines running different
browsers and operating systems.
Selenium Grid follows the Hub-Node Architecture to achieve parallel execution of test
scripts.
The Hub is considered as master of the network and the other will be the nodes.
Hub controls the execution of test scripts on various nodes of the network.
Automation Testing
Software is the medium or platform for performing a task in the system.
Software testing is not a one-time process, as the developer test the software until it is declared
error-free. It checks whether the software is showing the expected output per input.
Every project or software goes through a testing procedure, and the type of testing method
depends on various factors like the budget, expertise, suitability, requirement and timeline of
the project.
When the tester writes the testing script manually and tests the software until it functions
properly known as manual testing & when this manual testing process becomes automatic, it
can be defined as automatic testing.
Every project or software goes through a testing procedure, and the type of testing method
depends on various factors like the budget, expertise, suitability, requirement and timeline of
the project.
When the tester writes the testing script manually and tests the software until it functions
properly known as manual testing & when this manual testing process becomes automatic, it
can be defined as automatic testing.
The framework used in automation software testing
o Linear Framework
One of the simplest frameworks that act as a record and playback model. In this tester write the
simple code to run the test cases without sequential steps and modularity
The data-driven automation framework can perform both negative and positive test cases. All the
test case data inputs are stored in the extension files and tables from where values are read during
the execution of test scripts.
A modular automation framework is best suited to run large test scripts as it divides the test scripts
into independent modules that hierarchically interact with each other. These small independent
modules are tested easily because it's easy to create required test scenarios.
In this framework, the tester doesn't need to write the code repeatedly because an object for the UI
element is created that can be recalled later for testing. This feature of the POM framework results
in less code usability and verbosity and reduces time consumption in writing test scripts.
In KDF, the keywords are separated for a common set of functions and instructions, due to which
automation speeds up. In this scripting technique, keywords are associated with actions like closing
and opening a browser, mouse-click events, and others. During testing, all the keywords are recalled
to perform specific steps, and these keywords are maintained in a file along with the actions they
perform.
We have various types of automation testing tools available in the market. Some of the most
commonly used automation testing tools are as follows:
o Selenium
o Watir
o QTP
o Telerik Studio
o Testim
o Applitools
Selenium
It is an open-source and most commonly used tool in automation testing. This tool is used to test
web-based applications with the help of test scripts, and these scripts can be written in any
programming language such as java, python, C#, Php, and so on.
Features of Selenium
This tool is most popular because of its various features. Following are standard features of
Selenium:
o Selenium does not support a stand-alone application, which means that the application is not opened
in the browser or URL like Notepad, MS-Word, Calculator, etc.
o Selenium web driver is the latest tool in the selenium community that removes all the drawbacks of
the previous tool (selenium-IDE).
o Selenium web-driver is powerful because it supports multiple programming languages, various
browsers, and different operating systems and also supports mobile applications like iPhone,
Android.
Watir
Watir stands for web application testing in ruby which is written in the Ruby programming
language. testing in ruby. It is a web application testing tool, which is open-source and supports
cross-browser testing tool and interacts with a platform like a human that can validate the text, click
on the links and fill out the forms.
Features of Watir
o We can take the screenshots once we are done with the testing, which helps us to keep track of the
intermediate testing.
o This tool has some inbuilt libraries, which helps to check the alerts, browser windows, page-
performance, etc.
QTP
QTP tool is used to test functional regression test cases of the web-based application. QTP stands
for Quick Test Professional, and now it is known as Micro Focus UFT [Unified Functional
Testing]. This is very helpful for the new test engineer because they can understand this tool in a
few minutes. QTP is designed on the scripting language like VB script to automate the application.
Features of QTP
o QTP uses the scripting language to deploy the objects, and for analysis purposes, it provides test
reporting.
o Both technical and non-technical tester can use QTP.
o QTP supports multiple software development environments like Oracle, SAP, JAVA, etc.
o With the help of QTP, we can test both desktop and web-based applications.
o In this tool, we can perform BPT (Business process testing).
Subsequently, you can use the playback option to re-run the test cases.
Perhaps, creating test cases on Selenium IDE does not require any programming language
but when you get to use selenese commands like runScript, a little knowledge prior to
JavaScript would prove beneficial for you to understand the concepts more clearly.
However, you can download the latest version of Firefox through their official website
provided under the link given below.
1. Menu Bar
2. Tool Bar
3. Address Bar
4. Test Case Pane
5. Test Script Editor Box
6. Start/Stop Recording Button
7. Log, Reference Pane
1. Menu Bar
Menu bar is positioned at the top most portion of the Selenium IDE interface. The most commonly
used modules of menu bar include:
o ProjectName
It allows you to rename your entire project.
o OpenProject
It allows you to load any existing project from your personal drives.
o SaveProject
It allows you to save the entire project you are currently working on.
2. Tool Bar
The Tool bar contains modules for controlling the execution of your test cases. In addition, it gives
you a step feature for debugging you test cases. The most commonly used modules of Tool Bar
menu include:
o SpeedControlOption
It allows you to control the execution speed of your test cases.
o StepFeature
It allows you to "step" through a test case by running it one command at a time. Use for debugging
test cases.
o RunTests
It allows you to run the currently selected test. When only a single test is loaded "Run Test" button
and "Run all" button have the same effect.
o RunAll
It allows you to run the entire test suite when a test suite with multiple test cases is loaded.
3. Address Bar
This module provides you a dropdown menu that remembers all previous values for base URL. In
simple words, the base URL address bar remembers the previously visited websites so that the
navigation becomes easy later on.
Test Case Pane also includes features like Navigation panel which allow users to navigate between
test cases and test suites.
Record button records all of the user actions with the browser.
The Log Pane displays the runtime messages during execution. It provides real-time updates of the
actions performed by the IDE. It can be categorized into four types: info, error, debug and warn.
The reference Pane displays the complete detail of the currently selected selenese command in the
editor.
Bugs
A malfunction in the software/system is an error that may cause components or the
system to fail to perform its required functions.
In other words, if an error is encountered during the test it can cause malfunction.
For example, incorrect data description, statements, input data, design, etc.
1. Lack of Communication
This is a key factor contributing to the development of software bug fixes.
Thus, a lack of clarity in communication can lead to misunderstandings of what
the software should or should not do.
In many cases, the customer may not fully understand how the product should
ultimately work. This is especially true if the software is designed for a completely
new product. Such situations often lead to many misinterpretations from both
sides.
2. Repeated Definitions Required
Constantly changing software requirements creates confusion and pressure in both
software development and testing teams.
Usually, adding a new feature or deleting an existing feature can be linked to other
modules or software components. Observing such problems causes software
interruptions.
3. Policy Framework Does Not Exist
Also, debugging a software component/software component may appear in a
different or similar component.
Lack of foresight can cause serious problems and increase the number of
distractions.
4. Performance Errors
Significant problems with software design and architecture can cause problems for
systems.
Improved software tends to make mistakes as programmers can also make
mistakes.
As a test tester, data/announcement reference errors, control flow errors, parameter
errors, input/output errors, etc.
5.Lots of Recycling
Resetting resources, redoing or discarding a finished work, changes in
hardware/software requirements may also affect the software.
Assigning a new developer to a project in the middle of nowhere can cause
software interruptions.
6.Coding side
Wrong coding
Missing coding
Extra coding
Basic terminology :
o Defect
o Bug
o Error
o Issue
o Mistakev
o Failurev
Defect When the application is not working as per the requirement. Test Engineer
Error Problem in code leads to the errors. Developer, Automation Test Engineer
Issue When the application is not meeting the business requirement. Customer
Some of the most commonly used bug tracking tools are as follows:
o Jira
o Bugzilla
o Redmine
o Mantis
o Backlog
Jira
Jira is one of the most important bug tracking tools. Jira is an open-source tool that is used for bug
tracking, project management, and issue tracking in manual testing.
Bugzilla
Bugzilla is an open-source tool, which is used to help the customer, and the client to maintain the
track of the bugs.
It is also used as a test management tool because, in this, we can easily link other test case
management tools such as ALM, quality Centre, etc.
Bugzilla supports various operating systems such as Windows, Linux, and Mac.
Bugzilla has some features which help us to report the bug easily:
Redmine
o Flexible role-based access control
o Time tracking functionality
o A flexible issue tracking system
o Feeds and email notification
o Multiple languages support (Albanian, Arabic, Dutch, English, Danish and so on)
MantisBT
MantisBT stands for Mantis Bug Tracker. It is a web-based bug tracking system, and it is also an
open-source tool.
o Full-text search
o Audit trails of changes made to issues
o Revision control system integration
o Revision control of text fields and notes
o Notifications
o Plug-ins
o Graphing of relationships between issues
Backlog
The backlog is widely used to manage the IT projects and track the bugs. It is mainly built for the
development team for reporting the bugs with the complete details of the issues, comments. Updates
and change of status. It is a project management software.
Cost of bugs
Bug is detected during the requirement definition and elaboration phase, the
cost to fix it is relatively low. It usually involves modifying the requirements
with little or no impact on other artefacts.
Types of Costs Associated with Software Bugs
1. Development Costs
2. Testing Costs
3. Operational Costs
Revenue Loss: Bugs in critical systems can lead to lost sales, reduced customer
transactions, and potential financial penalties.
Customer Compensation: Costs associated with compensating customers
affected by bugs, such as refunds, credits, or other forms of compensation.
6. Opportunity Costs
Delayed Releases: Time spent fixing bugs can delay product releases,
impacting the company’s ability to meet market demands and seize business
opportunities.
Innovation and Development: Resources diverted to bug fixing reduce the
capacity for new feature development and innovation.
Real-World Examples
1. Definition of a Component
o A component can be a software module, function, class, object, or any
other unit of code that performs a specific function or set of functions
within the system.
o It is often designed to be reusable, maintainable, and testable.
2. Component Testing
o Also known as unit testing or module testing, it involves verifying the
functionality, reliability, and performance of individual components.
o The goal is to ensure that each component behaves as expected in
isolation.
3. Integration Testing
o After individual components are tested, they are integrated to work
together.
o Integration testing ensures that the interactions between components are
correct and that they work together as intended.
4. Service Components
o Web services, APIs, or microservices that provide specific functionalities
or data to other parts of the system.
o These components are tested for correct functionality, performance,
security, and compliance with specifications.
5. Utility Components
o Helper functions, libraries, or utilities that perform common tasks, such
as logging, validation, or formatting.
o Tests ensure these utilities perform their tasks correctly and efficiently.
Water fall model
The waterfall model is a sequential approach, where each fundamental activity of a
process represented as a separate phase, arranged in linear order.
In the waterfall model, you must plan and schedule all of the activities before starting working
on them (plan-driven process).
Plan-driven process is a process where all the activities are planned first, and the progress is
measured against the plan. While the agile process, planning is incremental and it’s easier to
change the process to reflect requirement changes.
Requirements
Design
Implementation
Testing
Maintenance
In principle, the result of each phase is one or more documents that should be approved and the
next
phase shouldn’t be started until the previous phase has completely been finished.
For example, during design, problems with requirements can be identified, and during
coding, some of the design problems can be found, etc.
The software process therefore is not a simple linear but involves feedback from one phase
to another. So, documents produced in each phase may then have to be modified to reflect
the changes made.
Spiral Model
The spiral model is similar to the incremental model, with more emphasis placed on risk
analysis.
The spiral model has four phases: Planning, Risk Analysis, Engineering and Evaluation.
A software project repeatedly passes through these phases in iterations (called Spirals in this
model).
The baseline spiral, starting in the planning phase, requirements is gathered and risk is
assessed. Each subsequent spiral builds on the baseline spiral.
It is one of the software development models like Waterfall, Agile, V-Model.
Planning Phase: Requirements are gathered during the planning phase. Requirements like
‘BRS’ that is ‘Bussiness Requirement Specifications’ and ‘SRS’ that is ‘System Requirement
specifications’.
Risk Analysis: In the risk analysis phase, a process is undertaken to identify risk and alternate
solutions. A prototype is produced at the end of the risk analysis phase. If any risk is found
during the risk analysis then alternate solutions are suggested and implemented.
Engineering Phase: In this phase software is developed, along with testing at the end of the
phase. Hence in this phase the development and testing is done.
Evaluation phase: This phase allows the customer to evaluate the output of the project to date
before the project continues to the next spiral.
Advantages of Spiral model:
High amount of risk analysis hence, avoidance of Risk is enhanced.
Good for large and mission-critical projects.
Strong approval and documentation control.
Additional Functionality can be added at a later date.
Software is produced early in the software life cycle.
Software Prototyping
A prototype is a version of a system or part of the system that’s developed quickly to
check the customer’s requirements or feasibility of some design decisions.So, a prototype is
useful when a customer or developer is not sure of the requirements, or of algorithms, efficiency,
business rules, response time, etc.
1. Establish objectives: The objectives of the prototype should be made explicit from the start
of the process. Is it to validate system requirements, or demonstrate feasibility, etc.
2. Define prototype functionality: Decide what are the inputs and the expected output from a
prototype. To reduce the prototyping costs and accelerate the delivery schedule, you may
ignore some functionality, such as response time and memory utilization unless they are
relevant to the objective of the prototype.
3. Develop the prototype: The initial prototype is developed that includes only user interfaces.
4. Evaluate the prototype: Once the users are trained to use the prototype, they then discover
requirements errors. Using the feedback both the specifications and the prototype can be
improved. If changes are introduced, then a repeat of steps 3 and 4 may be needed.
Prototyping is not a standalone, complete development methodology, but rather an
approach to be used in the context of a full methodology (such as incremental, spiral, etc).
Incremental Delivery
Incremental development is based on the idea of developing an initial implementation,
exposing this to user feedback, and evolving it through several versions until an acceptable
system has been developed.The activities of a process are not separated but interleaved with
feedback involved across those activities.
Each system increment reflects a piece of the functionality that is needed by the
customer. Generally, the early increments of the system should include the most important
or most urgently required functionality.
This means that the customer can evaluate the system at early stage in the
development to see if it delivers what’s required. If not, then only the current increment
has to be changed and, possibly, new functionality defined for later increments.
Testing and turnover: Test new components and all the interfaces.
V-Model :
Scrum Master
Master is responsible for setting up the team, sprint meeting and removes
obstacles to progress .
Product owner
The Product Owner creates product backlog, prioritizes the backlog and is
responsible for the delivery of the functionality at each iteration
Scrum Team
Team manages its own work and organizes the work to complete the sprint or
cycle .
Product Backlog
This is a repository where requirements are tracked with details on the no of
requirements to be completed for each release. It should be maintained and
prioritized by product owner, and it should be distributed to the scrum team. Team
can also request for a new requirement addition or modification or deletion.
Regardless of which Agile methodology a team adopts, the benefits cannot be fully
realized without the commitment of everyone involved.
Testing Realities:
Testing realities refer to the practical aspects and challenges encountered in the
process of software testing. These realities are based on the experiences and
observations of testing professionals and highlight the complexities and
nuances involved in ensuring software quality. Here are some key testing
realities: