Professional Documents
Culture Documents
STA Notes (Unit 5)
STA Notes (Unit 5)
UNIT-5
Coverage criteria are method to measure how much code has been exercised by the
test suite. The test suite must satisfy the rule of the coverage criteria. The various
Coverage criteria are as follows:
Statement Coverage
Decision Coverage
Condition Coverage
Path Coverage
5. Path Coverage: Path Coverage tells us whether all the paths in each function have
been followed. The path coverage determines the paths are possible combinations of
logical operators. A path is a sequence of branches from entry point to exit point. It is
useful as it requires thorough testing. Path Coverage has disadvantages as the number
of paths is exponential to number of branches. Also due to relationship of data many
paths are not possible.
What Is Code Walkthrough
Code Walkthrough is a form of peer review in which a programmer leads the review
process. The other team members ask questions. At the same time, spot possible
errors against development standards and other issues.
Code Walkthrough is a form of peer review in which a programmer leads the review
process and the other team members ask questions and spot possible errors against
development standards and other issues.
Disadvantages of Walkthrough
Not an enforceable process, no record of the review.
Easy for the author to unintentionally miss a change.
Reviewers rarely verify that defects were fixed.
Characteristics of Walkthroughs
It is not a formal process/review
It is led by the authors
Author guide the participants through the document according to his or her thought
process to achieve a common understanding and to gather feedback.
Useful for the people if they are not from the software discipline, who are not used to
or cannot easily understand software development process.
Is especially useful for higher level documents like requirement specification, and a
lot more.
Inspections
Inspection is a more formally defined process than a walkthrough. This term is usually
associated with code. Several organizations consider formal code inspections as a tool to
improve code quality at a lower cost than incurred when dynamic testing is used.
Organizations have reported significant increases in productivity and software quality due to
the use of code inspections.
Code inspection is carried out by a team. The team works according to an inspection plan
that consists of the following elements: (a) statement of purpose; (b) work product to be
inspected, this includes code and associated documents needed for inspection; (c) team
formation, roles, and tasks to be performed; (d) rate at which the inspection task is to be
completed; and (e) data collection forms where the team will record its findings such as
defects discovered, coding standard violations, and time spent in each task.
Members of the inspection team are assigned roles of moderator, reader, recorder, and
author. The moderator is in charge of the process and leads the review. Actual code is read
by the reader, perhaps with the help of a code browser and with large monitors for all in the
team to view the code. The recorder records any errors discovered or issues to be looked
into. The author is the actual developer whose primary task is to help others understand
code. It is important that the inspection process be friendly and non-confrontational.
Test automation frameworks are a set of rules and corresponding tools that are used
for building test cases. It is designed to help engineering functions work more
efficiently.
The general rules for automation frameworks include coding standards that you can
avoid manually entering, test data handling techniques and benefits, accessible
storage for the derived test data results, object repositories, and additional
information that might be utilized to run the tests in a suitable manner.
What is Verification?
Definition : The process of evaluating software to determine whether the products of
a given development phase satisfy the conditions imposed at the start of that phase.
Verification will help to determine whether the software is of high quality, but it will
not ensure that the system is useful. Verification is concerned with whether the
system is well-engineered and error-free.
What is Validation?
Definition: The process of evaluating software during or at the end of the
development process to determine whether it satisfies specified requirements.
Validation is the process of evaluating the final product to check whether the
software meets the customer expectations and requirements. It is a dynamic
mechanism of validating and testing the actual product.
Verification is the process of checking that the software meets the specification.
“Did I build what I need?”
Verification Validation
1. Verification is a static practice of 1. Validation is a dynamic mechanism
verifying documents, design, code and of validating and testing the actual
program. product.
2. It always involves executing the
2. It does not involve executing the code.
code.
3. It is human based checking of documents 3. It is computer based execution of
and files. program.
4. Validation uses methods like black
4. Verification uses methods like
box (functional) testing, gray box
inspections, reviews, walkthroughs, and
testing, and white box (structural)
Desk-checking etc.
testing etc.
5. Validation is to check whether
5. Verification is to check whether the
software meets the customer
software conforms to specifications.
expectations and requirements.
6. It can catch errors that validation cannot 6. It can catch errors that verification
catch. It is low level exercise. cannot catch. It is High Level Exercise.
7. Target is requirements specification, 7. Target is actual product-a unit, a
application and software architecture, high module, a bent of integrated modules,
Verification Validation
level, complete design, and database and effective final product.
design etc.
8. Verification is done by QA team to
8. Validation is carried out with the
ensure that the software is as per the
involvement of testing team.
specifications in the SRS document.
9. It generally comes first-done before
9. It generally follows after verification.
validation.
It is a procedure that
focuses on providing It is a procedure that focuses on fulfilling
assurance that quality the quality requested.
requested will be achieved
It is a method to manage
It is a method to verify the quality-Validation
the quality- Verification
It is performed before
It is performed only after QA activity is done
Quality Control
It is a Low-Level Activity, it
It is a High-Level Activity, it can identify an
can identify an error and
error that QA cannot
mistakes which QC cannot
A testing framework is always application-independent that is it can be used with any application
irrespective of the complications (like Technology stack, architecture etc.) of the application
under test. The framework should be scalable and maintainable.
Reusability of Code
Since these frameworks come with the required coding data beneficial for the
automation test to become a success, the valuable data is saved for future use and
can be reused at any given point of time. There is no need to insert codes manually
or rearrange them. The code can also be utilized to run other automation framework
tests. The developed scripts can also be retained.
Low Cost
Test cases can be developed at a fairly low cost because the frameworks already
have established rules. Also, given these codes can be reused multiple times, the
cost and time of building test cases for new features are low.
The automation frameworks run according to the guidelines that surround them.
Since maximum coverage is already in-built and achieved at the initial stage, there is
very little or no intervention required by individuals to run the automation tests. In
case the process fails, the automation frameworks can be run again with a little
change, but the data remains constant and devoid of additional effort from an
individual or team.
Improved Efficiency
Data Driven Testing Framework - While automating or testing any application, at times it may be
required to test the same functionality multiple times with the different set of input data. Thus, in
such cases, we can’t let the test data embedded in the test script. Hence it is advised to retain test
data into some external database outside the test scripts.
Data Driven Testing Framework helps the user segregate the test script logic and the test data
from each other. It lets the user store the test data into an external database. The external
databases can be property files, xml files, excel files, text files, CSV files, ODBC repositories etc.
The data is conventionally stored in “Key-Value” pairs. Thus, the key can be used to access and
populate the data within the test scripts.
The Keyword driven testing framework is an extension to Data driven Testing Framework in a
sense that it not only segregates the test data from the scripts, it also keeps the certain set of code
belonging to the test script into an external data file.
These set of code are known as Keywords and hence the framework is so named. Keywords are
self-guiding as to what actions need to be performed on the application.
The keywords and the test data are stored in a tabular like structure and thus it is also popularly
regarded as Table driven Framework. Take a notice that keywords and test data are entities
independent of the automation tool being used.
TestNG
TestNG is a testing framework for the Java programming language created by Cédric Beust
and inspired by JUnit and NUnit. The design goal of TestNG is to cover a wider range of test
categories: unit, functional, end-to-end, integration, etc., with more powerful and easy-to-use
functionalities.
TestNG gives the developer the ability to write more flexible and powerful tests.
TestNG Features
Supports annotations.
TestNG uses more Java and OO features.
Supports testing integrated classes (e.g., by default, no need to create a new test class
instance for every test method).
Separates compile-time test code from run-time configuration/data info.
Flexible runtime configuration.
Introduces ‘test groups’. Once you have compiled your tests, you can just ask TestNG to
run all the "front-end" tests, or "fast", "slow", "database" tests, etc.
Supports Dependent test methods, parallel testing, load testing, and partial failure.
Flexible plug-in API.
Support for multi-threaded testing.