Software Testing Tool
Software Testing Tool
SOFTWARE TESTING
TO O L S
For T.Y.B.Sc. Computer Science : Semester – VI
[Course Code CS 3610 : Credits – 2]
CBCS Pattern
As Per New Syllabus, Effective from June 2021
Price ` 130.00
N5952
SOFTWARE TESTING TOOLS ISBN 978-93-5451-301-5
First Edition : January 2022
© : Authors
The text of this publication, or any part thereof, should not be reproduced or transmitted in any form or stored in any
computer storage system or device for distribution including photocopy, recording, taping or information retrieval system or
reproduced on any disc, tape, perforated media or other information storage device etc., without the written permission of
Authors with whom the rights are reserved. Breach of this condition is liable for legal action.
Every effort has been made to avoid errors or omissions in this publication. In spite of this, errors may have crept in. Any
mistake, error or discrepancy so noted and shall be brought to our notice shall be taken care of in the next edition. It is notified
that neither the publisher nor the authors or seller shall be responsible for any damage or loss of action to any one, of any kind, in
any manner, therefrom. The reader must cross check all the facts and contents with original Government notification or
publications.
DISTRIBUTION CENTRES
PUNE
Nirali Prakashan Nirali Prakashan
(For orders outside Pune) (For orders within Pune)
S. No. 28/27, Dhayari Narhe Road, Near Asian College 119, Budhwar Peth, Jogeshwari Mandir Lane
Pune 411041, Maharashtra Pune 411002, Maharashtra
Tel : (020) 24690204; Mobile : 9657703143 Tel : (020) 2445 2044; Mobile : 9657703145
Email : [email protected] Email : [email protected]
MUMBAI
Nirali Prakashan
Rasdhara Co-op. Hsg. Society Ltd., 'D' Wing Ground Floor, 385 S.V.P. Road
Girgaum, Mumbai 400004, Maharashtra
Mobile : 7045821020, Tel : (022) 2385 6339 / 2386 9976
Email : [email protected]
DISTRIBUTION BRANCHES
DELHI BENGALURU NAGPUR
Nirali Prakashan Nirali Prakashan Nirali Prakashan
Room No. 2 Ground Floor Maitri Ground Floor, Jaya Apartments, Above Maratha Mandir, Shop No. 3,
4575/15 Omkar Tower, Agarwal Road No. 99, 6th Cross, 6th Main, First Floor, Rani Jhanshi Square,
Darya Ganj, New Delhi 110002 Malleswaram, Bengaluru 560003 Sitabuldi Nagpur 440012 (MAH)
Mobile : 9555778814/9818561840 Karnataka; Mob : 9686821074 Tel : (0712) 254 7129
Email : [email protected] Email : [email protected] Email : [email protected]
[email protected] | www.pragationline.com
Also find us on www.facebook.com/niralibooks
Preface …
We take an opportunity to present this Text Book on "Software Testing Tools" to the
students of Third Year B.Sc. (Computer Science) Semester-VI as per the New Syllabus,
June 2021.
The book has its own unique features. It brings out the subject in a very simple and lucid
manner for easy and comprehensive understanding of the basic concepts. The book covers
theory of Introduction to Test Case Design, Test Cases for Simple Programs, Test Cases and
Test Plan, Defect Report and Testing Tools.
A special word of thank to Shri. Dineshbhai Furia, and Mr. Jignesh Furia for
showing full faith in us to write this text book. We also thank to Mr. Amar Salunkhe and
Mrs. Prachi Sawant of M/s Nirali Prakashan for their excellent co-operation.
We also thank Mr. Ravindra Walodare, Mr. Sachin Shinde, Mr. Ashok Bodke, Mr. Moshin
Sayyed and Mr. Nitin Thorat.
Although every care has been taken to check mistakes and misprints, any errors,
omission and suggestions from teachers and students for the improvement of this text book
shall be most welcome.
Authors
Syllabus …
1. Introduction to Test Case Design (4 Lectures)
• How to Identify Errors, Bugs in the given Application.
• Design Entry and Exit Criteria for Test Case, Design Test Cases in Excel.
• Describe Feature of a Testing Method Used.
2. Test Cases for Simple Programs (4 Lectures)
• Write Simple Programs Make use of Loops and Control Structures.
• Write Test Cases for above Programs.
3. Test Cases and Test Plan (4 Lectures)
• Write Test Plan for given Application with Resources required.
• Write Test Case for given Application.
• Prepare Test Report for Test Cases Executed.
4. Defect Report (3 Lectures)
• Defect Life Cycle.
• Classification of Defect.
• Write Defect Report.
5. Testing Tools (3 Lectures)
• How to make use of Automation Tools.
• Types of Testing Tools.
Contents …
Introduction to Test
Case Design
Objectives…
To understand Test Case, Bug and Error
To learn Design of Test Cases
To study Design Entry and Exit Criteria of Test Cases
To Design of Test Cases in Excel
1.0 INTRODUCTION
• A test case describes input, action and an expected result, in order to determine the
functionality of a software application works correctly or not.
• A test case is a set of instructions on “how” to validate a particular test objective/target,
which, when followed will tell us if the expected behavior of the system is satisfied or
not.
• The purpose of a test case is to determine whether a software application is working as
per the customer's requirements or not.
• A test case is a set of conditions and variables prepared to verify the compliance of an
software application functionality against the specified requirements.
• A test case provides the description of inputs and their expected outputs to observe
whether the software or a part of the software is working correctly.
• Institute of Electrical and Electronics Engineers (IEEE) defines test case as, “a set of
input values, execution pre-conditions, expected results and execution post-conditions,
developed for a particular objective or test condition such as to exercise a particular
program path or to verify compliance with a specific requirement.”
• Generally, a test case is associated with details of identifier, name, purpose, required
inputs, test conditions and expected outputs.
• Software testing is the process of executing software or system with the intent of
finding/detecting errors. The tools used for software testing are known as software
testing tools.
1.1
Software Testing Tools Introduction to Test Case Design
• Test case designing includes preconditions, case name, input conditions, and expected
result. Software testing tools are the tools which are used for the testing of software.
• Software testing tools often ensure that software products are robust, comprehensive
and work according to requirements.
• A testing tool is a software product that enables software testers to define software
testing tasks.
• Using a test tool an organization achieves greater speed, reliability and efficiency in
their testing process.
• Testing tools support test activities such as requirements, planning, test execution,
automation and defect logging.
• Tools from a software testing context can be defined as, a product that supports one or
more test activities right from planning, requirements, creating a build, test execution,
defect logging and test analysis.
• Demand for delivering better quality software products faster makes organizations
search for test tools.
• Some popular software testing tools are JMeter, LoadRunner, Selenium, Appium,
TestProject, Katalon, CloudTest, TestComplete AppliTools and so on.
• An efficient test case design technique is necessary to improve the quality of the
software testing process. It helps to improve the overall quality and effectiveness of
the released software product.
• There are many ways to design test cases. The test case design techniques are shown
in Fig. 1.1.
Structure-based test case design techniques are based on the internal structure of
the software program and code. Developers go into minute details of the
developed code and test them one by one.
3. The test case design technique based on deriving test cases from the tester's
experience of similar systems and general experience of testing, known as
experience-based techniques.
Experienced-based techniques are highly dependent on tester’s experience to
understand the most important areas of the software. They are based on the skills,
knowledge, and expertise of the people involved.
• A bug is the alternative name of defects, which says that application or software isn't
functioning as in line with the requirement.
• When we have some coding error, program can have breakdown or failure in
execution, which is known as a bug.
• When the application is not working as per the requirement, it is knows as defects. It
is specified as the deviation from the actual and expected result of the application or
software.
• The Bug is the informal name of defects, which means that software or application is
not working as per the requirement.
to the “draft” page instead of “inbox”, this is happening because of the wrong
coding which is done by the developer, hence it is a bug.
2. Missing Coding: Here, missing coding means, we can say that the developer won't
have developed the code only for that specific part of software. For an instance
assume that if we take the above example and open the "inbox" link, we see that it
is not there, this means that the feature is not developed or its coding is not done.
3. Extra Coding: Extra coding means that the developers add some extra features in
the system which is not needed as per the requirements given by client. For
example: Suppose we have one registration form wherein the Name field, the First
name, and Last name textbox are needed to develop according to the client's
requirement. But, here the developer write the code for "Middle name" textbox
also and create it, but actually as per clients requirements it is not required as we
can see in the Fig. 1.3.
If we develop an additional functionality in the software which is not needed in
the requirement, it leads to unnecessary added effort and it might also happen that
adding up that additional functionality will affects the other part of the software.
(a)
(b)
Fig. 1.3
• The defect/Bug tracking tool is used to monitor bug fixes and ensure the delivery of a
quality application.
• This tool can help us to find the bugs in the testing stage so that we can get the defect-
free data in the production server.
1.6
Software Testing Tools Introduction to Test Case Design
• With the help of these tools, the end-users can allow reporting the bugs and issues
directly on their applications.
• Test case tracking is another concept which considers to the spreadsheet or database
used to manage all the test cases in the test suites and how we track progress through
that listing.
• Bug tracking has to do with the process which is used to manage the bugs. Since this
systems form the principal communication channels inward to the own team, outward
to other teams such as development and upward to the management, we should define
all the things in the process well.
• We have various types of bug tracking tools available in software testing that helps us
to track the bug, which is related to the software or the application.
• Some of the most usually used bug tracking tools are as below:
1. 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. Jira comprises different features like recording, reporting, and workflow.
We can monitor all kinds of bugs and issues, related to the software and generated
by the test engineer using this tool Jira.
Features of Jira are as follows:
o It provides complete set of reporting of the bug tracking.
o It supports integration with development tools such as GitHub.
o It is a workflow-powered tool. Custom workflows can be created in Jira.
o It is used to manage the defects very effectively and searching is very easy.
1.7
Software Testing Tools Introduction to Test Case Design
2. Bugzilla: Bugzilla is another important bug tracking tool, which is most widely
used by many organizations to track the bugs. Bugzilla is an open source tool that
is used to assist the customer, and the client to keep the track of the bugs. It is also
used as a test management tool. Bugzilla supports several operating systems such
as Linux, Windows, Mac.
Features of Bugzilla are as follows:
o A bug can be list in multiple formats.
o Email notification controlled by user preferences.
o Advanced searching capabilities.
o Excellent security.
o Time tracking.
3. Redmine: It is an open-source tool which is used to track the issues and web-based
project management tool. Redmine tool is written in Ruby programming language
and also compatible with multiple databases like MySQL, Microsoft SQL, and
SQLite. While using the Redmine tool, users can also manage the various project
and related subprojects.
Some of the commonly known characteristics of Redmine tools are as follows:
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 etc.).
4. Mantis: MantisBT stands for Mantis Bug Tracker. Along with the open source tool,
it is also a web based bug tracking system. MantisBT is used to track the software
defects. It is executed in the PHP programming language.
Some of the commonly known characteristics of MantisBT tool are as follows:
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.
5. Backlog: The backlog is widely used to manage the IT projects and track the bugs.
It is primarily constructed for the development team for recording and reporting
the bugs/defects with whole information of the problems and comments, updates
and changes. It is a project management software tool.
1.8
Software Testing Tools Introduction to Test Case Design
• The entry criteria for a test are the requirements that need to be fulfilled before the
test can run. For example, if the main web page has a textbox to fill out, then part of
the entry criteria is filling out that textbox before clicking the Submit button.
• The exit criteria for a test case are a set of conditions based on which we can
determine that the test case execution is finished. For example, after clicking the
Submit button on the web page, if the web page navigates to the results page, then this
is the exit criteria.
• For example, suppose we need to test a program that takes a filename as input, opens
the file, writes today's date into the file and closes the file. We can define a test case as
follows:
o Test Input: filename "xyz.dat".
o Entry Criteria: The file xyz.dat should not exist in the current directory.
o Expected Output: The file xyz.dat should be in the current directory, with the
contents in today's date.
o Exit Criteria: The program should terminate without errors. The file xyz.dat
should be available in the current directory.
1.10
Software Testing Tools Introduction to Test Case Design
• We need to define a number of such test cases for testing all the specifications of the
software.
• Fig. 1.6 shows a number of such test cases are selected, the program is executed and
the results are compared with the estimated results.
The development teams have completed all features and bug fixes scheduled
for release.
The development teams have unit-tested all features and bug fixes scheduled
for release.
Less than 50 must-fix bugs (per Sales, Marketing, and Customer Service) are
open against the first test release scheduled, (50 being the number of bug
reports that can be effectively reviewed in a one-hour bug solving meeting.)
The development teams provide software to the test team three business days
prior to starting system test.
The test team completes a three-day “smoke test” and reports on the results to
the system test phase entry meeting.
The project management team agrees in a system test phase entry meeting to
proceed. The following topics will be resolved in the meeting:
Whether code is complete.
Whether unit-testing is complete.
Assign a target fix date for any known “must-fix" bugs (no later than one
week after system test Phase Entry).
1.3.3 Exit Criteria
• Exit criteria address the issue of how to determine when testing has been completed.
For example, one exit criterion can be - all the planned test cases and regression tests
have been run.
• Another might be that project management deems your results “OK,” by whatever
definition they use to decide such questions.
• In the case of system test exit criteria - provided system test is the last test phase on the
project - these exit criteria often become the criteria by which the customer-ship or
deployment decision is made.
o Example: An example of a business driven set of system test exit criteria for
SpeedyWriter is given below.
o System Test for SpeedyWriter will end when:
No changes (design/code/features), except to address system test defects,
occurred in the prior three weeks.
No panic, crash, halt, wedge, unexpected process termination, or other
stoppage of processing has occurred on any server software or hardware for
the previous three weeks.
No client systems have become inoperable due to a failed update during
System Test.
The test team has executed all the planned tests against the GA-candidate
software.
1.12
Software Testing Tools Introduction to Test Case Design
The development teams have resolved all "must-fix" bugs per Sales, Marketing,
and Customer Service.
The test team has checked that all issues in the bug tracking system are either
closed or deferred, and, where appropriate, verified by regression and
confirmation testing.
The test metrics indicate that we have achieved product stability and reliability
that we have completed all planned tests and the planned tests adequately
cover the critical quality risks.
The project management team agrees that the product, as defined during the
final cycle of system test, will satisfy the customer's reasonable expectations of
quality.
The project management team holds a system test phase exit meeting and
agrees that we have completed system test.
• A good test case template maintains test artifact consistency for the test team and
makes it easy for all stakeholders to understand the test cases.
• There are many different ways to document test cases. Myriad templates have been
developed and used by various test teams.
• The industry standard, IEEE 829 template outline is shown in Fig. 1.7.
• Various templates are available, choose suitable template for the kind of system you
are testing.
• Fig. 1.8 shows a basic test case template that can be used for either manual or
automated testing.
• It complies with the IEEE 829 standard for test documentation, assuming that each test
step includes the action to be taken, the associated data and the expected results. This
template may vary according to organization.
1.14
Software Testing Tools Introduction to Test Case Design
1.15
Software Testing Tools Introduction to Test Case Design
• Sometimes we can assign a priority to each test case. Prioritizing is most useful when
we need to determine how many times a given test should be run.
• Here, priority is assigned based on intuition, the opinions of the sales, marketing,
technical support, and development teams, coverage and quality risk analyses.
• Example for prioritizing is test coverage analysis, which allows us to allot the
uppermost priority to those test cases that cover the most important quality risks,
functions and requirements.
• The next entries in the header address resource requirements. For two of these
entries, here listing is row by row, the hardware and software needed to run the test.
• We might want to restrict these lists to the nonobvious. For example, if we are testing
a Windows based application and the standard test environment includes Microsoft
Windows Me, Microsoft Office XP, Norton Antivirus, and LapLink, we needn’t
duplicate that listing for every test case.
• The entries for duration and effort specify how long it will take to run the test, in clock
time and in person-hours, respectively.
• In creating these estimates, we have following two alternatives:
1. We can assume that the test passes.
2. We can make assumptions about the time impact of typical failures.
• The evaluation of person-hours shows the human resources needed to run the test. For
example, do we need two people to run the test, single in front of each terminal?
• In the final two entries of the header, the setup procedures and the teardown
procedures are specified.
• Sometimes there are none, but typically, two or three steps, such as installing or
uninstalling an application, are needed at the beginning and end of a test.
• For example, after completion of the test, sample files those were created during the
test needed to be deleted in order to return the system under test to its original state.
• A test case is fundamentally a sequence of actions, performed serially, in parallel, or in
some combination, that creates the desired test conditions.
• It might involve the use of special test data, either entered as part of running the test
step or prior to starting the test case.
• The test condition is associated with some expected result, which might be in an
output, a system state, the timing or sequencing result or some other observable
behavior.
• The template breaks down these actions into steps and sub-steps. Each step or sub-step
has a numeric identifier.
• Use of Dewey decimal–style notation for numeric identifier is useful in bug reports
and in discussions with testers.
1.16
Software Testing Tools Introduction to Test Case Design
• To the right of the list of steps are two columns that allow testers to record the results
of their testing.
• The tester ran the test step or sub-step and observed,
o the expected result,
o the whole expected result,
o nothing but the expected result.
• Following the execution of a test case, one of three statements will typically hold true
for each step:
o The test step or sub-step did not locate any bugs. The tester should record Pass in
the Result column.
o The tester ran the test step or sub-step, and the outcome was, to a greater or lesser
extent, unexpected.
o The test case was a success because the tester has identified some untoward
behavior that can now be reported in your bug tracking database.
• How to classify the test case? If the unanticipated result was something along the lines
of a CPU catching fire or a program crashing with a General Protection Fault or a
system lockup, the tester should enter Fail in the Result column.
• However, what if the unexpected result is immaterial to the correct operation of the
functionality under test? Development might see your team as unfair and alarmist if
the tester throws this test case into the “failure” bucket.
• It is important, however, to keep track of the test case that did find a new bug, testers
may not want to record it as a Pass.
• Entering Warn as a result is usually a good solution. A Warn entry can also cover some
of the gray areas between complete failure and indirect failure - for example, if the
functionality under test works correctly but causes an incorrectly spelled error
message to be displayed.
• The tester did not run the test step or sub-step.
o If running the step was impossible - for example, because the test was impeded by
a known bug in the system or by the lack of essential resources - the tester should
record Block in the Result column.
o If the tester chose not to run the test step or sub-step, it should be marked Skip. In
either case, the tester should explain this omission.
o If a test step is marked Fail or Warn, the tester should also indicate, in the Bug ID
column, the identifier for the bug report filed as a result of the observed failure. In
all, we need a facility for recording bugs, and that each bug report so logged needs
a unique identifier.
1.17
Software Testing Tools Introduction to Test Case Design
• At the bottom of the template is a summary section in which the tester indicates an
overall assessment of the test case.
• The Status entry should be marked Pass, Warn, or Fail, depending on the success, Lack
or Failure of the test case. (Remember, successful test cases find bugs.) The tester
might also record Block or Skip if applicable.
• Since test cases consist of multiple steps, it is identified that a hierarchical rule is
needed for assigning test case status based on test step status, such as, if any test step
or sub-step is in progress, then the entire test case is “IP.” Else, if any step or sub-step is
blocked, then the entire test case is “Block.” Else, if any step or sub-step failed, then the
entire case is “Fail.” Else, if any step or sub-step warned, then the entire case is
”Warn.” Else, if all steps pass, the entire case is “Pass.” Here, we don’t have a rule for
“Skip” because generally this decision is made at the test case level.
• The tester should next note the specific system configuration used for the test. In the
final part of the summary section, the tester should record his or her name or initials
(depending on the custom), the date on which the test case was completed, the actual
effort expended in terms of person-hours, and the duration. The latter three pieces of
information allow us to track progress and understand variances from the plan that
result from fast or slow test progress.
• Fig. 1.9 shows one more template for a test case in MS Excel.
4. Steps To Execute field contains the steps to be executed on the system being
tested to get the expected results. Steps should be understandable and correct.
They are written and executed according to a sequence.
5. Pre-conditions field must be fulfilled before the execution of the test case. Pre-
conditions should be satisfied before the test case execution starts. List all the pre-
conditions in order to execute this test case successfully.
6. Execution Steps field contains the steps to be performed on the system under test
to get the desired results. Steps must be defined clearly and must be accurate. They
are written and executed number wise.
7. Expected Result field contains the desired outputs from the execution steps
performed. Results should be clearly defined for every step. It specifies what the
specifications are and what we will get from a particular specification.
8. Actual Result field has the real/actual result after the performed execution steps
on the system under testing. If the result matches with the expected result then we
can write as expected.
9. Status field can state the test is Pass/Fail. If the result is showing according to the
expected result, the test mark as pass and if not get the output according to the
expected, result mark as fail. We can use color for status. Use the green color for
Pass and red color for Fail.
10. Comment field column is for additional information for e.g. if status is set to
“cannot be tested”, then tester can give the reason in this column.
• Other fields for a test case are explained below:
1. Test priority (Low/Medium/High) field is very useful during test execution.
2. Test Designed By gives the Name of the Tester.
3. Test Designed Date field gives the date when it was written.
4. Test Executed By field gives name of the Tester who executed this test. To be filled
only after test execution.
5. Test Execution Date field gives the date when the test was executed.
6. Test Title/Name field gives test case title. For example, verify the login page with a
valid username and password.
7. Test Summary/Description field describe the test objective in brief.
8. Post-condition field gives the state of the system after executing the test case.
9. Test Scenario field includes all the information about a test in the form of specific,
detailed objectives that will help a tester perform a test accurately. It will not,
however, include specific steps or sequences.
10. Test Data field includes all the information and data that a test collects throughout
the duration of the process. Use of test data as an input for the test case.
1.19
Software Testing Tools Introduction to Test Case Design
11. Confirmation field is the part of the process during which testers discuss and
review whether or not a test was a success or a failure, based on the results.
• Following is an example of test case design in MS-Excel for Login functionality in
Banking.
• Following is another example of test case in MS-Excel for Facebook login functionality
of the Web application:
1.20
Software Testing Tools Introduction to Test Case Design
PRACTICE QUESTIONS
Q. I Multiple Choice Questions:
1. Which is a process of executing a program or a system with the intent of
finding/detecting defects/errors/bugs)?
(a) Testing (b) Debugging
(c) scheduling (d) None of the mentioned
1.21
Software Testing Tools Introduction to Test Case Design
1.23
Software Testing Tools Introduction to Test Case Design
Answers
1. defects 2. Python 3. Wrong 4. PHP
5. Entry criteria 6. exit criteria 7. Duration and Effort 8. Skip
9. Status 10. Jira 11. design 12. testing
13. experience-based 14. tools 15. test case 16. Error
1.24
Software Testing Tools Introduction to Test Case Design
4. Define is error.
5. Define defect.
6. Define bug.
7. What is meant by missing coding?
8. What is extra coding?
9. What is wrong coding.
10. Define test case tracking?
11. Enlist any two features of Bugzilla tool.
12. List any two the characteristics of Redmine tool.
13. What is the purpose of Entry and Exit Criteria?
14. List out the characteristics of MantisBT tool. Any two.
15. What is test suite?
16. Enlist any two features of Backlog tool.
17. Which are different characteristics of BugNet tool?
18. List techniques for test case design.
19. “MS Excel is used for design a test case”. State true or false.
(B) Long Answer Questions:
1. What is test case? How to design it? Which techniques are used for designing a test
case?
2. What is software testing? Why it needed? Also explain its purpose.
3. What is test tool? What is its purpose? Also give name of popular testing tools.
4. Which are the different features to be considered while doing software testing,
explain it?
5. Draw and explain in short, IEEE 829 Test Case Specification Template outline.
6. Explain the various fields of a basic test case template in excel that can be used for
either manual or automated testing.
7. Explain Entry Criteria by giving an example.
8. Which are different bug tracking tools? Explain any two.
9. Elaborate Exit Criteria with an example.
10. How to identify errors, bugs in the given application.
11. How to design test cases in MS Excel? Describe with example.
1.26
CHAPTER
2
2.0 INTRODUCTION
• Testing is concerned with errors, faults, failures, and incidents. A test is the act of
exercising software with test cases.
• A test has two distinct goals namely, to find failures or to demonstrate correct
execution.
• A test case has an identity and is associated with program behavior. A test case also
has a set of inputs and a list of expected outputs.
• The essence of software testing is to determine a set of test cases for the item to be
tested.
• The main goal of test case design techniques is to test the functionalities and features
of software with the help of effective test cases.
• The test case design techniques are broadly classifies as:
1. Specification-based Test Case Design Techniques: The specification-based test
case design techniques are used to design test cases based on an analysis of the
description or model of the product without reference to its internal workings.
These techniques are also known as black-box test case design techniques.
These techniques leverage external description of software to test cases such as
Technical specifications, Designs, Client’s requirements and so on.
2. Structure-based Test Case Design Techniques: The structural test case design
techniques are used to design test cases based on an analysis of the internal
structure of the test item. These techniques are also known as white-box test case
2.1
Software Testing Tools Test Cases for Simple Programs
design techniques. Traditionally, the internal structure has been interpreted as the
structure of the code.
In these techniques the test cases are designed based on internal design such as
Software code, Internal structure, Design and so on.
3. Experience-based Techniques: Experience-based test case design techniques are
used to complement black-box and white- box techniques. In experience-based test
techniques, people's knowledge, skills and background are a prime contributor to
the test conditions, test cases and test data. The experience of both technical and
business people is required, as they bring different perspectives to the test analysis
and design process. Due to previous experience with similar systems, they may
have insights into what could go wrong, which is very useful for testing. Both
structural and behavioral insights are used to design experience-based tests.
All experience-based test case design techniques have the common characteristic
that they are based on human knowledge and experience. Test cases are therefore
derived in a less systematic way, but may be more effective. Experience-based test
case design techniques are highly dependent on tester’s experience, (Skills,
Knowledge, Expertise and so on).
• White-box testing is a way of testing the external functionality of the code by
examining and testing the program code that realizes the external functionality.
White-box testing is also known as clear box or glass box or open box testing.
• White-box testing takes into account the program code, code structure, and internal
design flow.
• A number of defects come about because of incorrect translation of requirements and
design into program code. Some other defects are created by programming errors.
• White-box testing is further has two types namely, Static testing and Structural testing.
1. Static testing is a type of testing which requires only the source code of the
product, not the binaries or executables.
2. Structural testing takes into account the code, code structure, internal design, and
how they are coded.
• White-box testing verifies the designs and codes involved in the development of a
software product.
• Code coverage is white-box testing because it requires us to have full access to the
code to view what parts of the software we pass through when we run the test and
what parts of the software fail.
• The primary purpose of code coverage testing is to ensure that the testing activity
covers as much code as possible.
• Code coverage testing is a technique that involves measuring the percentage of a
system's code that is being tested by a test suite.
• Coverage is measured based on the items tested within a selected structure, for
example the code statements, the decisions, the interfaces, the menu structure or any
other identified structural element.
• Structural testing examines source code and analyses what is present in the code.
Structural testing cannot expose errors of code omission but can estimate the test suite
adequacy in terms of code coverage, i.e., execution of components by the test suite or
its fault-finding ability.
• Code coverage includes creating tests to satisfy some criteria of code coverage (e.g., the
test designer can create tests to cause all statements in the program to be executed at
least once).
• Code coverage testing is determining how much code is being tested. It can be
calculated using the formula:
Number of lines of the code exercised
Code Coverage = Total number of lines of the code × 100
• Code coverage helps in determining how much code of the source is tested which
helps in accessing quality of test suite and analyzing how comprehensively a software
is verified.
• Actually simple code coverage refers to measure of the degree to which the source
code of the software code has been tested. This code coverage is considered as one of
the form of white-box testing.
• Code coverage testing is a dynamic white-box testing where testing is done by
executing the test and the tester has complete access to the code.
• The tester (he/she) is also aware of the parts of the software that have passed and the
parts that have failed.
• Code based testing involves detecting errors by following execution oriented methods,
is also known as white-box testing.
• Here, a tester is expected to know and understand the low level design and identify
the code-based approach and to apply the techniques in the code that is written.
• Commonly used code coverage testing techniques are Statement coverage testing,
Decision coverage testing, Branch coverage testing, Loop coverage testing and Path
coverage testing.
2.3
Software Testing Tools Test Cases for Simple Programs
In above program code, the computer executes line 3 if the condition is true, or moves
on to line 4 [the next line in sequence] if the condition is false.
• In a loop structure, the program uses while, do while or for loops. The codes inside
the block of loops are repeated again and again, till they reach to a condition from
where the loop has to terminate.
Example: Iteration structures are called loops. The most common loop is DO WHILE
loop and is given below:
1. X = 10
2. Count = 0
3. WHILE X < 20 DO
4. X=X+1
5. Count = Count + 1
6. END DO
As with the selection structures there is a decision. In above program code, the
condition that is tested at the decision is X < 20. If the condition is true the program
'enters the loop' by executing the code between DO and END DO. In this case the value
of X is increased by one and the value of Count is increased by one. When this is done
the program goes back to line 3 and repeats the test. If X < 20 is still true the program
'enters the loop' again. This continues as long as the condition is true. If the condition
is false the program goes directly to line 6 and then continues to the next sequential
instruction. In the program fragment above the loop will be executed five times before
the value of X reaches 20 and causes the loop to terminate. The value of Count will
then be 5.
• Statement coverage is used to calculate the total number of executed statements in the
source code out of total statements present in the source code.
• The formula for calculating statement coverage is given below:
Number of executed statements
Statement coverage = Total number of statements × 100
• Generally, in the internal source code, there is a wide variety of elements like
operators, methods, arrays, looping, control statements, exception handlers, etc.
• Some statements from code are executed and some may not be executed, depending
on the input given to the program.
• The aim of statement coverage technique is to cover all of the statements whose
execution is possible and path lines in the code.
Example 1:
Source Code Structure:
o Take input of two values like values for x and y.
o Find the sum of these two values.
2.6
Software Testing Tools Test Cases for Simple Programs
o If the sum is greater than 0, then print "This is the positive result."
o If the sum is less than 0, then print "This is the negative result."
Code for the given structure is: (C programming is considered here),
1. input (int x, int y) {
2. sum= x+y;
3. if (sum>0)
4. printf(This is positive result);
5. else
6. printf(This is negative result);
7. }
• Let us consider two different test case scenarios and find the percentage of statement
coverage for given source code.
Test Case 1:
If x = 6, y = 2
1. input (int x, int y){
2. int sum= x+y;
3. if (sum>0)
4. printf(This is positive result);
5. else
6. printf(This is negative result);
7. }
• In Test Case 1, it is observed that the value of sum will be 8 which is greater than 0 and
as per the condition result will be "This is a positive result."
• For calculating statement coverage, here total count of statements is 7 and count of
statements used in execution is 5.
• Total number of statements = 7.
• Number of executed statements = 5.
Number of executed statements
Statement coverage = Total number of statements × 100
Test Case 2:
If x = -4, y = -3
1. input (int x, int y){
2.7
Software Testing Tools Test Cases for Simple Programs
5. else
6. printf(“FAIL”);
7. }
In Test Case 1, it is observed that the value of Z will be 25 which is less than 50 and as per
the condition result will be "Fail".
For calculating statement coverage, here total count of statements is 7 and count of
statements used in execution is 6.
Total number of statements = 7.
Number of executed statements = 6
Number of executed statements
Statement coverage = Total number of statements × 100
Test Case 2:
If X = 100, Y = 75
1. input (int X, int Y){
2. int Z = ((X + Y) / 200 )* 100;
3. if (Z>50)
4. printf(“PASS”);
5. else
6. printf(“FAIL”);
7. }
In Test Case 2, it is observed that the value of Z will be 87.5 which is greater than 50
and as per the condition result will be "Pass".
For calculating statement coverage, here total count of statements is 7 and count of
statements used in execution is 5.
Total number of statements = 7.
Number of executed statements = 5.
Number of executed statements
Statement coverage = Total number of statements × 100
2.9
Software Testing Tools Test Cases for Simple Programs
• Decision coverage testing criteria requires sufficient test cases for each condition in a
program decision to take on all possible outcomes at least once.
• Decision coverage testing differs from branch coverage only when multiple conditions
must be evaluated to reach a decision.
• Multi-condition coverage requires sufficient test cases to exercise all possible
combinations of conditions in a program decision.
• The goal of decision coverage testing is to cover and validate all the accessible source
code by checking and ensuring that each branch of every possible decision point is
executed at least once.
• Whenever there is a possibility of two or more outcomes from the statements like do
while statement, if statement and case statement (control flow statements), it is
considered as decision point as outcome is either True or False from two possible
outcomes.
• Decision coverage covers all possible outcomes of each and every Boolean condition of
the code by using control flow graph or chart.
• Generally, a decision point has two decision values one is true, and another is false
that's why most of the times the total number of outcomes is two.
• The percentage of decision coverage can be found by dividing the number of exercised
outcome with the total number of outcomes and multiplied by 100.
Number of decision outcomes exercised
Decision coverage = Total number of decision outcomes × 100
Example 1: Consider the pseudo code to apply on decision coverage technique:
1. Test (int x)
2. { if(x>4)
3. x=x*3
4. print (x)
5. }
Test Case 1:
Value of x is 9 (x=9)
1. Test (int x=9)
2. { if (x>5)
3. x=x*3
4. print (x)
5. }
The outcome of this code is "True" if condition (x>5) is checked.
For the above example, following is flowchart or flowgraph when the value of x is 9.
2.11
Software Testing Tools Test Cases for Simple Programs
2.12
Software Testing Tools Test Cases for Simple Programs
1 9 27 50%
2 2 2 50%
Example 2: The below sample is for validating the age of the patient, and determining if
the person is a senior citizen or not.
Consider the pseudo code to apply on decision coverage technique:
1. Test_age (int x)
2. {
3. if(x>=60)
4. print (“Senior Citizen”);
5. else
6. print (“Not a Senior Citizen”);
7. }
Test Case 1:
Value of x is 76 (x=76)
1. Test (int x=76)
2. {
3. if (x>=60)
4. print (“Senior Citizen”);
5. else
6. print (“Not a Senior Citizen”);
7. }
The outcome of this code is "True" with message “Senior Citizen” if condition (x>=60) is
checked and results in success.
For the above example the following is the flowchart or flowgraph when the value of x
is 76.
2.13
Software Testing Tools Test Cases for Simple Programs
.
2.14
Software Testing Tools Test Cases for Simple Programs
In the above flow chart, control flow graph of code is depicted. In the first case
traversing through "Yes" decision, (for A=100 and B=10) the path is P1-Q2-R4-5-S6-T8
and the number of covered edges is 1, 2, 4, 5, 6 and 8 but edges 3 and 7 are not covered
in this path.
2.16
Software Testing Tools Test Cases for Simple Programs
To cover these edges, we have to traverse through "No" decision. In the case of "No"
decision, (for A=100 and B=10) the path is P1-Q3-5-S7, and the number of covered
edges is 1, 3, 5 and 7. So by traveling through these two paths, all branches have
covered.
o Path 1: P1-Q2-R4-5-S6-T8
o Path 2: P1-Q3-5-S7
o Branch Coverage (BC) = Number of paths = 2.
To calculate percentage branch coverage, one has to find out the minimum number of
paths which will ensure that all the edges are covered.
In this case there is no single path which will ensure coverage of all the edges at once.
The aim is to cover all possible true/false decisions.
The formula for finding branch coverage percentage is given below:
Number of executed branches
Branch coverage = Total number of branches × 100
Covered Branches
(Conditional
Case Path Branch Coverage
+
Unconditional)
Yes 2, 3, 4 (from P1-Q2-R3-4S 60%
conditions)
No 5, 4 (from P1-Q5-4S 40%
condition)
2.18
Software Testing Tools Test Cases for Simple Programs
2.19
Software Testing Tools Test Cases for Simple Programs
2.21
Software Testing Tools Test Cases for Simple Programs
Example 1: In order to have loop coverage, testers should exercise the tests given as
follows:
o Test 1: Design a test in which loop body should not execute at all (i.e. zero
iteration).
o Test 2: Design a test in which loop control variable be negative (Negative number
of iterations).
o Test 3: Design a test in which loop iterates only once.
o Test 4: Design a test in which loop iterates twice.
o Test 5: Design a test in which loop iterates certain number of times, say n where n
< maximum number of iterations possible.
o Test 6: Design a test in which loop iterates one less than the maximum number of
iterations.
o Test 7: Design a test in which loop iterates the maximum number of iterations.
o Test 8: Design a test in which loop iterates one more than the maximum number
of iterations.
Consider the below Java code example which applies all the conditions specified:
public class SimpleTest
{
/* Compute total of positive numbers in the array names as numItems and
store it in total. For testing different count of array elements is
passed to find total*/
private int[] numbers = {5,-7,8,-1,4,1,-20,6,2,10};
public int calSum(int numItems)
{
int total = 0;
if (numItems<= 10)
{
for (int i=0; i<numItems; i = i + 1)
{
if (numbers[i] > 0)
{
total = total + numbers[i];
}
}
}
return total;
2.22
Software Testing Tools Test Cases for Simple Programs
}
}
public class TestPass
{
public void testmethod() throws Exception
{
SimpleTest s = new SimpleTest();
assertEquals(0, s.calSum(0)); //Test 1
assertEquals(0, s.calSum(-1)); //Test 2
assertEquals(5, s.calSum(1)); //Test 3
assertEquals(5, s.calSum(2)); //Test 4
assertEquals(17, s.calSum(5)); //Test 5
assertEquals(26, s.calSum(9)); //Test 6
assertEquals(36, s.calSum(10)); //Test 7
assertEquals(0, s.calSum(11)); //Test 8
}
}
So here in above code different type of test data is passed as input and loop is tested.
For loop testing use of software or automation can be more suitable as number of
iterations can be more and testing it manually is time consuming.
Example 2: Consider the below C code example to be tested, it displays first n numbers.
#include<stdio.h>
int main()
{
int i=1,n;
printf("Enter n:");
scanf("%d", &n);
while(i<=n)
{
printf("%d \n",i);
i++;
}
return 0;
}
2.23
Software Testing Tools Test Cases for Simple Programs
2.24
Software Testing Tools Test Cases for Simple Programs
Iteration:
1. while(a>b){
2. b=b*a;
3. b=b-1;}
4. c=b+d;
Path:
• A path through a program is a node and edge sequence from the starting node to a
terminal node of the control flow graph of a program.
• There can be more than one terminal node in a program.
• Writing test cases to cover all the paths of a typical program is impractical.
• For this reason, the path-coverage testing does not require coverage of all paths but
only coverage of linearly independent paths.
Linearly Independent Path:
• A linearly independent path is any path through the program that introduces at least
one new edge that is not included in any other linearly independent paths.
• If a path has one new node compared to all other linearly independent paths, then the
path is also linearly independent.
• This is because any path having a new node automatically implies that it has a new
edge.
• Thus, a path that is sub-path of another path is not considered to be a linearly
independent path. The path-coverage testing does not require coverage of all paths but
only coverage of linearly independent paths.
2.25
Software Testing Tools Test Cases for Simple Programs
• There are three paths in above flowgraph of Euclid's GCD algorithm. So, if we consider
each individual path from it then,
Path coverage = 1/3 × 100 = 33.33%.
• It is possible to have 100% branch coverage without 100% path coverage. All branch
edges are visited, without visiting all paths.
• It is possible to have 100% statement coverage without 100% branch coverage. If 100%
path coverage then there can be 100% branch coverage. If 100% branch coverage is
achieved the there can be 100% statement coverage.
PRACTICE QUESTIONS
Q. I Multiple Choice Questions:
1. Which is a document, has a set of test data, preconditions, expected results and
post-conditions?
(a) test plan (b) test case
(c) test strategy (d) None of the mentioned
2. The goals of test case design techniques is to,
(a) test the functionalities of software using effective test cases.
(b) test the features of software with the help of effective test cases.
(c) Both (a) and (b) (d) None of the mentioned
3. Experience-based testing techniques are highly dependent on tester’s,
(a) Skills (b) Knowledge
(c) Expertise (d) All of the mentioned
4. Which is a way of testing the external functionality of the code by examining and
testing the program code that realizes the external functionality?
(a) White-box testing (b) Black-box testing
(c) Both (a) and (b) (d) None of the mentioned
5. Which is a statistic in software testing that reflects how much testing a collection
of tests has performed?
(a) Test case (b) Test coverage
(c) Test report (d) Test template
2.27
Software Testing Tools Test Cases for Simple Programs
14. The Cyclomatic complexity in software testing is a testing metric used for
measuring the _______ of a software program.
(a) Robustness (b) Complexity
(c) Validity (d) None of the mentioned
15. Which testing involves designing and executing teat cases and finding out the
percentage (%) of the code that is covered by testing?
(a) Code coverage testing (b) Statement coverage testing
(c) Branch coverage testing (d) None of the mentioned
Answers
1. (b) 2. (c) 3. (d) 4. (a) 5. (b) 6. (b) 7. (d) 8. (c) 9. (b) 10. (a)
11. (c) 12. (b) 13. (d) 14. (b) 15. (a)
Q. II Fill in the Blanks:
1. _______ testing is also known as clear box, or glass box or open box testing.
2. _______ testing takes into account the code, code structure, internal design, and
how they are coded.
3. _______ coverage testing technique is used to cover all branches of the control flow
graph.
4. _______testing is coverage criteria which checks whether loop body executed zero
times, exactly once or more than once.
5. _______ coverage testing involves designing and executing test cases and finding
out the percentage of code that is covered by testing.
6. _______ coverage testing is used to calculate the total number of executed
statements in the source code out of total statements present in the source code.
7. _______ coverage covers all possible outcomes of each and every Boolean condition
of the code by using control flow graph or chart.
8. Testing applied on a _______ loop is recognized as concatenated loop testing.
9. In software development a number of defects come about because of _______
translation of requirements and design into program code.
10. A _______ independent path is any path through the program that introduces at
least one new edge that is not included in any other linearly independent paths.
11. Path coverage ensures that every path is traversed at least _______.
12. _______ complexity is a metric that quantifies the complexity of a program.
Answers
1. White-box 2. structural 3. Branch 4. Loop
5. Code 6. Statement 7. Decision 8. concatenated
9. incorrect 10. linearly 11. once 12. Cyclomatic
2.29
Software Testing Tools Test Cases for Simple Programs
Answers
1. (T) 2. (T) 3. (F) 4. (F) 5. (T) 6. (F) 7. (T) 8. (T) 9. (F) 10. (T)
11. (T) 12. (F)
while (i < 6)
{
System.out.println("Hello World");
// update expression
i++;
}
}
}
10. Apply decision coverage testing for the following code by considering some test
cases:
example (int x)
{
if (x < 20)
print("x < 20")
else
print("x >= 20")
}
11. Apply branch coverage testing for the following code:
READ username
READ password
IF count (username) < 8
PRINT “Enter a valid username.”
ENDIF
IF count (Password) < 5
PRINT “Enter a valid password”
ENDIF
IF count(username & password) < 1
PRINT “Please Fill the Username & Password Fields”
ENDIF
ELSE
PRINT “Login Successfully”
2.32
CHAPTER 3
3.0 INTRODUCTION
• A test case in software testing is a document, which has a set of test data,
preconditions, expected results and post-conditions, developed for a particular test
scenario in order to verify compliance against a specific requirement.
• Test planning, the most important activity to ensure that there is initially a list of tasks
and milestones in a baseline plan to track the progress of the project. Test planning
also defines the size of the test effort.
• IEEE standard for software test documentation defines test planning as, “a document
describing the scope, approach, resources and schedule of intended testing activities”.
• Test planning involves scheduling and estimating the system testing process,
establishing process standards and describing the tests that should be carried out.
• The main purpose of test planning is to show whether software works correctly as per
requirements.
• The goal of test planning is to take into account the important issues of testing strategy,
resource utilization, responsibilities, risk and priorities.
• A test plan is a document that outlines the test strategy, objectives, timetable,
estimation, deliverables, and resources needed to accomplish software testing.
• The test plan assists us in determining the amount of work required to confirm the
quality of the application being tested.
• The test plan is a blueprint for conducting software testing operations as a defined
procedure, which the test manager closely monitors and controls.
• A test plan is a document detailing the scope, strategy, resources and timetable of
expected test activities.
3.1
Software Testing Tools Test Cases and Test Plan
1. Product Analysis.
2. Designing Test Strategy.
3. Defining Objectives.
4. Establish Test Criteria.
5. Planning Resource Allocation.
6. Planning Setup of Test Environment.
7. Determine Test Schedule and Estimation.
8. Establish Test Deliverables.
Fig. 3.1: Creation of Test Plan
• Let us see steps in writing test plan in detail:
1. Analyze the Product or Feature to be Tested: Before we can start creating a test
plan, we need to have a deep understanding of the product or feature. For example,
let’s say we have just gone through a website redesign and want to test it before
launch. What information do we need?
To understand the scope, objectives, and functionality of product, talk with the
designer and developer
o Review the project documentation, (such as the Scope Of Work (SOW), project
proposal or even the tasks in your project management tool).
o Perform a product walkthrough to understand the functionality, user flow and
limitations.
3.2
Software Testing Tools Test Cases and Test Plan
2. Designing Test Strategy: Test manager develops the Test Strategy document
which defines the following:
o Project objectives and how to achieve them.
o The amount of effort and cost required for testing.
More specifically, the document must detail out:
o Scope of Testing: Contains the software components (hardware, software,
middleware) to be tested and also those that will not be tested.
o Type of Testing: Describes the types of tests to be used in the project. This is
necessary since each test identifies specific types of bugs.
o Risks and Issues: Describes all possible risks that may occur during testing –
tight deadlines, insufficient management, inadequate or erroneous budget
estimate – as well as the effect of these risks on the product or business.
o Test Logistics: Mentions the names of testers (or their skills) as well as the
tests to be run by them. This section also includes the schedule laid out for
testing and required tools.
3. Defining Objectives: In this step, we define the goals and expected results of test
execution. Since all testing intends to identify maximum defects in an application.
Test objective is the overall goal and achievement of the test execution. The objects
must include:
o A list of all software features – functionality, GUI, performance standards- that
must be tested.
o The ideal result or benchmark for every aspect of the software that needs
testing. This is the standard to which all actual results will be compared with
expected results.
4. Establish Test Criteria: Test criteria denote to standards or rules governing all
activities in a testing project. The two main test criteria are:
o Suspension Criteria: Defines the benchmarks for suspending all tests. For
example, if QA team members find that 50% of all test cases have failed, then
all testing is suspended until the developers resolve all of the bugs that have
been identified so far.
o Exit Criteria: Defines the benchmarks that signify the successful completion of
a test phase or project. The exit criteria are the expected results of tests and
must be met before moving on to the next stage of development. For example,
80% of all test cases must be marked successful before a particular feature or
portion of the software can be considered suitable for public use.
5. Planning Resource Allocation: Resource planning includes all types of resources
required to complete project. This step creates a detailed breakdown of all
required resources for project completion. Resources include human effort,
3.3
Software Testing Tools Test Cases and Test Plan
• A test plan identifies the items to be tested, items not be tested, who will do the testing,
the test approach followed, what will be the pass/fail criteria, training needs for the
testing team,
• A test plan can be defined as, a detailed document that describes the scope, approach,
schedule, resources etc., of intended software product testing activities.
• Fig. 3.2 shows typical test plan template used in software testing.
o Test Plan Identifier
o Introduction
Purpose
Objectives and Tasks
o Scope
o Test Strategy
o Test Items
o Features to be tested What?
o Features not be tested
o Approach
o Item pass / Fail criteria
o Suspension Criteria and Resumption Criteria How?
o Test deliverables
o Testing tasks
o Environmental needs
o Responsibilities Who?
o Staff and Training Needs
o Schedule When?
o Risks and Contingencies
o Approvals
o Summary
Fig. 3.2: Test Plan Template
• Test plan format/template has following fields:
1. Test Plan Identifier: Uniquely identifies the test plan and may include
version/release number of the document.
2. Introduction: A brief introduction about the project and to the document.
3. Purpose: It defines the purpose of the test plan.
4. Objectives and Tasks: Objectives describes the objectives of test plan like goal of
project, resource factors, project scheduling constraints, quality and cost factors.
Tasks list all tasks identified by the test plan like problem reporting, post-testing
etc.
3.5
Software Testing Tools Test Cases and Test Plan
• For the test execution, test case acts as the starting point, and after applying a set of
input values, the application has a definitive outcome and leaves the system at some
end point which is also known as execution post-condition.
• Test cases help guide the tester through a sequence of steps to validate whether a
software application is free of bugs, and working as required by the end user.
• The components of a test case are a particular test case format, usually, comprises of
following parameters:
Parameter Description
Test Case ID Each test case should be represented by a unique ID. It’s good
practice to follow some naming convention for better
understanding and discrimination purposes.
Test Case Pick test cases properly from the test scenarios.
Description
Pre-conditions Conditions that need to meet before executing the test case.
Mention if any preconditions are available.
Test Steps To execute test cases, you need to perform some actions. So write
proper test steps. Mention all the test steps in detail and in the
order how it could be executed from the end-user’s perspective.
Test Data You need proper test data to execute the test steps. So gather
appropriate test data. The data which could be used an input for
the test cases.
Expected Result The result which we expect once the test cases were executed. It
might be anything such as Home Page, Relevant screen, Error
message, etc.,
Post-Conditions Conditions that need to achieve when the test case was successfully
executed.
Actual Result The result which system shows once the test case was executed.
Capture the result after the execution. Based on this result and the
expected result, we set the status of the test case.
Status Finally set the status as Pass or Fail based on the expected result
against the actual result. If the actual and expected results are the
same, mention it as Passed. Else make it as Failed. If a test fails, it
has to go through the bug life cycle to be fixed.
Comments If there are any special conditions to support the above fields,
which can’t be described above or if there are any questions
related to expected or actual results then mention them here.
3.7
Software Testing Tools Test Cases and Test Plan
Created by -
Creation Date -
Reviewed by -
Reviewed Date -
Test Test Test Case Pre- Test Post- Expected Actual Status Test Executed Comments
Scenario ID Case Description conditions Data conditions Result Result Case Date (if any)
and ID Executed
Description By
3.8
Software Testing Tools Test Cases and Test Plan
Example 1: Let us say that we need to check an input field that can accept maximum of 20
characters. While developing the test cases for the above scenario, the test cases are
documented the following way. In the below example, the first case is a Pass scenario
while the second case is a Fail.
Scenario Test Step Expected Result Actual Outcome
Verify that the input Login to application Application should Application accepts
field that can accept and key in 20 be able to accept all all 20 characters.
maximum of 20 characters. 20 characters.
characters.
Contd...
3.9
Software Testing Tools Test Cases and Test Plan
Verify that the input Login to application Application should Application accepts
field that can accept and key in 21 NOT accept all 21 all 21 characters.
maximum of 21 characters. characters.
characters.
If the expected result doesn't match with the actual result, then we log a defect. The
defect goes through the defect life cycle and the testers address the same after fix.
Example 2:
Example 3: ATM Machine Test Cases. Primary and generic positive and negative test cases
for the ATM machine. While testing ATM machine we have to keep following things in
mind:
o Performance
o Accuracy
o Reliability
If we want to achieve all the above points for ATM Machine, then we have to test each
separate component, after that integration testing after assembling all the elements and
finally need to perform performance testing.
ATM Machine UI Testing:
o Check in the screen all labels button, links & images are appearing correctly.
o Check whatever written on the screen is visible.
o Check the application UIO is responsive.
3.10
Software Testing Tools Test Cases and Test Plan
o Check the ATM Machine is a full touch screen, or it also supports Keyboard and
Touch screen both the functionality.
ATM Machine Positive Test Cases:
o Check the ATM card is as per the specification document.
o After entering the Debit/Credit card in the card, reader users should be able to
select language and operation like withdrawal, language change, mini statement,
and other options.
o When an ATM card is entered in the card reader, it should verify the card.
o Check during any transaction the ATM Machine accepts card and Pin details.
o Check after successfully enter the pin and complete the process, the user should be
able to take out the money.
o After taking out the money, the money receipt should also print.
o After successfully withdraw the amount, the user should be log out from the
sessions.
o Check if the user wants to print the money receipt (mini statement), it should be
done by following the menu options.
o If the user enters more amounts then the account balance, then the user should get
an error message.
o The ATM should have a waiting period between user session log out and active
another account.
o In the ATM Machine, the user should be able to Use a Master card, Visa card, and
Rupay Card.
o Verify after the transaction, the printed slip has the correct information or not.
o Verify the entered pin is encrypted or not.
o Verify the touch functionality is working correctly or not.
o Check whether the ATM is providing all types of accounts to do operations like
Savings and the correct account.
Negative Test Cases:
o Check the ATM Machine can accept the cards and pin or not.
o If a user enters an invalid pin, then an error message should be displayed.
o If allowed bank ATM card is entered, then only the user able to do the operations.
o Check is the ATM Machine can find the wrong pin or not.
o Check if the card is entered in the wrong way, the machine should find that and
display an error message.
o Check if the user three times the wrong password, then the account should be
locked.
o If the user has a lack of money, then he should receive a warning message.
3.11
Software Testing Tools Test Cases and Test Plan
o If the user inserted an expired card, then the user should not be able to perform
any action.
o If the user inserted less than 100 amount, then the amount should not out from the
ATM Machine.
o If the ATM Machine has dispatched the money, then the money should not again
enter into the ATM.
o The machine does not accept either Visa or MasterCard or both debit/credit cards.
o If the user enters the wrong denominations, then a warning message should
display.
o If the user has entered more than the daily limit amount, then the transaction
should be canceled, and a warning message should be displayed on the screen.
o The transaction should be canceled if the user clicks on the Cancel button.
o Check an error message is a display or not when the ATM does have the currency
on it.
o Check whether an error message is displayed or not when there is some network
issue.
o Check after the money release it is asking or not for the user confirmation to print
the transaction receipt.
o Check during the transaction if there is some power failure or network issue
comes then the transaction should be marked as nulled and no amount should be
dispatched.
Example 4: Test Case for SMS (Short Message Service). Here are the test cases for the SMS
application.
o Send to the invalid phone number and verify if it shows error or success message.
o Send it to the valid phone number and verify if the message gets sent.
o Send to the valid phone number and verify if the receiver able to open it.
o Send it to the valid phone number and verify if the receiver can read the contents
of it.
o Check the Message text editor character limit.
o Check the Message text editor for dictionary support.
o Check the Message editor for the auto-correct option.
o Check the Message editor for the template support option.
o Check the Message editor for the language support.
o Check if the Message editor for the type checker.
o Does the Message text accept emoticons in text format or image format?
o Does the Message app get a notification as sending failed?
3.12
Software Testing Tools Test Cases and Test Plan
Sub Execution
Module Scenarios Complexity Tester Status Defect_Id Severity
Levels Date
3.15
Software Testing Tools Test Cases and Test Plan
Execution
Module Scenarios Sub Levels Complexity Tester Status Defect_Id Severity
date
3. Verify
list of
Products.
2. Update
Profile.
• Testing requires constant communication between the test team and other teams like
the development team. Test reporting is a means of achieving this communication.
• There are two types of reports or communication that are required i.e., test incident
reports and test summary reports (also called test completion reports).
• The Incident Summary Report Identifier uses the organization's incident tracking
numbering scheme to identify this incident and its corresponding report.
• The Incident Summary is the information that relates the incident back to the
procedure or test case that discovered it.
• The Author of the incident report should include enough information so that the
readers of the report will be able to understand and replicate the incident.
• Sometimes, the test case reference alone will be sufficient, but in other instances,
information about the setup, environment, and other variables is useful.
• Following table describes the subsections that appear under Incident Description:
Inputs Describes the inputs actually used (e.g., files, keystrokes, etc.).
Expected Results Comes from the test case that was running when the incident was
discovered.
Actual Results Actual results are recorded here.
Contd...
3.17
Software Testing Tools Test Cases and Test Plan
Anomalies How the actual results differ from the expected results.
Date and Time The date and time of the occurrence of the incident.
Procedure Step The step in which the incident occurred.
Environment The environment that was used (e.g., system test environment or
acceptance test environment etc.).
Attempts to Repeat How many attempts were made to repeat the test?
Testers Who ran the test?
Observers Who else has knowledge of the situation?
• The Impact of the incident report form refers to the potential impact on the user, so
the users or their representative should ultimately decide the impact of the incident.
The impact will also be one of the prime determinants in the prioritization of bug
fixes, although the resources required to fix each bug will also have an effect on the
prioritization.
• The Investigation of the incident report explains who found the incident and who the
key players are in its resolution. Some people also collect some metrics here on the
estimated amount of time required to isolate the bug.
• The Metrics of the incident report can be used to record any number of different
metrics on the type, location and cause of the incidents.
• The Disposition (Status) shows the current status of all incidents with log
of incidents. In a good defect tracking system, there should be the capability to
maintain a log or audit trail of the incident as it goes through the analysis, debugging,
correction, re-testing and implementation process.
3.20
Software Testing Tools Test Cases and Test Plan
Contd...
3.21
Software Testing Tools Test Cases and Test Plan
3.22
Software Testing Tools Test Cases and Test Plan
PRACTICE QUESTIONS
Q. I Multiple Choice Questions:
1. Which of the following is not part of the Test document??
(a) Test Case (b) Test Strategy
(c) Requirements Traceability Matrix (RTM)
(d) Project Initiation Note (PIN)
2. Which following term is used to define testing?
(a) Evaluating deliverable to find errors (b) Finding broken code
(c) A stage of all projects (d) None of the mentioned
3. Which of the following document detailing the objectives, resources, and processes
for a specific test for a software or hardware product?
(a) Test Technique (b) Test Strategy
(c) Test Case (d) Test Plan
4. Which of the following report outlines the summation of software testing activities
and final testing results?
(a) Test Incident (b) Test Summary
(c) Test Planning (d) None of the mentioned
5. Which of the below is not a part of the Test Plan?
(a) Schedule (b) Risk
(c) Incident reports (d) Entry and Exit criteria
6. Which test document is used to define the Exit Criteria of testing?
(a) Defect Report (b) Test Summary Report
(c) Test Case (d) Test Plan
7. A set of inputs, execution preconditions and expected outcomes is known as a,
(a) Test Plan (b) Test Case
(c) Test Document (d) Test Suite
8. Which is a translator (translates source code to object/target code)?
(a) Requirement ID (b) Test case ID
(c) Bug ID (d) None of the mentioned
9. Which is a document detailing the objectives, resources, and processes for a
specific test for a software or hardware product?
(a) Test Technique (b) Test Strategy
(c) Test Case (d) Test Plan
10. Which is a document generated after the culmination of software testing process,
wherein the various incidents and defects are reported by the testing team and to
take important steps to resolve these issues?
3.23
Software Testing Tools Test Cases and Test Plan
10. The objective of the Test _______ is to provide a systematic approach to the software
testing process in order to ensure the quality, traceability, reliability and better
planning.
11. Each test case should be represented by a unique _______.
12. The test case _______ are a set of conditions made according to the requirements.
Answers
1. Test Plan 2. requirements 3. Scope 4. Test case
5. Test report 6. operations 7. summary 8. incident
9. planning 10. Strategy 11. ID 12. templates
3.25
Software Testing Tools Test Cases and Test Plan
3.26
CHAPTER
4
Defect Report
Objectives…
To understand Concept of Defect
To learn Defect Life Cycle
To Write Defect Report
4.0 INTRODUCTION
• A software defect arises when the expected result don't match with the actual results.
It can also be error, flaw, failure, or fault in a computer program.
• The variation in the expected and actual results is known as defects. A defect is an
error or a bug in the application.
• A defect is a variance from specification/expectation.
• Defect can be defined as “an inconsistency in the behavior of the software.” OR “any
significant, unplanned event that occurs during testing that requires subsequent
investigation and/or correction. Defects are raised when expected and actual test
results differ”.
• When the result of the software application or product does not meet with the end
user expectations or the software requirements then it results into a Bug or Defect.
• In other words, a defect is an error in coding or logic that causes a program to
malfunction or to produce incorrect/unexpected results.
• A software bug arises when the expected result don't match with the actual results. It
can also be error, flaw, failure, or fault in a computer program.
• Root causes of defects are:
1. Requirements are not defined clearly by customer.
2. Designs are wrong and not implemented properly.
3. People are not trained for work in collecting requirements.
4. Processes used for product development, testing are not capable. They are not able
to deliver right software product.
4.1
Software Testing Tools Defect Report
4.2
Software Testing Tools Defect Report
• This starts as soon as any new defect is found by a tester and comes to an end when a
tester closes that defect assuring that it won’t get reproduced again.
• The actual workflow of a Defect Life Cycle with the help of a simple diagram as shown
in Fig. 4.1.
• Defect life cycle is a cycle in which a defect goes through during its lifetime. The defect
life cycle starts when defect is found and ends when a defect is closed, after ensuring
it’s not reproduced.
• Defect life cycle is the representation of the different states of a defect which it attains
at different levels during its lifetime.
• The defect/bug has following states in its life cycle:
1. New: Whenever any new defect is found in application, it is defined as a ‘New’
state, and validations and testing are performed on this defect in the later stages of
the Defect Life Cycle.
2. Assigned: Newly created defect is assigned to the development team to work on
the defect. This is assigned by the project lead or the manager of the testing team
to a developer. It’s state is now defined as “assign”
3. Open: Developer analyzes the defect and works on it and fix it, if required. If the
developer feels that the defect is not appropriate then it may get transferred to any
of the below four states namely Duplicate, Deferred, Rejected, or Not a Bug-based
upon a specific reason.
4. Fixed: When the developer finishes the task of fixing a defect by making the
required changes then it is marked as “Fixed”.
5. Pending Retest: After fixing the defect, the developer assigns the defect to the
tester to retest the defect at their end, and until the tester works on retesting the
defect, the state of the defect remains in “Pending Retest”.
6. Retest: At this point, the tester starts the task of retesting the defect to verify if the
defect is fixed accurately by the developer as per the requirements or not.
7. Reopen: If any issue persists in the defect, then it will be assigned to the developer
again for testing and the status of the defect gets changed to ‘Reopen’.
8. Verified: If the tester does not find any issue in the defect after being assigned to
the developer for retesting and he feels that if the defect has been fixed accurately
then the status of the defect gets assigned to ‘Verified’.
9. Closed: When the defect does not exist any longer, then the tester changes the
status of the defect to “Closed”.
• A few more state includes:
1. Rejected: If the defect is not considered a genuine defect by the developer then it
is marked as “Rejected” by the developer.
4.3
Software Testing Tools Defect Report
2. Duplicate: If the developer finds the defect as same as any other defect or if the
concept of the defect matches any other defect then the status of the defect is
changed to ‘Duplicate’ by the developer.
3. Deferred: If the developer feels that the defect is not of very important priority
and it can get fixed in the next releases or so in such a case, he can change the
status of the defect as ‘Deferred’.
4. Not a Bug: If the defect does not have an impact on the functionality of the
application, then the status of the defect gets changed to “Not a Bug”.
Defect classification
System interface
Functional Test environment Initialization
defects
defects defects defects
User interface
Interface defects Test tool defects Database related
defects Module defects Test design defects defects
Algorithmic defects
2. Design Defects:
• These defects generally refer to the way of design creation or its usage while creating a
software product.
• The customer may or may not be in a position to understand these defects, if
structures are not correct.
• They may be due to problems with design creation and implementation during SDLC
(Software Development Life Cycle).
• Design related defects may be classified as follows:
(i) Algorithmic defects may be introduced in a product if designs of various
decisions are not handled correctly.
(ii) Module interface defects are about communication problem between various
modules. If one module gives some parameters which are not recognized by
another, it creates module-interface defects.
(iii) User interface defects may be a part of system - interface defects where the
other system working with the application is a human being. User-interface
defects may be a part of navigation, look and feel type of defects which affect
usability of an application.
(iv) System interface defects may be generated when application communication
with environmental factors is hampered. System may not be able to recognize
inputs coming from the environment or may not be able to give outputs which
can be used by the environment.
3. Coding Defects:
• These defects may arise when designs are implemented wrongly. If there is absence of
development/coding standards or if they are wrong, it may lead to coding defects.
• Some coding defect are given below:
(i) Variable declaration/initialization defects arise when variables are not
initialized properly, or variables are not declared correctly. These types of defects
refer to wrong coding practices which may arise due to wrong standards of
development.
(ii) Commenting/Documentation defects, coding also needs adequate commenting
to make it readable and maintainable in future.
(iii) Database related defects may occur when a database is not created
appropriately or it is not optimized. It may be a part of design defects if database
design is wrong or it may be a coding defect if database is not implemented
correctly as per design.
4. Testing Defects:
• These defects are introduced in an application due to wrong testing or defects in the
test artifacts leading to wrong testing.
4.5
Software Testing Tools Defect Report
(i) Test design defects refer to defects in test artifacts. These can be defects in test
plans, test scenarios, test cases and test data definition which can lead to defect
introduction in software if it is not handled correctly.
(ii) Test tool defects generally, assumed that there are no defects in a test tool. Any
defect introduced by a test tool may be very difficult to find and resolve, as one
may have to find the defect using manual tests as against automated tools.
(iii) Test environment defects may arise when test environment is not set properly.
Test environment may be comprised of hardware, software, simulators and
people doing testing. If test environment definition and reality are mismatched, it
may lead to defects. Test environment may include operator training also.
• A defect report includes all the information needed to reproduce the problem,
including the author, release/build number, open/close dates, problem area, problem
description, test environment, defect type, how it was detected, who detected it,
priority, severity, status, etc.
• The general sample defect template is shown in Fig. 4.3.
DEFECT REPORT
Signatures :
Originator: ________________________ Tested: __________________
Programmer: ______________________ Project Manager: __________
Marketing: _________________________ Product Support: __________
4.7
Software Testing Tools Defect Report
• Every defect has distinctive attributes in comparison to a test case. It defines the defect
in detail and also helps in identification/fixing and categorization of defect.
• Following are some of the attributes of a defect.
1. Defect ID is the unique identification number for the defect.
2. Defect Name is the name of the defect must explain the defect in brief, its nature
and type.
3. Project Name indicates the project for which the defect is found.
4. Module/Sub-module Name for which the defect is found may be mentioned to
create a reference. It may not be required, if defect ID already contains this
information.
5. Phase Introduced gives information about when the defect has been added in the
application being developed.
6. Phase Found is the phase of the project when the defect is found is added here.
This is used to find defect leakage or stage contamination or stage containment.
7. Defect Type is the definition of defect type may be declared in test plan.
8. Severity is the definition of severity of the defect is declared in test plan.
Severity describes the impact of the defect on the application. Severities may be
critical, high, medium or low depending on the impact of a defect. Severity can be
defined as, “the degree of impact that a defect has on the development or
operation of a component or system.”
Classification of Defect Severity:
(i) Critical: The defect affects critical functionality or critical data. It does not
have a workaround. Example: Unsuccessful installation, complete failure of a
feature.
(ii) Major: The defect affects major functionality or major data. It has a
workaround but is not obvious and is difficult. Example: A feature is not
functional from one module but the task is doable if 10 complicated indirect
steps are followed in another module/s.
(iii) Minor: The defect affects minor functionality or non-critical data. It has an
easy workaround. Example: A minor feature that is not functional in one
module but the same task is easily doable from another module.
(iv) Trivial: The defect does not affect functionality or data. It does not even need
a workaround. It does not impact productivity or efficiency. It is merely an
inconvenience. Example: Petty layout discrepancies, spelling/grammatical
errors.
4.8
Software Testing Tools Defect Report
4.9
Software Testing Tools Defect Report
4.10
Software Testing Tools Defect Report
• With the help of defect attributes, defects easily customized and tracked. Here, are
some major attribute used in defect reports:
4.11
Software Testing Tools Defect Report
PRACTICE QUESTIONS
Q. I Multiple Choice Questions:
1. Which of the following is a variance between expected results and actual results of
execution of test case on the software or system?
(a) defect (b) error
(c) fault (d) failure
2. Causes of defects include,
(a) incomplete requirements and missing specifications
(b) Error in coding
(c) Incorrect design (d) All of the mentioned
3. Which is a cycle of defects from which it goes through covering the different states
in its entire life (start to finish/completion)?
(a) Defect Life Cycle (b) Bug Life Cycle
(c) Both (a) and (b) (d) None of the mentioned
4. Which of the following is not a state of a Bug in Bug Life Cycle?
(a) New (b) open
(c) deferred (d) critical
5. How severe the bug is affecting the application is called as?
(a) Severity (b) Priority
(c) Traceability (d) Fixability
6. Deferred status in bug life cycle means,
(a) Developer feels that the bug is not genuine.
(b) Bug is repeated twice or the two bugs mention the same concept of the bug.
(c) The bug is expected to be fixed in next releases.
(d) None of the mentioned
7. If the defect is not considered a genuine defect by the developer then it is marked as,
(a) New (b) Open
(c) Closed (d) Rejected
8. If the defect has been fixed accurately then the status of the defect gets assigned to,
(a) Retest (b) Verified
(c) Reopen (d) Closed
9. Which of the following defects may arise when designs are implemented wrongly?
(a) Design (b) Testing
(c) Coding (d) Requirement
10. Which of the following defects bound to software’s speed, stability, response time,
and resource consumption?
(a) Performance defects (b) Functional defects
(c) Usability defects (d) None of the mentioned
4.12
Software Testing Tools Defect Report
11. Which is a document that has concise details about what defects are identified in
testing, what action steps make against the defects and what are the expected
results?
(a) Error report (b) Defect report
(c) Test case report (d) Test strategy report
12. The good qualities of the defect report include,
(a) simple to understand (b) to be reproducible
(c) having a standard format (d) All of the mentioned
Answers
1. (a) 2. (d) 3. (c) 4. (d) 5. (a) 6. (c) 7. (d) 8. (b) 9. (c) 10. (a)
11. (b) 12. (d)
Q. II Fill in the Blanks:
1. When actual result deviates from the expected result while testing a software
application or product then it results into a _______.
2. High _______ defects are the errors that must be fixed in an upcoming release.
3. _______ can be decided based on how bad/crucial is the defect for the system.
4. If the tester does not find any issue in the defect, its state is_______.
5. A software _______ arises when the expected result don't match with the actual
results.
6. The number of defects (all major ones and minor ones) found in the application is
directly proportional to the _______ of the software application.
7. If the defect is not considered a genuine defect by the developer then its state is
_______.
8. While designing and building the software programmer can make _______ or error
is known as defects.
9. A defect's status is set to _______ if it has no impact on the application's operation.
10. _______ defects arise in a product when one fails to understand what is required by
the customer/end user.
11. The goal of the defect _______ cycle is to make the defect repair process more
systematic and efficient.
12. Defects _______ provide information about defects in the testing process.
Answers
1. defect 2. priority 3. Severity 4. Verified
5. bug/defect 6. quality 7. Rejected 8. mistakes
9. Not a bug 10. Requirements 11. life 12. reports
Q. III State True or False:
1. A defect is a mistake in an software application that prevents the program's
regular flow by mismatching the intended behavior with the actual behavior.
2. A defect report is to state the problem as clearly as possible so that developers can
replicate the defect easily and fix it.
4.13
Software Testing Tools Defect Report
3. When the result of the software application or product does not meet with the end
user expectations or the software requirements then it results into a defect report.
4. A defect can also be error, flaw, failure, or fault in the software.
5. The life cycle refers to the phases/steps that a defect passes through throughout the
course of its existence.
6. When a developer makes a mistake during the design or development of an
application, and this problem is discovered by a tester, it is referred to as a defect.
7. Whenever, any new defect is found in application, it is defined as a ‘Start’ state.
8. Defect template is a systematic document to arrange defect in easy to find manner.
9. Priority in defect is defined on the basis of how the project decides a schedule to
take the defects for fixing.
Answers
1. (T) 2. (T) 3. (F) 4. (T) 5. (T) 6. (T) 7. (F) 8. (T) 9. (T)
Q. IV Answer the following Questions:
(A) Short Answer Questions:
1. What is defect?
2. When to define defect in ‘New’ state.
3. List the types of defect.
4. When to define defect in ‘Deferred’ state.
5. What is defect report?
6. List out types of the software defects by nature.
7. List out types of the software defects by priority.
8. List out types of the software defects by severity.
9. What are critical defects?
10. What is mean by high priority defect?
11. Define defect report.
(B) Long Answer Questions:
1. What is defect? List it’s causes in a software.
2. Explain defect life cycle with help of detailed diagram.
3. Explain different states of defect in defect workflow.
4. Explain the attributes of defect report.
5. Explain functional defect in detail.
6. Explain classification of defects.
7. Explain components of Defect Report.
8. Write short note on coding defect.
9. What are software defects by severity
10. Write short note on testing defect.
11. Explain defect report template with example.
4.14
CHAPTER
5
Testing Tools
Objectives…
To understand Concept of Testing Tools
To learn different Types of Automation Tools
To implement Automation Testing using Selenium Tool
5.0 INTRODUCTION
• Testing is an integral part of any successful software project. The type of testing
(manual or automated) depends on various factors, including project requirements,
budget, timeline, expertise, and suitability.
• In manual testing (as the name suggests), test cases are executed manually (by a
human, that is) without any support from tools or scripts. But with automated testing,
test cases are executed with the assistance of automation testing tools, scripts, and
software.
• Manual testing is the oldest and most rigorous type of software testing. Manual testing
is a method used by software developers to run tests manually.
• Manual testing is performed by execution of test cases, compares actual test results
and expected results.
• As source code changes, each time manual tests are repeated and prone to errors. It is
also difficult to execute manual testing on multiple platforms.
• Manual testing is a testing process that is carried out manually in order to find defects
without the usage of automation tools or automation scripting.
• Manual software testing is performed by a human sitting in front of a computer
carefully going through application screens, trying various usage and input
combinations, comparing the results to the expected behavior and recording their
observations.
Limitations of Manual Testing:
1. Manual Testing is Slow and Costly: Because it is very labour-intensive, it takes a
long time to complete tests. Increasing headcount increases cost.
5.1
Software Testing Tools Testing Tools
2. Manual Tests do not Scale Well: As the complexity of the software increases, the
complexity of the testing problem grows exponentially. This leads to an increase in
the total time devoted to testing as well as the total cost of testing.
3. Manual Testing is Not Consistent or Repeatable: Variations in how the tests are
performed are inevitable, for various reasons. One tester may approach and
perform a certain test differently from another, resulting in different results on the
same test, because the tests are not being performed identically.
4. Lack of Training is a Common Problem: Although not unique to manual
software testing.
5. Testing is difficult to Manage: There are more unknowns and greater uncertainty
in testing than in code development so, it will be difficult to manage.
• Automation testing is a process of changing any manual test case into the test scripts
by using automation testing tools and scripting or programming language.
• Automation testing is the application of tools and technology to test software with the
goal of reducing testing efforts, delivering capability faster and more affordably. It
helps in building better quality software with less effort.
• We can define test automation as, the automation of test-related activities with little or
no human interaction. We could define automation as the technique of performing
tasks without human intervention.
• Automation testing is also known as Test Automation. In automation testing the tester
writes scripts and uses other software to test the software product.
Benefits of Automated Testing:
1. Faster Feedback Cycle: Test automation helps to reduce the feedback cycle and
bring faster validation for phases in the development of software product.
2. Increased Efficiency: Test automation useful because to detect problems or bugs
early on during the development phase, which increases the team’s efficiency.
3. Reliable: Tests in automation perform precisely the same operations each time
they are run, thereby eliminating human error.
4. Repeatable: We can test how the software reacts under repeated execution of the
same operations.
5. Programmable: We can program sophisticated tests that bring out hidden
information from the application.
6. Comprehensive: We can build a suite of tests that covers every feature in the
application.
7. Reusable: We can reuse tests on different versions of an application, even if the
User Interface (UI) changes.
8. Better Quality Software: Because we can run more tests in less time with fewer
resources.
5.2
Software Testing Tools Testing Tools
9. Fast: Automated tools run tests significantly faster than human users.
10. Cost Reduction: An organization will save money as fewer resources are spent on
testing software product using an automated test environment.
11. Improved Accuracy: Automated tests can execute tests with 100% accuracy as
they produce the same result every time you run them.
12. Higher Test Coverage: Automation allows spending time writing new tests and
adding them to automated test suite. This increases the test coverage for a product,
so more features are properly tested resulting in a higher quality application.
• In today’s era most of the enterprises and businesses demand quality software and
faster releases to get quicker Return on Investment (RoI).
• The demand for delivering quality software at high speed is the maxim today that
essentially requires organizations to adopt Agile and DevOps Continuous Integration
(CI), Continuous Development (CD) methodologies to achieve faster releases and
quality software.
• Testing tools can be classified based on following several parameters:
1. The purpose of the tool
2. The Activities that are supported within the tool
3. The Type/level of testing it supports
4. The Kind of licensing (open source, freeware, commercial)
5. The technology used
• Following table gives types of testing tools:
Sr.
Tool Type Used for Used by
No.
4. Test data Preparation Tools Analysis and Design, Test data Testers.
generation.
5.6
Software Testing Tools Testing Tools
• Appium automates the applications that are created for iOS and Android.
• It is a well-liked mobile automation testing tool attributable to its easy installation and
usage.
5. Robotium:
• Robotium is an open-source tool that acts as a test automation framework which is
mainly intended for Android UI testing.
• It supports graybox UI testing, system testing, functional testing and user acceptance
testing for both native and hybrid Android based applications.
6. Cucumber:
• Cucumber is an open-source tool based upon the concept of Behavioral Driven
Development, allows to do automated acceptance testing by executing examples that
optimally describe the behavior of the application.
• It has cross-platform OS support and compatibility with programming languages like
Ruby, Java and .NET.
7. WATiR:
• Web Application Testing in Rubyis (WATiR) an extremely lightweight, technology
independent open source testing tool for web automation testing.
• It allows us to write simple, adaptable readable and maintainable automated tests.
8. Sikuli:
• Sikuli is an open source testing tool built upon the concept of image recognition and
possesses the ability to automate anything that is seen on the screen.
• It is useful to automate non-web-based desktop applications.
• It is also known for its quick bug reproduction.
9. Apache JMeter:
• Apache JMeter is an open source Java desktop app intended mainly for web
applications’ load testing.
• Apache JMeter is also supports unit testing and limited functional testing.
• It has features like dynamic reporting, portability, powerful Test IDE etc.
• It supports different type of applications, protocols, shell scripts, Java objects, and
databases.
10. WatiN:
• Web Application Testing in.NET (WatiN) an open source test automation framework
that aids in UI and functional web app testing.
• Mainly intended for Internet Explorer and Firefox browsers.
11. SoapUI:
• SoapUI is a popular open source API Test Automation Framework for SOAP and REST.
5.8
Software Testing Tools Testing Tools
• SoapUI supports functional testing, performance testing, data-driven testing and test
reporting as well.
12. Capybara:
• Capybara is an open source acceptance test framework, helpful in testing web
applications.
• Capybara simulates the behavior of a real user that interacts with the application.
• It is used in conjunction with other testing tools like Cucumber, RSpec, Minitest, etc.
13. Testia Tarantula:
• Testia Tarantula is an open source tool is created by software company “Prove
Expertise” in Finland.
• Modern web tool for software test management mainly intended for agile projects.
• Test executions can be quickly planned by using its tagging features and easy drag and
drop interface.
• It has smart tags for fix verification and dashboard for managers.
14. Testlink:
• Testlink is an open source web-based test management tool primarily featured for test
plans, test cases, user roles, test projects and test specifications.
• It offers cross-platform OS support.
• Well integrated with other bug tracking systems like JIRA, Bugzilla, Redmine.
15. Windmill:
• Windmill is an open source web testing tool created for automating and debugging the
web applications.
• It offers cross browser and cross platform support for web app testing.
16. TestNG:
• TestNG is an open source testing framework, supports almost all kinds of testing like
unit testing, functional testing, integration testing, data-driven testing, end-to-end
testing.
17. Marathon:
• Marathon is an open source test automation framework, test Java-based GUI
applications.
• Mainly intended for acceptance testing, allows us to record and replay the tests and
generates test reports as well.
• Use Marathon if we are testing a small project and if your application screen size is
limited to 10 screens.
18. Httest:
• Httest is used to implement all types of Http-based tests.
• It offers a range of Http based functionalities.
5.9
Software Testing Tools Testing Tools
5.11
Software Testing Tools Testing Tools
1. Selenium WebDriver:
• Selenium WebDriver is a programming interface that can be used to create and
execute test cases.
• WebDriver allows us to test across all the major programming languages, browsers
and operating systems.
• The test cases are created using elements locators. We locate your elements with one
of the eight Selenium element locator techniques and the WebDriver methods will
then let us to perform actions on those elements.
• The script we create interacts directly with the browser (which is the reason it’s much
faster than depreciated Selenium RC).
• There are different drivers for different browsers, which ‘interpret’ the script we write
for it.
2. 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.
• Selenium Grid allows us to run multiple tests at the same time on multiple machines
also known as parallel testing.
5.12
Software Testing Tools Testing Tools
6. Finally, click OK and we are done importing Selenium libraries into our project.
o There are different types of browser drivers according to types of browser like,
Firefox, Internet Explorer and Chrome.
o These driver is needed while testing the Web application. So download the
driver for browser of our choice.
o In example given above we have used geckodriver for FireFox browser. While
writing code there is a method as given below:
System.setProperty("webdriver.gecko.driver",
"C:\\geckodriver-v0.30.0-win64\\geckodriver.exe");
o In this method we have mention the path of downloaded driver for browser as
a second argument.
o Write the test script code and execute the application and observe the output.
CASE STUDIES
Case Study 1: Write a test script to open the Firefox Browser and open
“https://www.google.com/ ” website and close it using selenium.
Before performing automation testing for the login functionality, there are a couple of
basic steps that need to be followed for the test case to be written:
o Create a Selenium WebDriver instance.
o Configure browser if required.
o Navigate to the required web page.
o Locate the relevant web element.
o Perform action on the web element.
o Verify and validate the action.
Package myp;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class sample
{
public static void main(String[] args)
{
// set the property for using firefox driver which is already
downloaded and available on path given in setProperty method
System.setProperty("webdriver.gecko.driver",
"C:\\selenium\\geckodriver-v0.30.0-win64\\geckodriver.exe");
// create the object of Webdriver class using
constructor FirefoxDriver
WebDriver d = new FirefoxDriver();
// open the google website using get() method
d.get("https://www.google.com/");
5.14
Software Testing Tools Testing Tools
5.15
Software Testing Tools Testing Tools
Case Study 2: Write a test script to open the Firefox Browser and open
“https://opensource-demo.orangehrmlive.com/” website and enter login credential and
test the success or failure of login using selenium.
Package testingp;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class testclass
{
public static void main(String[] args)
{
System.setProperty("webdriver.gecko.driver",
"C:\\geckodriver-v0.30.0-win64\\geckodriver.exe");
// create the object of Webdriver class using
constructor FirefoxDriver
WebDriver d = new FirefoxDriver();
// open the website using get() method
d.get("https://opensource-demo.orangehrmlive.com/");
// Display website title
System.out.println(d.getTitle());
// Get URL of website
String u = d.getCurrentUrl();
5.16
Software Testing Tools Testing Tools
5.17
Software Testing Tools Testing Tools
PRACTICE QUESTIONS
Q. I Multiple Choice Questions:
1. Which testing includes testing a software manually, i.e., without using any
automated tool or any script?
(a) Manual (b) Automation
(c) Both (a) and (b) (d) None of the mentioned
2. Which testing makes use of specialized tools to control the execution of tests and
compares the actual results against the expected result?
(a) Manual (b) Automation
(c) Both (a) and (b) (d) None of the mentioned
3. Program testing and fault detection can be aided significantly by testing,
(a) strategy (b) plan
(c) tools (d) report
5.18
Software Testing Tools Testing Tools
12. Which testing tools are used to validate software models by enumerating
inconsistencies and finding defects?
(a) Review Tools (b) Static Analysis Tools
(c) Modeling Tools (d) Test Design Tools
13. Which testing tools are used to generate test inputs or executable tests?
(a) Review Tools (b) Static Analysis Tools
(c) Modeling Tools (d) Test Design Tools
14. Which testing tools manipulate databases, files or data transmissions to set up test
data to be used during the execution of tests?
(a) Test Data Preparation Tools (b) Static Analysis Tools
(c) Modeling Tools (d) Test Design Tools
15. Which testing tools are used to record tests and usually support scripting
languages or GUI-based configuration for parameterization of data and other
customization in the tests?
(a) Test Data Preparation Tools (b) Test Execution Tools
(c) Dynamic Analysis Tools (d) Test Design Tools
16. Which of the following are the success factors for the deployment of the tool
within an organization?
(i) Assessing whether the benefits will be achieved at a reasonable cost.
(ii) Adapting and improving processes to fit with the use of the tool.
(iii) Defining the usage guidelines.
(a) only (i) and (ii) (b) only (ii) and (iii)
(c) only (i) and (iii) (d) All (i), (ii) and (iii)
17. Which of the following is/are the main objectives of introducing the selected tool
into an organization with a pilot project?
(i) To learn more detail about the tool.
(ii) To evaluate how the tool fits with the existing process.
(iii) To decide the standard ways of using, managing, sorting and maintaining the tool.
(a) only (i) and (ii) (b) only (ii) and (iii)
(c) only (i) and (iii) (d) All (i), (ii) and (iii)
18. What criteria should consider while selecting a tool for an organization?
(i) Evaluating the training needs by considering the current test team’s test
automation skills.
(ii) Estimating the cost-benefit ratio based on a concrete business case.
(iii) Providing training for new users.
(a) only (i) and (ii) (b) only (ii) and (iii)
(c) only (i) and (iii) (d) All (i), (ii) and (iii)
5.20
Software Testing Tools Testing Tools
Answers
1. (a) 2. (b) 3. (c) 4. (d) 5. (c) 6. (d) 7. (b) 8. (a) 9. (d) 10. (d)
11. (b) 12. (c) 13. (d) 14. (a) 15. (b) 16. (b) 17. (d) 18. (a)
Q. II Fill in the Blanks:
1. _______ testing is performed by carefully executing predefined test cases,
comparing the results to the expected behavior and recording the results.
2. _______ testing is the application of tools and technology to testing software with
the goal of reducing testing efforts, delivering capability faster and more
affordably.
3. _______ testing tools monitors the performance and response time of system.
4. Test data _______ testing tool does analysis and design, test data generation.
5. _______ management testing tool is responsible for implementation, execution,
tracking changes.
6. _______ test tools, test the software system with “live” data.
7. Selenium Grid allows you to run _______ tests at the same time on multiple
machines.
8. _______ automation helps to reduce the feedback cycle and bring faster validation.
9. _______ testing tools does coverage analyzers, Flow analyzers, Flow tests and so on.
10. Selenium _______ is a programming interface that can be used to create and
execute test cases.
11. Software testing _______ enable to design, develop, maintain, manage, execute and
analyze automated tests for applications running on different platforms such as
desktop, Web, mobile and so on.
Answers
1. Manual 2. Automation 3. Performance 4. Preparation
5. Configuration 6. Dynamic 7. multiple 8. Test
9. Static 10. WebDriver 11. tools
6. Testing tools in software testing are the software products that support various test
activities starting from planning, requirement gathering, build creation, test
execution, defect logging and test analysis.
7. Automation testing should be performed before starting the manual testing.
8. There is a risk of suspension of the open-source or free tools project.
9. k6 is an open source load and performance testing tool for testing cloud-native
applications, APIs and micro-services.
Answers
1. (T) 2. (F) 3. (T) 4. (F) 5. (F) 6. (T) 7. (F) 8. (T) 9. (F)
Q. IV Answer the following Questions:
(A) Short Answer Questions:
1. Define manual testing?
2. What is an automation testing tool?
3. List the different test automation frameworks.
4. List popular open source automation software testing tools.
5. List ‘Web-based’ open source automation software testing tools.
6. List out Selenium installation steps in short.
7. List limitations of manual testing. (Any two).
8. What are the characteristics of testing tools?
9. What is the difference between manual testing and automation testing?
10. List open source automation software testing tools for ‘Mobile application’.
11. Define test automation.
(B) Long Answer Questions:
1. What is manual testing? What are limitations of manual testing?
2. Explain different types of testing tools. Explain four of them in short.
3. What are the major criteria for tool selection?
4. Define Automation testing tool. How to make use of Automation tools?
5. Describe features of Selenium testing tool.
6. What are the benefits of Automation testing?
7. Explain key features of any three popular open source automation software testing
tools.
8. Write the detail steps for using selenium to test the application.
9. Write note on Selenium tool.
10. Write test script to check login credentials.
5.22
Notes
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
Notes
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________