Sei sulla pagina 1di 77

Software Testing: It is a process by which we validate the software with

customers requirement. During validation, we ensure that all the bugs have been
fixed. In software testing, our motive is to deliver the product to the customer
according to the requirements he specified.

Principles of Software Testing:

1. Exhaustive testing is impossible: Testing everything including all


combinations of inputs and preconditions is not possible. So, instead of doing
the exhaustive testing we can use risks and priorities to focus testing efforts.
2. Defect clustering: A small number of modules contains most of the defects
discovered during pre-release testing or shows the most operational failures.
3. Testing shows presence of defects: Testing can show the defects are
present, but cannot prove that there are no defects. Even after testing the
application or product thoroughly we cannot say that the product is 100%
defect free.
4. Pesticide paradox: If the same kinds of tests are repeated again and again,
eventually the same set of test cases will no longer be able to find any new
bugs.To overcome this Pesticide Paradox, it is really very important to
review the test cases and different tests need to be written.
5. Absence of errors fallacy: If the system built is unusable and does not
fulfill the users needs and expectations then finding and fixing defects does
not help. All the developed softwares are not identical. You might use a
different approach, methodologies or techniques of testing depending upon
the application type.
6. Early testing: In the software development life cycle testing activities
should start as early as possible and should be focused on defined objectives.
7. Testing is context depending: Testing is basically context dependent.
Different kinds of sites are tested differently. All the developed softwares are
not identical. You might use a different approach, methodologies, techniques
and types of testing depending upon the application type. For example,
safety critical software is tested differently from an e-commerce site.

Fundamental Testing Process: Testing is a process rather than a single activity.


This process starts from test planning then designing test cases, preparing for
execution and evaluating status till the test closure.

1. Planning and Control

All good testing is based upon good test planning.


Determine the scope and risks and identify the objectives of testing:
Determine the test approach.
Determine the required test resources.
Schedule test analysis and design tasks.
Determine the exit criteria.

2. Test analysis and design

Review the test basis (such as the product risk analysis, requirements,
architecture, design specifications, and interfaces)
Identify test conditions
Evaluate testability of the requirements and system.
Design the test environment set-up and identify any required infrastructure
and tools.

3. Test Implementation and Execution

Create test suites from the test cases for efficient test execution.
Develop and prioritize our test case.
Execute the test suites and individual test cases
Log the outcome of test execution.
Compare actual results with expected results and report incidents.

4. Evaluating exit criteria and reporting

Check test logs against the exit criteria specified in test planning.
Assess if more tests are needed or if the exit criteria specified should be
changed.
Write a test summary report for stakeholders.

5. Test Closure activities:

Check which planned deliverables we actually delivered.


Finalize and archive testware.
Hand over testware to the maintenance organization
Evaluate how the testing went and analyze lessons learned for future
releases and projects.
Test Suite: A test suite is a collection of test cases related to the same test work.
You might have a suite for regression, one for build verification tests, a suite that is
specific for a component, and so on.

Priority: Urgency of a bug is called Priority. It is highly impacted at clients end.


Priority can be High, Medium or Low.

Severity: Seriousness of a bug is called Severity.It is the extent to which the


defect can affect the software which leads to halt the testing.

High Priority & High Severity: An error which occurs on the basic functionality of
the application and will not allow the user to use the system. (Example: If the URL
is not working of the system then this is high priority and high severity bug.)

High Priority & Low Severity: The spelling mistakes that happens on the cover
page or heading or title or logo of an application.

High Severity & Low Priority: An error which occurs on the functionality of the
application and will not allow the tester to use the system or specific modules but
that link which is rarely used by the end user or client.

Low Priority and Low Severity: Any cosmetic or spelling issues which is within a
paragraph or in the report (Not on cover page, heading, title).

Verification:

Are we developing the right product according to the client requirement?


Verification is performed by developers and testers.
Human based checking.
Examples: Peer review, Walkthrough, Inspection.
It is done without executing the code.
Peer Review: One developer writes the code and peer developer tests the
code against the requirements.
Walkthrough: TL tests and reviews the code.
Inspection: Outsider (BA or who is not in the developing team) reviews the
code.

Validation:

Have we developed the right product according to the client requirement?


Validation is performed by testers and end users.
Computer based checking.
It is done by executing the software.
Example: Regression testing, Functional testing, Smoke testing, and Sanity
testing.

When to start testing:

An early start to testing reduces the cost, time to rework and error free
software that is delivered to the client.
SDLC starts from the Requirements Gathering phase and lasts till the
deployment of the software.
So, testing can be started from Requirement gathering phase verifying SRS,
FRS or BRS documents to see if the documents are clearly written and cover
all the requirements.
Now in coding phase, developers perform testing.
And then testers perform testing.

When to stop testing:

It is difficult to determine when to stop testing. Some parameters we can consider:

Completion of test case execution.


Testing Deadlines.
Bug rate falls below a certain level and no high priority bugs are identified.
Management decision.
Customers demand the product before its deadline date.

Test Plan: It is derived from SRS. The Test Plan document is usually prepared by
the Test Lead and defines the scope, resources, responsibilities, Effort Estimation,
and risk management for a project.

1. Define the Test Objectives: The objective of the testing is finding as many
software defects as possible, ensuring that the software under test is bug
free before release.
2. Analyze the product: You must analyze the product before testing it. So if you
are testing a banking site, research its clients and end users.
3. Design the Test Strategy: A Test Strategy document is a high-level document,
which is usually developed by Test Manager. Here you define the scope, identify
the testing type, document risks and create test logistics which means to select
suitable tester.
4. Define Test Criteria:
Entry criteria: A set of guidelines used to determine whether a system
under test is ready test. Like, we can start System testing once the code
has passed unit testing.
Exit Criteria: A set of guidelines used to determine whether a system
under test is ready to exit a particular phase of testing or testing is
complete.
Suspension Criteria: The testing process is suspended when no further
testing is feasible. It can happen due to several reasons like the
system under test repeatedly fail or crashes (due to defect).
Resumption criteria: When the defect is fixed and testing can be resumed,
is known as resumption criteria.

5. Resource Planning: It is a detailed summary of all types of resources required


to complete project task. Resource could be human, equipment and materials
needed to complete a project.
6. Plan Test Environment: A testing environment is a setup of software and
hardware on which the testing team is going to execute test cases.
7. Schedule & Estimation: Here, you break out the whole project into small tasks
and add the estimation for each task.
8. Test Deliverables: Test Deliverables is a list of all the documents and other
components that has to be provided.

Test Strategy: Test strategy is a high level document which defines the approach
for software testing. It is basically derived from the Business Requirement
document. Test strategy is developed by project manager or business analyst. It is
kind of static document. Test Strategy contains:

1. Scope and objective: The objective of the business and how much testing
scope is.
2. Business Issues: How much is the budget of the project, how much time is
required for testing, how much resources are needed etc.
3. Testing approach: What type of testing is needed (performance, load,
stress, functional etc.) and whether the testing is only manual or automation
or both are some of the crucial points which define the testing approach.
4. Test deliverables: What are the documents required from the testing team,
how they would keep the record of the testing cycles etc. will be included
here.
5. Defect tracking approach: Which tool will be used for tracking the defects
and how will the testing team communicate with the development team and
how the flow would go for defects are decided at this point in test strategy.
6. Training: If there is some complex or new tool is introduced in the business
then it is helpful if the team members are given proper training. What type of
training and the responsible person to conduct such training is defined here.
7. Automation: If the project or business needs automation testing then the
script language, tool used is planned in test strategy.
8. Risks: Nobody can anticipate all the risks beforehand but obvious risks can
be avoided and also solution can be included in the document for future help.

Test Plan Test Strategy

It is derived from SRS document. It is derived from BRS.

It is not static. i.e. changes can happen. It is however static in nature.

It defines objective, scope, testing It defines the approach, how testing will
effort. be done.

Test plan is carried out by a testing A test strategy is carried out by the
manager or lead that describes how to project manager. It says what type of
test, when to test, who will test and technique to follow and which module to
what to test. test.
Test plan exists individually. Test strategy is often found as a section
of a test plan.

It is defined at project level. It is set at organization level and can be


used by multiple projects.

SDLC: SDLC is a process used by software industry to design, develop and test
high quality software. The process consists of activities to develop or alter the
software products. SDLC consists of following stages:

1. Planning and Requirement Analysis- The most fundamental part of the SDLC is
planning. Stakeholders discuss the requirements of the software that needs to be
developed. They capture the detail of each requirement and make sure everyone
understands the scope of the work. Once the requirement analysis is done, the next
step is to clearly define and document the product requirements into SRS document
and get them approved from the customer.
2. Design- System Design helps in specifying hardware and system requirements and
also helps in defining overall system architecture.
3. Implementation/Coding- On receiving system design documents, actual
development starts and the product is built. Since, in this phase the code is
produced so it is the main focus for the developer.
4. Testing- After the code is developed it is tested against the requirements to make
sure that the product is developed according to the requirement specified. During
this phase all types of functional testing like unit testing, integration testing, system
testing, acceptance testing are done as well as non- functional testing are also
done.
5. Deployment- After successful testing the product is deployed to the customer for
their use. As soon as the product is given to the customers they will first do the
beta testing. If any changes are required or if any bugs are caught, then they will
report it to the engineering team. Once those changes are made or the bugs are
fixed then the final deployment will happen.
6. Maintenance- Once when the customers starts using the developed system then
the actual problems comes up and needs to be solved from time to time. This
process where the care is taken for the developed product is known as
maintenance.

STLC: Software testing life cycle is the sequence of activities done by testing team to
perform software testing.

Phases:

1. Requirement Analysis-

Review the software requirements.


Preparation of RTM.
Analyzing the Automation feasibility.
Conversations with developers, designers, and stakeholders.

Deliverables-

Requirement Traceability Matrix (RTM)


Automation feasibility report

2. Test Planning-

Preparation of test plan.


Estimation of testing effort.
Resource planning and assigning roles and responsibility to them.
Selection of testing tool.

Deliverables-

Test Plan
Estimation of testing report.

3. Test Case Development-

Create test cases, automation scripts (if applicable).


Review and verify test cases.
Create test data.

Deliverables-

Test cases/scripts.
Test data.

4. Test Environment Setup-

Setup or installation process of software and hardware.


Environment ready with test data set up.
Smoke testing.

Deliverables-

Environment ready
Smoke Test Results.

5. Test Execution-

Execute tests cases.


Reporting test results.
Logging defects for the failed test cases.
Verification and retesting of the defect.
Closure of defects.

Deliverables

Test execution Report.


Updated test cases with results.
Bug Report.

6. Test Cycle Closure-

Prepare Test closure report.


Evaluate cycle completion criteria based on - Time, Test coverage,
Cost, Software Quality.
Prepare test metrics.
Document the learning out of the project.
Verification and retesting of the defect.
Closure of defects.

Deliverables

Test Closure report


Test metrics.

Waterfall Model: Advantages-

This model is simple and easy to understand and use.


Waterfall model works well for smaller projects where requirements are very well
understood.
Not complex.
Easy documentation.
Disadvantages-

Not very useful for the large project.


Once an application is in the testing stage, it is very difficult to go back and
change something.
No working software is produced until late during the life cycle.
High amount of risk and uncertainty.
Not a good model for complex projects.
Resources are not fully utilized.

V-Model:

V- Model means Verification and Validation model. Each phase must be completed
before the next phase begins. Testing of the product is planned in parallel with a
corresponding phase of development in V-model.

As V Model specifies that test plan should be started from the beginning when
requirement phase starts. In above V Model you will see when requirement phase
completed acceptance testing and system testing has been planned in parallel.
Similarly once design phase completes, Integration testing should be planned and
finally once coding phase completes, Unit testing should be planned.
During the execution, testing starts from Unit testing and carries up to Acceptance
testing to make sure the application meets all the development phases and working
as per expectation.

Advantages:

Simple and easy to use.


Many testing activities are performed in the beginning like planning and design
which saves lots of testing time.
Most of the defects and bugs are found in the beginning of the project
development. So less chances of defect or bug to be occurred at final testing
phase.
Works well for small projects where requirements are easily understood.

Disadvantages:

Less flexibility.
Software is developed during the implementation phase, so no early prototypes
of the software are produced.
If any changes happen in midway, then the test documents along with
requirement documents has to be updated.

Prototype Model:

In prototype model, instead of freezing the requirements before coding can precede, a
throwaway prototype is built to understand the requirements. A prototype acts as a
sample to test the process. Prototype is a working model of software with some limited
functionality.
This type of System Development Method is employed when it is very difficult to
obtain exact requirements from the customer (unlike waterfall model, when
requirements are clear). While making the model, user keeps giving feedbacks from
time to time and based on it, a prototype is made. Completely built sample model is
shown to user and based on his feedback, the SRS (System Requirements
Specifications) document is prepared. After completion of this, a more accurate SRS
is prepared, and now development work can start.

Advantages:

Users are actively involved in the development.


Since in this methodology a working model of the system is provided, the users
get a better understanding of the system being developed.
Errors can be detected much earlier.
Missing functionality can be identified easily.

Disadvantages:

Practically, this methodology may increase the complexity of the system.


Users may get confused in the prototypes and actual systems.
The effort invested in building prototypes may be too much if not monitored
properly.
As changes can be there frequently, it can lead to slow process.
Too many changes can disturb the rhythm of the development team.

Spiral Model:
Planning: Requirements are gathered during the planning phase. Requirements
like BRS that is Business Requirement Specifications and SRS that is System
Requirement specifications.

Risk Analysis: Risks are identified in this phase and prototype is produced at the
end of the risk analysis phase. If any risk is found during the risk analysis then
alternate solutions are implemented.

Engineering Phase: In this phase software is developed, along with testing at the
end of the phase. Hence, in this phase the development and testing is done.

Evaluation phase: After testing the build, at the end of first iteration, the
customer evaluates the software and provides feedback.

Advantages:

Changing requirements can be accommodated.


Requirements can be gathered more accurately.
Risks are analyzed early.
Development can be divided into smaller parts and more risky parts can be
developed earlier which helps better risk management.
Changes can be introduced later in the life cycle as well.
It is suitable for high risk projects.

Disadvantages:

Cost involved in this model is usually high


It is a complicated approach.
Skills required evaluating and reviewing project from time to time, need
expertise.
Rules and protocols should be followed properly to effectively implement this
model.

SRS: This document ensures that the software vendor and the customer are in
agreement as to the features required in the software system being built. SRS is
created after the initial requirement phase in which Software vendor interacts with
the customer to understand the software needs.

SRS FRS BRS


It deals with resources It deals with requirements given by It deals with aspects of
provided by Company. client. business requirements.

It always includes Use In this Use cases are not included. In this Use cases are
cases to describe the also not included.
interaction of the
system.
It is developed by It is always developed by It is always developed
System Analyst. developers. by Business Analyst.

In SRS, we describe all In FRS, we describe the In BRS, we define what


the functional and non- functionalities of software. exactly customer
functional requirements wants. This is the
of the application. document which is
followed by team from
start to end.
SRS is a complete FRS is a document, which describes BRS is a simple
document which the Functional requirements i.e. all document, which
describes the behavior of the functionalities of the system describes the business
the system which would would be easy and efficient for end requirements on a
be developed. user. quite broad level.

What is Scrum?

Scrum is one of the most popular frameworks for implementing agile and used to
manage projects, usually software development.

Scrum involves:

A product owner that creates a prioritized wish list called a product backlog.
During sprint planning, the team pulls a small chunk from the top of that wish
list and decides how to implement those pieces.
The team has a certain amount of time a sprint (usually two to four weeks).
Along the way, the Scrum Master keeps the team focused on its goal.
At the end of the sprint, the work should be potentially shippable.
The sprint ends with a sprint review and retrospective.
As the next sprint begins, the team chooses another chunk of the product
backlog and begins working again.
How long does a scrum cycle last? Who are involved in Scrum cycle?

Scrum cycle depends on the type of project the team is working on, usually, it
ranges about 2-4 weeks. In scrum cycle, it includes:

Product owner
Scrum master
Team

List out what are the artifacts of Scrum process?

Scrum process artifacts include

Product backlog
Sprint backlog
Velocity chart
Burn-down chart

Roles of Product Owner:

This person owns the Product backlog and writes user stories and acceptance
criteria.
Product Backlog is prioritized by him and he decides the release date and the
content.
He accepts or rejects user stories.
He has the power to cancel the Sprint, if he thinks the Sprint goal is
redundant.
He is the one who is responsible for the Return on Investment of the product.

Roles of Scrum master:

The Scrum Master is often considered a coach for the team, helping the team
do the best work it possibly can.
Removes any impediments.
Working with the product owner to make sure the product backlog is in good
shape.
He protects the team from external and internal distractions.

What is a Product backlog in Scrum?


The Product Backlog is a prioritized list containing list of all things that needs to
be done within the project.
The Product Owner creates, maintains, and re-orders the Product Backlog.
Product Owner owns the product backlog, he is the one who prioritize it based
on the customers feedback or business value..
The product backlog acts as an input to the sprint backlog when comes to
functionality.

What is Sprint backlog in Scrum?

The Sprint Backlog is created during the Sprint Planning Meeting.


Sprint backlog is a subset of product backlog.
The items in the Sprint Backlog are frozen after the Sprint Planning and
cannot be removed.
However, it might be necessary to get more information or clear some of the
items during the Sprint, which should be done in the presence of the Product
Owner.

Different meetings in Scrum:

Sprint Planning Meeting:

It is an 8 hour marathon meeting.


It has two parts of four hours each.
The first part is used to identify the features that are to be included in the
sprint.
The second half is used to make rough estimates of time required for each of
the features for analyzing, designing, coding, testing and documentation.
Its up to the Product Owner to decide which stories are of the highest
priority and put it into the upcoming sprint first.

Sprint Daily Standup Meeting:

What did you do since the last Scrum Meeting?


What are the obstacles?
What will you are doing until the next Scrum Meeting?

Sprint Review Meeting:


During this meeting the Product Owner, Scrum Master and stakeholders are
present to review the product and suggest changes or improvements.
Features that fulfill the definition of done, provided by the product owner, are
accepted. Those not completed or partially completed decided during next
sprint planning meeting.

Sprint Retrospective Meeting:

The purpose of Retrospective meeting is to discuss with team what processes


or practices went well during the sprint?
What process and practices need to be improved?

Explain the term Increment?

The term Increment is used to refer the total number of product backlog items
completed during the sprint and all previous sprints.

Explain what is Sashimi and Impediments?

Sashimi: It is used to define the specific task when it is completed.

Impediments: Any obstacle that prevents the team members from performing
their work is referred as impediments

What is a Story Point?

Story points are a unit of measure to tell an estimate of the overall effort that will
be required to complete a product backlog item. We assign a point value to each
item. The raw values we assign are unimportant but what matters are the relative
values. Instead of assigning 1, 2 and 3, that team could instead have assigned 100,
200 and 300 or 1 million, 2 million and 3 million. It is the ratios that matter, not the
actual numbers.

What Goes Into a Story Point?

The amount of work to do


Any risk or uncertainty in doing the work
The complexity of the work

The Amount of Work to Do


Certainly, if there is more to do of something, the estimate of effort should be
larger. Consider the case of developing two web pages. The first page has only one
field and a label asking to enter a name. The second page has 100 fields also and
simply be filled with a bit of text.

Risk and Uncertainty

The amount of risk and uncertainty in a product backlog item should affect the
story point estimate given to the item.

Complexity

Complexity should also be considered when providing a story point estimate. Think
back to the earlier example of developing a web page with 100 trivial text fields
with no interactions between them.

Now think about another web page also with 100 fields. But some are date fields
with calendar widgets that pop up. Some are formatted text fields like phone
numbers or Social Security numbers. Even though there are still 100 fields on this
screen, these fields are harder to implement. Theyre more complex. This additional
complexity should be reflected in the estimate provided.

Explain what velocity in scrum is and how it is measured?

Velocity is a measure of the amount of work a Team can tackle during a


single Sprint. You need to successfully complete at least 3-5 sprints to have better
visibility.

Example: Our team delivers 3 user stories. The sum of the story points equals 20.
Our velocity is then 20. If, in the next iteration, our team delivers 30 story points,
then our average velocity is 25, or (20 SP + 30 SP) divided by 2 iterations = 25 SP.

Formula: Velocity= Number of total story points / One iteration

Theme: A collection of stories by category.

Epic: A requirement that is just too big to deliver in a single sprint. Epics need to
be broken into smaller deliverables. Usually, 5-10 user stories comprise of one Epic
in agile methodology.
User Stories: A user story is simply something a user wants. They are known as
Requirements that describes what a user wants and why. A user story template
often uses the following type of format:

Explain what is re-factoring?

To improve the performance, the existing code is modified, this is re-factoring.


During re-factoring the code functionality remains same.

Explain what is Sprint Zero and Spike in Agile? What is the purpose of it?

Sprint Zero: In Scrum, theres no standard way of naming each sprint. Some
organizations adopt the practice of having a Sprint 0 before the project actually
kicks off. During this time the scrum team might be assembled and technical issues
like hardware or software issues are sorted out. Sprint zero might also be used in
some organizations to train and coach a team that is entirely new.

Spikes: Sometimes, a team is not sure how to solve a problem and cant estimate
a story. So spike is a technique which is used in these situations. It is a time boxed
research effort to understand what would be the best solution to solve the problem.
The output of the spike is an estimation of the story.

Explain in Agile, burn-up and burn-down chart?

A Burndown Chart shows how much work is remaining to be done in the project. As
time progresses we keep track how much work is still not done.

In Burnup Chart The only difference is that instead of tracking how much work is
left to be done, we track how much work weve completed, so the curve is going
up, not down.

Advantages of Scrum:

Agile scrum helps the company in saving time and money.


Due to short sprints and constant feedback, it becomes easier to cope with the
changes.
Daily meetings make it possible to measure individual productivity. This leads to
the improvement in the productivity of each of the team members.
Issues are identified well in advance through the daily meetings and hence can
be resolved in speedily.
Large projects are divided into easily manageable sprints.
It is easier to deliver a quality product in a scheduled time.

Disadvantages of Scrum:
If a task is not well defined, estimating project costs and time will not be
accurate.
This methodology needs experienced team members only.
If any of the team members leave during a development it can have a huge
inverse effect on the project development.
Scrum often leads to scope creep, due to the lack of a definite end-date.
Daily meetings sometimes frustrate team members.

Unit Testing: It is basically done by the developers to make sure that their code is
working fine and meet the user specifications. They test their piece of code which
they have written like classes, functions, interfaces and procedures by executing
them.

Mutant Testing: Mutation Testing is a type of software testing where we mutate


(change) certain statements in the source code and check if the test cases are able
to find the errors. It is a type of white box testing which is mainly used for unit
testing. The changes in mutant program are kept extremely small, so it does not
affect the overall objective of the program.

Component Testing: Component testing is one of the testing technique in which


the testing is performed on each individual component separately without
integrating with other components. It is performed by testers.

Example: There are two web pages. In one of the web pages there are many fields
like username, address, mobile no. etc. in which data has to be entered. In the
other (second) web page also there are certain fields which carry forward the data
from the first page. Testing the functionality of these individual pages is called
Component Testing.

Integration testing: When individual software modules are merged and tested as
a group than it is known as integration testing. For example you have to test the
keyboard of a computer than it is a unit testing but when you have to combine the
keyboard and mouse of a computer together to see its working or not than it is the
integration testing.
Bottom-Up Approach: Bottom up testing, as the name suggests starts from the
lowest and gradually moves up. Suppose, modules B1C1, B1C2 & B2C1, B2C2 are
the lowest module which is unit tested. Module B1 & B2 are not yet developed. So,
we would need some program or a stimulator which will call the B1C1, B1C2 &
B2C1, B2C2 modules. These stimulator programs are called DRIVERS.

Top-Down Approach: This technique starts from the top most module and
gradually progress towards the lower modules. In the context of our figure, testing
starts from Module A, and lower modules B1 and B2 are integrated one by one.
Now here the lower modules B1 and B2 are not actually available for integration. So
in order to test the top most modules A, we develop STUBS.

There is another approach which is called Sandwich Approach which combines the
feature of both Bottom-up and Top-down approach and starts from middle layer
and moves up and down simultaneously.

Big Bang Testing: In Big Bang integration testing all components or modules are
integrated simultaneously, after which everything is tested as a whole. Because of
integrating everything at one time if any failures occur then it becomes very
difficult for the programmers to know the root cause of that failure.

Regression Testing: When an update is done or bug has been fixed, we do


Regression testing. Suppose, a developer has made a major change into the system
which can impact existing functionality, in that case we do regression testing. It is
an end to end testing.

Example: Suppose, there are 10 modules in the system and change has been
made in almost all modules, then we do regression testing to ensure all the
impacted sections are also working fine.

Retesting: Retesting is the testing of a specific bug after it has been fixed.
Suppose, there is an error on login page. User is able to login with invalid
credentials, which is incorrect.
Sanity Testing: Sanity testing is a kind of Software Testing performed after
receiving a software build, with minor changes in code, or functionality, to ascertain
that the bugs have been fixed and no further issues are introduced due to these
changes. The objective of the testing is to verify the "rationality" of the system.

Smoke Testing: It is done after build deployment to ensure that critical


functionalities are working fine. Now testing team can start testing.

Example, developer fixes the bug or develops new functionalities and gives the App
URL to the tester and asks them to test the application in 15 days or available time
frame. Now suppose URL is not working, tester will report this to developer and will
ask him to raise a defect, then developer fixes it in next 5 days and now tester only
has 10 days left to test the application. So to avoid that situation, when developer
asks to start the testing, we will first email and tell them that let us begin smoke
testing and only after that we will ensure that we will be able to test the application
or not. Here, tester will just test the critical functionalities of the application and if
found any error in the application, tester will ask the developer instantly to fix that
bug and till then will not start testing on the application. Tester takes only 30min to
an hour to perform smoke test high priority test cases of the application.

Smoke Testing Sanity Testing

Smoke Testing is performed to ascertain


Sanity Testing is done on critical or high
that the critical functionalities of the
priority test cases.
program are working fine.

Smoke testing is usually documented or Sanity testing is usually not documented


scripted. and is unscripted.

Smoke testing is a subset of Regression Sanity testing is a subset of Acceptance


testing. testing.

Sanity testing exercises only the


Smoke testing exercises the entire
particular component of the entire
system from end to end.
system.

Smoke testing is like General Health Sanity Testing is like specialized health
Check Up. check.

System Testing: The process of testing of an integrated hardware and software


system to verify that the system meets its specified requirements. It is non-
functional type of testing.

Example: you are doing testing on a web application of a school and in this web
application there are many modules like Teacher Module, Staff Module, Parent
Module, Student Module, and Admin Module and so on. Now you have to do System
Testing on a web application of a school, so your criteria for doing System Testing
will be:

1. First you test the GUI related issues on.

2. Now, you move towards functionality related issues by checking that the
requirements of client have been met or not.

3. After checking functionality you can check whether the application is user
friendly or not by checking that proper error message should be displayed on
screen or not.

End to End testing: End-to-end testing is a technique used to test whether the
flow of an application right from start to finish is behaving as expected. The entire
application is tested in a real-world scenario such as communicating with the
database, network, hardware and other applications. End to End Testing is usually
executed after functional and system testing.

Example: Suppose you are logging in to Gmail than End to End Testing is that after
login you get into inbox or not, you are able to open and compose a mail or not,
you are able to forward the mail or not, then finally you are able to logout from the
Gmail or not.

End to End Testing System Testing

Validates the software system as well Validates just the software system as per
as interconnected sub-systems the requirements specifications.

It checks the complete end-to-end It checks system functionalities and


process flow. features.

All interfaces, backend systems will be Functional and Non-Functional Testing will
considered for testing. be considered for testing.

It's executed once system testing is


It's executed after integration testing.
completed.

End to End testing involves checking


external interfaces which can be Both Manual and Automation can be
complex to automate. Hence Manual performed for system testing.
Testing is preferred.

Acceptance testing: After the system test, the system will be delivered to the
user or customer for acceptance testing. Acceptance testing is basically done to
ensure that the requirements of the specification are met. Acceptance Testing is
carried out by the users to determine whether they accept the delivery of the
system or not. It is normally performed by users and sometimes developers are
also involved in it.

Alpha testing: Alpha testing is the last testing done by test teams at development
site after the acceptance testing and before releasing the software for beta test.

Example: if you are a customer and wanted some product for your company. Then
after completion, before delivering to you, testers will test that product within
software house to check whether it is working according to customers requirement.
Thats why, it is called acceptance testing or in-house testing.

Beta testing: It is done at the customers site by real users and can be considered
as a form of external user acceptance testing.

Beta version of the software is released to a limited number of end-users of the


product to obtain feedback on the product quality. Beta testing reduces product
failure risks and provides increased quality of the product through customer
validation.

Adhoc testing:

It is performed without proper planning and documentation.


Here, knowledge of testers must be very high and is done after completion of
formal testing.
It does not follow any test cases and doesnt create one.
Testers randomly test the application without any test cases.
This testing is performed with the aim to break the application without
following any process.
Sometimes, it becomes difficult to reproduce a bug because no test cases are
followed here.
It is done when there is limited time to perform elaborate testing.
Adhoc testing can be achieved with the testing technique called Error
Guessing.
Types are Buddy testing, Pair testing and Monkey testing.

Exploratory testing:

Exploratory testing is about exploring, finding out about the software, what it
does, what it doesnt do, what works and what doesnt work.
The quality of the testing is dependent on the tester's skill of inventing test
cases and finding defects.
Here, testers are involved in minimum planning and maximum test
execution.
This is an approach that can be used when there are no or poor specifications
and when time is severely limited.
The main advantage of exploratory testing is that less preparation is
required, new bugs can be found, encourages creativity and can cover some
missing steps in test cases.

Error Guessing: This is a Test design technique where the experience of a tester is
used to find the components of software where defects might be present. It is
mostly done by experienced testers who can use their past experience to find
defects in software.

In error guessing testers can think of situations where software will fail.

For example:

Division by zero
Pressing submit button on form without filling any entries.

Functional testing: Functional testing is a type of testing which verifies that


each function of the software application operates according to requirement
specification. This testing mainly involves black box testing and it is not concerned
about the source code of the application.
Each functionality of the system is tested by providing appropriate input, verifying
the output and comparing the actual results with the expected results.

Example: Considering if you are functionally testing a word processing application,


you would perform at least check creating, saving, editing, spell checking and
printing documents. It can be classified into two types:

Positive Functional Testing: This testing carries testing the applications


functions with valid input. In the word processing example, a positive test for the
printing function might be to print a document containing both text as well as
graphics to a printer that is online.

Negative Functional Testing: This testing involves testing application


functionality using a combination of invalid inputs, some unexpected operating
conditions and by some other scenarios. So, a negative test for the printing
function might be to disconnect the printer from the computers while a document is
printing.

Non-Functional Testing: Like functional testing, there are non-functional


requirements like Performance, Endurance, Load, Volume etc. that are also
important for testing.

Performance testing: It involves testing software applications to ensure they will


perform well under their expected workload. The focus of Performance testing is
checking a software programs:

Speed - Determines whether the application responds quickly


Scalability - Determines maximum user load the software application can
handle.
Stability - Determines if the application is stable under varying loads

Endurance testing: It is also called Soak testing and involves testing a system
with a significant load extended over a significant period of time, to discover how
system behaves under sustained use.

Example: In software testing, a system may behave exactly as expected when


tested for 1 hour but when the same system is tested for 3 hours, problems such as
memory leaks cause the system to fail or behave randomly or database connection
is not successfully or responsive time of the system.

Load testing: Load testing is performance testing technique and is to understand


the behavior of the system under a specific expected load. The main goal of load
testing is to identify the upper limit of the system in terms of database, hardware
and network etc.

Example:

Downloading a series of large files from the internet.


Running multiple applications on a computer or server simultaneously.
Assigning many jobs to a printer in a queue.
Large amount of users testing the system simultaneously.

Stress Testing: It involves testing the system beyond normal operational capacity,
often to a breaking point, in order to observe the results. The goals of such tests
may be to ensure the software does not crash in such conditions.

Example: During festival time, an online shopping site may witness a huge amount
of traffic, or when it announces a sale.

Volume testing: Volume testing refers to testing a software application with the
large amount of data. It is also referred as flood testing.

Example: Testing behaviour of music website when there are millions of user to
download the song.

Spike Testing: Spike Testing is a form of testing process in which an application is


tested with unusual increment and decrements in the load. It is done to notice how
actually the system reacts with there is sudden rise and decline of users.

Example: A fire alarm goes off in a major business centre - all employees
evacuate. The fire alarm drill completes and all employees return to work and log
into an IT system within a 20 minute period.

Scalability Testing: It is the ability of a system, a network, or a process to


continue to function well, when it is changed in size or volume in order to meet a
growing need.

Example: An ecommerce site may be able to handle orders for up to 100 users at
a time but scalability testing can be performed to check if it will be able to handle
higher loads during peak shopping seasons.

Reliability Testing: Reliability Testing is about testing an application so that


failures are discovered and removed before the system is deployed. Reliability
testing is a type of testing to verify that software is capable of performing a failure-
free operation.
Example: The probability that a PC in a store is up and running for eight hours
without crashing is 99%; this is referred as reliability.

Usability testing: In usability testing basically the testers tests the ease with
which the user interfaces can be used. It tests that whether the application or the
product built is user-friendly or not.

Example: Lets say a user needs to print a Financial Update Report, every 30
minutes, and he has to go through many steps to just print a report. If the report is
to be printed frequently, wouldnt it be convenient if the user could get the job done
in a couple of clicks, rather than having to go through numerous steps What if there
was a feature to save frequently generated reports as a template and if the saved
reports were readily available for printing from the homepage?

Accessibility Testing: It is a subset of usability testing, and it is performed to


ensure that the application being tested is usable by people with disabilities like
hearing, colour blindness, old age and other disadvantaged groups.

Maintainability testing: It basically defines that how easy it is to maintain the


system. This means that how easy it is to analyze, change and test the application
or product. As software keeps on changing throughout the cycle, we should ensure
how much effort it would need to make a change.

Portability testing: It is a type of testing in which Software application is installed


from one environment to other or from one platform to another platform with
different hardware and software configuration. The whole purpose is to check
whether application is able to run and can be deployed in different applicable
environment.

Compatibility testing: It is a type of Software testing to check whether your


software is capable of running on different hardware, operating systems,
applications, and network.

Interoperability testing: It is a type of testing to check whether software can


inter-operate with other software component, software's or systems.

Example: Smartphone and tablet to check data transfer via Bluetooth.

Recovery testing: It is done in order to check how fast and better the application
can recover after it has gone through any type of crash or hardware failure etc.
Example: Restart the system while a browser has a definite number of sessions
and check whether the browser is able to recover all of them or not.

Monkey testing: It is a technique in software testing where the user tests the
application by providing random inputs and checking the behavior. User enters any
random invalid inputs and checks the behavior. There are no rules; this technique
does not follow any predefined test cases.

Advantage: New kind of bugs, easy to execute, not so skilled resources required
and less costly.

Disadvantage: Bug found is hard to reproduce and less bugs found.

Gorilla testing: A testing technique that involves testing a particular module or


functionality extensively with various ranges of valid and invalid inputs. There is no
particular test strategy for these test techniques.

Pilot Testing: Pilot testing is when a selected group of end users try the system
before deployment, to provide feedback about the product. This testing is done
exactly between the UAT and Production.

Internationalization testing and Localization testing: Internationalization is a


type of testing where we validate if the software can adapt to various languages
and regions without any changes. Whereas, Localization testing validates adapting
a specific region or language only.

For Example, take a Zip code field in sign up form:

a) If the application is globalized then it will allow to enter alphanumeric inputs.


b) If the application is localized (if it is INDIA) then it will allow to enter only
numbers.

Efficiency Testing: It is how efficiently the available resources (time, hardware,


personnel, expertise etc.) were utilized to create the Software product. Let us
assume that there are two Test teams with equal number of resources working on
the same product, and If Test team "A" has prepared 500 Test cases for the
product in 10 days and for the same product if Test team "B" prepares 500 Test
cases in 8 days, then which team can we say is efficient? Definitely Test team "B" is
efficient, but there is no guarantee that Test team "B" is effective, we are not sure
how many defect can Test team "B" uncover as compared to Test team "A".

Compliance Testing: It is also known as Conformance testing and a type of non-


functional software testing. It is done to validate weather the system developed
meets the organizations prescribed standards or not.

Documentation Testing: It is a type of non-functional testing. Testing of test


case specification, test incident report, test log, test plan, test procedure, test
report are called documentation testing.
Concurrency testing: Concurrency Testing is defined as a testing technique to
detect the defects in an application when multiple users are logged in. In other
words, monitoring the effect while multiple users perform the same action at the
same time.

Security testing: It is a testing which ensures, that system and applications in an


organization, are free from any loopholes that may cause a big loss. It checks to
see if the application is vulnerable to attacks, if anyone hack the system or login to
the application without any authorization.

Example: A basic security test which anyone can perform on a web application:

Log into the web application.


Log out of the web application.
Click the BACK button of the browser (Check if you are asked to log in again or
if you are provided the logged-in application.)

Vulnerability Assessment: Vulnerability analysis, also known as vulnerability


assessment, is a process that defines, identifies, and classifies the security holes in
a computer, network, or communications infrastructure

Penetration Testing: Penetration testing is a type of security testing where you


know your vulnerabilities and find out what type of information could be revealed if
it was exploited.

Product Risk: Product risk is the risk associated with the software or system, the
possibility that software or system may fail to satisfy end user

Project Risk: Risks that can cause danger to the project. Includes: late delivery of
the test items to the testing team, Delay in the test build to test team, unavailablity
of the test environment.

Test Harness: In software testing, a test harness or automated test framework is


a collection of software and test data configured to test a program unit by running
it under varying conditions and monitoring its behavior and outputs.

Risk Based Testing: A risk is something that has not happened yet and it may
never happen in future as well. Risk is the possibility of a negative or undesirable
outcome or event. Risk based testing is prioritizing the features, modules and
functions of the application based on impact and likelihood of failures.

Risk Management activities:

1. Risk Identification:. We need to identify both project and product risk by using
certain techniques like using risk templates, interviewing the stakeholders, project
retrospectives etc.
2. Risk Analysis: No, you will categorize the risks and then need to determine the
level of risk by specifying likelihood and impact of the risk.

3. Risk Mitigation or Risk Control: Each risk in the risk list is subject to one or
more of the following Risk Treatments:

a. Risk Mitigation: This is a common risk treatment. The objective of Risk


Mitigation is to reduce the Risk Impact or Risk Probability or both. For example, if
the testing team is new and does not have prior system knowledge, a risk
mitigation treatment may be to have a knowledgeable team member join the team
to train others on-the-fly. Risk Mitigation also increases the project cost.

b. Risk Transfer: For example, if the risk is insufficient security testing of the
system, it may be possible to hire a specialized company to perform the security
testing. Risk Transfer takes place when this vendor is held accountable for ample
security testing of the system. Risk Transfer increases the project cost.

c. Risk Avoidance: For example, if there is a risk related to a new component, it


is possible to postpone this component to a later release. Risk Avoidance is
uncommon because it impacts the project objectives e.g. delivery of new features.

d. Risk Acceptance: Any risk not treated by any prior treatments has to be
accepted. This happens when there is no viable mitigation available due to reasons
such as cost. For example, if the test environment has only one server, risk
acceptance means not building another server. If the existing server crashes, there
will be down-time and it will be a real issue in the project.

Web testing: Web testing in simple terms is checking your web application for
potential bugs before making it live During this stage, issues such as web
application security, the functioning of the site, its ability to handle traffic is
checked. It checks Test Forms, Cookies, HTML errors, navigation, and security.

Benchmarking testing: It is the process of comparing application performance


with respect to industry standard which is given by some other organization.
Benchmark informs us where our application stands with respect to others.
Benchmark compares our application performance with other companys
applications performance.

Baseline testing: It is the process of running a set of tests to gather performance


information. Baseline testing uses the information to improve performance and
capabilities of the application. Baseline compares present performance of
application with its own previous performance.
Impact analysis: It is basically analyzing the impact of the changes in the
deployed application or product. It tells us about the parts of the system that may
be unintentionally affected because of the change in the application and therefore
need careful regression testing. This decision is taken together with the
stakeholders.

Traceability Matrix: A Requirements Traceability Matrix is a document that traces


and maps user requirements with the test case ids. Purpose is to make sure that all
the requirements are covered in test cases so that while testing no functionality can
be missed.

Types of Traceability Matrix:

Forward Traceability: Mapping of Requirements to Test cases. This matrix is used


to check whether the project progresses in the desired direction and for the right
product.
Backward Traceability: Mapping of Test Cases to Requirements. The purpose
behind this type of traceability is to verify that we are not expanding the scope of
the project by adding code or other work that is not specified in the requirements.

Advantages of Traceability Matrix:

1. It confirms 100% test coverage


2. Easy to identify the missing functionalities.
3. If there is a change request for a requirement, then we can easily find out which
test cases need to update.
Test Documentation: Testing documentation involves the documentation of artifacts
that should be developed before or during the testing of Software. This includes, Test
Plan, Test design, Test Summary report, Weekly status report, Test log etc.

Test Case: A test case is a document containing set of conditions under which a
tester will determine whether system or functionality is working fine.

TEST CASE EXAMPLE / TEST CASE SAMPLE

Test Suite ID TS001

Test Case ID TC001

Test Case
To verify that clicking the Generate Coin button generates coins.
Summary

Type of Test
Positive/Negative
Case

Priority Priority of the Test case

Severity Severity of the Test case.


Related
RS001
Requirement

1. User is authorized.
Prerequisites 2. Coin balance is available.

1. Select the coin denomination in the Denomination field.


2. Enter the number of coins in the Quantity field.
Test Procedure
3. Click Generate Coin.

1. Denominations: 0.05, 0.10, 0.25, 0.50, 1, 2, 5


Test Data 2. Quantities: 0, 1, 5, 10, 20

1. Coin of the specified denomination should be produced if


the specified Quantity is valid (1, 5)
Expected Result 2. A message Please enter a valid quantity between 1 and
10 should be displayed if the specified quantity is invalid.

1. If the specified quantity is valid, the result is as expected.


2. If the specified quantity is invalid, nothing happens; the
Actual Result
expected message is not displayed

Status Fail

Remarks This is a sample test case.

Created By John Doe

Date of
01/14/2020
Creation

Executed By Jane Roe

Date of
02/16/2020
Execution

Test
OS: Windows Y
Environment
Browser: Chrome N

Defect: Defect is the difference between expected and actual result in the context
of testing. Defect is the deviation of the customer requirement. Defect is an error
found after the application goes into production.

Categories of defects - There are three main categories of defects:

Wrong: The requirements have been implement the wrong way. This defect is a
variance from the given specification.
Missing: There was a requirement given by the client and it was not done.

Extra: A requirement implemented into the product that was not given by the end
customer.

Error: It is the one which is generated because of wrong login, loop or due to
syntax. It may be syntactical error or Logical error.

Bug: A programming error that causes a program to work poorly, produce incorrect
results, or crash before the application going to production.

Fault: An incorrect step in a computer program which causes the program to


perform in an unanticipated manner.

Failure: It is the deviation of an expected result from actual result. It occurs when
defect is visible to the end user. Not all defects result in failures, some may stay
inactive in the code and we may never notice them. Example: Defects in dead code
will never result in failures.

Work bench: It is a way of documenting how a specific activity has to be


performed. A work bench is referred as phases, steps and tasks. Concept contains:
Input, Execute, Check, Rework.

Defect Life Cycle:

Defect life cycle, also known as Bug Life cycle is the journey of a defect cycle, which
a defect goes through during its lifetime.
New: When a new defect is logged and posted for the first time. It is assigned
a status NEW.

Open: After a tester has posted a bug, the lead of the developer approves that
the bug is genuine and he changes the state to "OPEN".
Assigned: Once the lead changes the state to "open", he assigns the bug to
corresponding developer or developer team. The state of the bug now is
changed to "ASSIGN".
Test: When developer makes necessary code change, fixes the bug and verifies
the change, he changes the status to Test.
Verified: The tester re-tests the bug after it got fixed by the developer. If
there is no bug detected in the software, then the bug is fixed and the status
assigned is "verified.

Closed: If the bug is no longer exits then tester assign the status "Closed."

Reopen: If the bug persists even after the developer has fixed the bug, the
tester changes the status to "reopened". Once again the bug goes through the
life cycle.

Rejected: If the developer feels the defect is not a genuine defect then it
changes the defect to "rejected."

Deferred: If the present bug is not of a prime priority and if it is expected to


get fixed in the next release, then status "Deferred" is assigned to such bugs.
Test Case Design: The purpose of test design techniques is to identify test
conditions and test scenarios through which effective and efficient test cases can be
written. Test design techniques help in achieving high test coverage.

Equivalence Partitioning: In this technique, you divide the set of test condition
into a partition that can be considered the same.

Example: you are testing for an input box accepting numbers from 1 to 1000 then
there is no use in writing thousand test cases for all 1000 valid input numbers.
Using equivalence partitioning method above test cases can be divided into three
sets of input data called as classes.

One input data class with all valid inputs. Pick a single value from range 1 to
1000 as a valid test case.
Input data class with all values below lower limit. I.e. any value below 1, as
an invalid input data test case.
Input data with any value greater than 1000 to represent third invalid input
class.

Boundary Value Analysis: It is based on testing at the boundaries between


partitions. Here we have both valid boundaries and invalid boundaries.
Example: In our earlier example instead of checking, one value for each partitions
you will check the values at the partitions like 0, 1, 999, 1000, and 1001. As you
may observe, you test values at both valid and invalid boundaries. Boundary Value
Analysis is also called range checking.

Decision table: Decision Table Testing is a good way to deal with a combination of
inputs, which produce different results. It helps reduce test effort in verifying each
and every combination of test data, at the same time ensuring complete coverage

Example: To understand the importance of Decision Table Making we will see an


example, let's consider the behavior of Flight Button for different combinations of
Fly From & Fly To.

Rule 1: When destination for both Fly From & Fly To are not set the Flight Icon is
disabled. In the decision table, we register values False for Fly From & Fly To and
the outcome would be False, which is Flights Button will be disabled. Likewise, you
can decide different outcome for different situation.

Rule 2: When Fly From destination is set but Fly to is not set, Flight button is
disabled. Correspondingly, you register True for Fly from destination in the decision
table, and the rest of the entries are false.

Rule 3: When Fly from destination is not set but Fly to destination is set, Flight
button is disabled and you make entries in the decision table.

If you observe the outcomes for Rule 1, 2 & 3 it remains the same. So you can
select any one of them and rule 4 for your testing.

Rule 4: only when fly to and Fly from destinations is set, Flights button is enabled
and you make the corresponding entry in the decision table.

State Transition: State Transition testing is defined as the testing technique in


which changes in input conditions causes state changes in the Application.
Use Case: It is used widely in developing tests at system or acceptance level. Use
Case Testing, is a technique that helps identify test cases that cover the entire
system, on a transaction by transaction basis from start to the finishing point.

White-box testing: It is a software testing method in which the internal structure


of the item being tested is known to the tester. White Box Testing is like the work
of a mechanic who examines the engine to see why the car is not moving.

Black-box testing: also known as Behavioral testing is a software testing method


in which the internal structure of the item being tested is not known to the tester.

Gray-box testing: Gray Box Testing is a technique to test the software product or
application with partial knowledge of the internal workings of an application.

Black Box Testing Grey Box Testing White Box Testing


1. The Internal Workings of Somewhat knowledge of Tester has full
an application are not the internal workings are knowledge of the
Required to be known. Known. Internal workings of
the application.
2. Also known as closed box Another term for grey box Also known as clear
testing, data driven testing is translucent box testing, structural
testing and functional testing as the tester has testing or code based
Testing. limited knowledge of the Testing.
inside of the application.
3. Performed by end users Performed by end users Normally done by
and also by testers and and also by testers and Testers and developers.
Developers. Developers.
4. This is the least time Partly time consuming The most exhaustive
consuming and & exhaustive. and time consuming
Exhaustive. type of testing.
5. Not suited to algorithm Not suited to algorithm Suited for algorithm
Testing. Testing. Testing.

Test Coverage: Coverage is a measure used in software testing to describe to the


degree to which the source code is tested.

Nodes ( , ) represent statement of code [E.g.: entry, exit,


decisions]
Edges ( ) represent links between nodes

Statement Coverage: Statement coverage is also known as line coverage. The


statement coverage covers only the true conditions.

The statement coverage can be calculated as shown below:


(Number of statements exercised/Total number of statements)*100

In the above example, in case of Yes, while traversing through each statement of
code and the traversing path (A1-B2-C4-5-D6-E8), all the nodes are covered. So
by traveling through only one path all the nodes (A, B, C, D and E) are covered.

Statement coverage (SC) =1

Branch/Decision Coverage: Decision Coverage is also known as Branch


Coverage. Whenever there are two or more possible exits from the statement like
an IF statement, a DO-WHILE or a CASE statement it is known as decision.

Decision Coverage= (Number of decision outcomes executed/Total number of


decision outcomes)*100%

In the above example, in case of traversing through a Yes decision, path (A1-B2-
C4-5-D6-E8), maximum numbers of edges (1, 2, 4, 5, 6 and 8) are covered but
edges 3 and 7 are left out. To cover these edges, we have to follow (A1-B3-5-
D7). So by travelling through two paths (Yes, No), all the edges (1, 2, 3, 4, 5, 6, 7,
8) are covered.

Branch Coverage /Decision Coverage (BC) = 2

Path Coverage: In this the test case is executed in such a way that every path is
executed at least once. Flow Graph, Cyclomatic Complexity and Graph Metrics are
used to arrive at basis path. All the possible paths are:

A1-B3-5-D7
A1-B2-C4-5-D6-E8
A1-B2-C4-5-D7
A1-B3-5-D6-E8
Path coverage (PC) = 4

Condition Coverage: Condition coverage is also known as Predicate Coverage in


which each one of the Boolean expression have been evaluated to both TRUE and
FALSE.

Code Coverage: Code Coverage testing is determining how much code is being
tested. It can be calculated using the formula:
Code Coverage = (Number of lines of code exercised)/ (Total Number of lines of
code)*100%

Web server: It is a program that uses HTTP to serve to the requested user.

Example: If you enter the URL http://www.webopedia.com/index.html in


your browser, this sends a request to the Web server whose domain name
is webopedia.com. The server then fetches the page named index.html and sends it
to your browser.

Any computer can be turned into a Web server by installing server software and
connecting the machine to the Internet.

Web Services: The term Web services describes a standardized way of integrating
Web-based applications using the XML, SOAP, WSDL and UDDI open standards over
an Internet. XML is used to tag the data, SOAP is used to transfer the data, WSDL
is used for describing the services available and UDDI is used for listing what
services are available. It provides a platform which allows different applications to
talk to each other.

Testing Estimation Technique: Imagine a client, who came to the software


company to talk about details of the project. He will be interested in two questions:
how long will all process take and how much will it cost. Obviously, to answer these
questions we need to estimate certain parameters, namely "Price", "Time",
"Resources" and "Human Skills". So to evaluate the whole process, we have to use
Estimation techniques:

Work Breakdown Structure:

Here, we divide a common task into subtasks (or sub-modules). These


subtasks are further divided into smaller components. And so on.

Company owners and project managers use the Work Breakdown


Structure (WBS) to make complex projects more manageable.

The project manager determines the main deliverables for the project.

Once this is completed, they start decomposing the deliverables they


have identified, breaking them down to successively smaller modules of
work.

There could be a two weeks rule, where nothing is broken down any
smaller than it would take two weeks to complete. You can also use the
8/80 rule, where no chunk would take less than 8 hours or longer than 80
hours to complete.

Three Point Estimation:

Three point estimation is based on statistical data and experience team is


required to estimate. It is very much similar to WBS technique, tasks are
broken down into subtasks & three types of estimation are done on this
sub pieces.

The Optimistic(A) case to complete a task is supposing 120 man-hours


(around 15 days). In this case, you have a talented team, they can finish
the task in smallest time.

The Most likely(M) case to complete this task is suppose 170 man-
hours (around 21 days). This is a normal case, you have enough
resource and ability to complete the task in time.

The Worst(B) case to complete this task is supposing 200 man-hours


(around 25 days). You need to perform much more work because your
team members are not experienced.

Formula to find Value for Estimate (E) = A + (4*M) + B / 6.

E= 120 + (4*170) +200/6= 166.6 person hours.

In order to make our estimations more accurate, we need to calculate


the Standard Deviation: SD = (b-a) / 6, SD = (200-120) / 6, SD = 13.3.

So, to perform the task team needs 166.6 + - 13.3 person hours.

Functional Point Estimation:

Here also we break the project into smaller modules and depending on
how complex each module is, assign a specific functional point (FP) to it.
The more complicated unit is, the higher rate (FP) it gets.
According to this technique, the whole project is broken down into 3
groups: complex (5 functional points), medium (3) and simple (1) group.
Now suppose we have 2 complex modules, (each of which has the FP
equals 5) 10 medium, and 5 simple modules. According to this Total FP
will be equal to: Total FP = 2 * 5 + 10 * 3 + 5 * 1 = 45.
Now we need Estimate defined per Function Points which is the average
effort to complete one function points. This value depends on the
productivity of the member who will take in charge this task.
So formula to calculate Total Effort= Total FP * Estimate Defined per FP
Suppose project team has estimated defined per Function Points is
5hours/points
So, Total Effort= 45*5= 225 person hours.

Delphi Estimation:

It is an estimation method based on consensus for estimating effort.


Project manager selects a moderator and estimation with 3-7 members.
After team meeting, each team member creates an effort estimate for
each task.
In second meeting called Estimation session where the moderator charts
the estimates on the whiteboard so the estimators can see the range of
estimates.
This cycle repeats until achieve consensus.
After the estimation session, the project manager summarizes results
and reviews them with the team.

Software Testing Metrics:

Software Metrics are used to measure the quality of the project.


Test metrics are the means by which the software quality can be measured.
Without measurement it is impossible to tell whether the process
implemented is improving or not.
Types:
Product Metrics: describes the characteristics of the product such as size,
complexity, design etc.
Process Metrics: describes effectiveness of the defect removal.
Project Metrics: describes number of software developers,staffing, cost and
productivity.

QC and QA: The goal of QC is to identify defects after a product is developed and
before it's released and the goal of QA is to improve development and test
processes so that defects do not arise when the product is being developed.
Bug Release: It is when software or an application is handed over to the testing
team knowing that the defect is present in a release. During this the priority and
severity of bug is low, as bug can be removed before the final handover.

Bug leakage: It is something, when the bug is discovered by the end users or
customer, and missed by the testing team to detect, while testing the software.

Hardware tuning: Optimizing, adding or replacing the hardware components of


the system and changes in the infrastructure level to improve the systems
performance is called hardware tuning.

Authentication: It is the process with which the system identifies the user
whereas Authorization is the process after the authentication process.

The authentication is used to ensure that the user is indeed a user, who he claims
to be whereas in authorization system will decide whether a particular
functionality can be accessed by the user.

Blocking Faults: Faults that prevent further testing.

Example: If a request to a web server is generating a 500 internal server error,


thats a blocking fault. All testing of the web application is blocked until the 500
internal server error is resolved.

Latent defect is an existing defect that has not yet caused a failure just because
the exact set of conditions has never been met.

Masked defect/Masking Fault: It is an existing defect that hasn't yet caused a


failure, just because another defect has prevented that part of the code from being
executed.

Test Bed: Test bed is the environment that is required to test the software. Test
bed consists of specific hardware, software, Operating system, network
configuration, and other system software.

Cookie: Cookie is a piece of information that is stored in text file on user's system.
This piece of information is then sent back to server each time the browser requests
a page from the server. Cookie can only stores text based data like IP address,
session number, password, user visit history, no. of pages visited, etc. Cookie is
text file so it does not consume so much space on client machine. Cookie is simple
text file so can not contain any virus or malicious data.
Cookies are of 2 types:

Session Cookies: These are temporary cookie files, which are erased when
you close your browser. When you restart your browser and go back to the site
that created the cookie, the website will not recognize you. You will have to log
back in.
Persistent Cookies: These cookies are written permanently on the user
machine and it lasts for months or years.

Cache:

Whenever you visit any website first time, its page elements are
downloaded and stored in a cache folder, so if you visit that website again, it
will load faster than before. This improves your browsing speed and helps
the web pages to be quickly loaded.
Cache can store images, script files, text, audio, video, flash, banners, etc.
Cache does not get expired automatically, user has to remove it manually
from client side.
Cache can store different type of data as mentioned so consumes large
amount of space on client machine.
Cache stores different types of data so it can have malicious data.

Session: A session can be defined as a server-side storage of information that is


needed throughout the user's interaction with the web site. Instead of storing large
and constantly changing information via cookies in the user's browser, only a
unique identifier is stored on the client side called a "session id". This session id is
passed to the web server every time the browser makes an HTTP request. The web
application pairs this session id with its internal database and retrieves the
requested page.

Oracle: An oracle is a mechanism for determining whether the program has


passed or failed a test.

A complete oracle would have three capabilities:

A generator, to provide predicted or expected results for each test.


A comparator, to compare predicted and obtained results.
An evaluator, to determine whether the comparison results are sufficiently
close to be a pass.

Cross site scripting: It refers to XSS wherein an attacker injects HTML or


JAVASCRIPT code into a webpage. The data is collected in the hyperlink form
which contains malicious content within it. When the malicious code is inserted
in page and clicked by some user, the malicious code becomes a part of the
web request of the user. This request can also execute on the users computer
and steal information.

SQL Injection: SQL injection is a type of security exploit in which the


attacker adds SQL code to a Web forms input box to gain access to resources.

HTTP: HTTP stands for Hyper Text Transport Protocol. Its a protocol for
information to be passed back and forth between web servers and clients. The
'S' at the end of HTTPS stands for 'Secure'. It means all communications
between your browser and the website are encrypted.

HTTPS transmits data using a public key includes SSL certificate.

HTTP HTTPS

URL begins with http:// URL begins with https://

It uses port 80 for communication It uses port 443 for communication

Unsecured Secured

Operates at Application Layer Operates at Transport Layer

No encryption Encryption is present

No certificates required Certificates required

Static Testing: It is a technique by which we can check the defects in software


without actually executing it. Static testing is done to avoid errors at an early stage
of development as it is easier to find sources of failures.

Examples of Static testing are Informal reviews, Walkthroughs, Technical reviews,


Inspections. Things that are tested here are Unit Test Cases, Business
Requirements Document, Use Cases, Test Data, User Manual Guides.
Dynamic Testing: Dynamic Testing is a kind of software testing technique using
which the dynamic behavior of the code is analyzed. The software should be
compiled and executed and parameters such as memory usage, CPU usage,
response time and overall performance of the software are analyzed.

Review: A review is an examination of a document by one or more people with


the main aim of finding and removing errors early in the software development
life cycle. Reviews are used to verify documents such as requirements, system
designs, code, test plans and test cases.

Phases of Formal review:

Planning:

The review process begins with a request for review by the author to the
moderator.
Moderator schedules time, date, place and invitation.
Roles are allocated.

Kick-Off:

Distributing documents.
Explaining the objectives.

Preparation:

The individual participants identify defects, questions and comments.


Spelling mistakes are recorded on the document under review but not
mentioned during the meeting.

Review Meeting:

Logging phase: Issues that have been identified during the preparation phase are
logged by scriber.

Discussion phase: Detailed discussion is done whether or not an issue is a defect.

Decision phase: After review, decision has to be made whether to review again.
Rework: In this phase the author would be doing all the rework to ensure that
defects detected should be fixed.

Follow up: The moderator is responsible for ensuring that satisfactory actions have
been taken on all (logged) defects.

Walkthrough Technical Review Inspection


It is informal. It is less formal review. It is formal.
Led by the authors. Led by the moderator and Led by moderator
can be led by technical
expert.
Unplanned meetings, No It is often performed as a Planned meeting with
documentation required. peer review without fixed roles assigned to all
management the members involved.
participation.
Author makes a note of Defects are found by the Recorder records the
defects and suggestions experts (such as defects.
offered by team mate. architects, designers, key
users).
Is especially useful for No management Entry and Exit Criteria.
higher level documents participation.
like SRS.

Roles in Review:

1. The moderator: The moderator (or review leader) leads the review process.
The moderator schedules the meeting, spread documents before the meeting,
coaches other team members and follow-up after meeting.

2. The author: As the writer of the document under review, the authors basic
goal should be to learn as much as possible with regard to improving the quality of
the document.

3. The scribe/recorder: The Recorder will document all defects that arise from
the inspection meeting

4. The reviewer: The role of the reviewers is to check defects and further
improvements.

Tailoring: As the name specifies tailoring is nothing but changing the action to
achieve objective according to conditions. Lets try to understand this by a simple
example. Lets say in an organization there is process defined that every contract
should have a hard copy signed. But there can be scenarios in the organization
when the person is not present physically, so for those scenarios the contract
should be signed through email.

Incident: Incident in a software testing can be defined as a deviation observed in


system behavior from what is expected. Very often an incident is referred as a
defect or a bug, but it is not always the case. Incident is basically any unexpected
behavior or response from software that requires investigation. An Incident report
is generated after variation is observed.

-------------------------------------------------------------------------------------------

SQL: Structured Query Language is used to perform operations on the records


stored in database such as updating records, deleting records, creating and
modifying tables, views etc. SQL is just a query language, it is not a database. To
perform SQL queries, you need to install any database for example Oracle, MySQL,
MongoDB, PostGre SQL, SQL Server, DB2 etc.

Database: Database is nothing but an organized form of data for easy access,
storing, retrieval and managing of data.

DBMS RDMS

1) DBMS applications store data RDBMS applications store data in a


as file. tabular form.

2) Normalization is not present in Normalization is present in RDBMS.


DBMS.

3) DBMS does not apply any RDBMS defines the integrity constraint
security with regards to data for the purpose of ACID (Atomicity,
manipulation. Consistency, Isolation and Durability)
property.

4) DBMS uses file system to In RDBMS, data values are stored in the
store data, so there will be no form of tables, so a relationship
relation between the tables. between these data values will be
stored.

5) DBMS does not support RDBMS supports distributed database.


distributed database.

6) Examples of DBMS are file Example of RDBMS are MySQL, postgre,


systems, xml etc. sql server, oracle etc.

Data Definition Language: DDL statements are used to define the database
structure or schema. Some examples:

CREATE - to create objects in the database


ALTER - alters the structure of the database
DROP - delete objects from the database
TRUNCATE - remove all records from a table, including all spaces allocated
for the records are removed
COMMENT - add comments to the data dictionary
RENAME - rename an object

Data Manipulation Language: DML statements are used for managing data
within schema objects. Some examples:

SELECT - retrieve data from the a database


INSERT - insert data into a table
UPDATE - updates existing data within a table
DELETE - deletes all records from a table, the space for the records remain

Data Control Language: DCL statements. Some examples:

GRANT - gives user's access privileges to database.


REVOKE - withdraw access privileges given with the GRANT command.

Transaction Control:

COMMIT - save work done.


SAVEPOINT - identify a point in a transaction to which you can later roll
back.
ROLLBACK - restore database to original since the last COMMIT.
Primary Key: A primary key is a key which uniquely specifies a row. This is a
special kind of unique key. Primary key values cannot be NULL.

Foreign Key: A foreign key is specified as a key which is related to the primary
key of another table. Relationship needs to be created between two tables by
referencing foreign key with the primary key of another table.

Unique Key: A Unique key constraint uniquely identified each record in the
database. Unlike primary key, table can have multiple unique key.

Super Key: A super key is a set of one or more columns (attributes) to uniquely
identify rows in a table.

Candidate key: Candidate keys are selected from the set of super keys, the only
thing we take care while selecting candidate key is: It should not have any
redundant attribute.

Composite Key: A composite key is a combination of two or more columns in a


table that can be used to uniquely identify each row but when it taken individually it
does not guarantee uniqueness.

Alternate Keys: Out of all candidate keys, only one gets selected as primary key,
remaining keys are known as alternative or secondary keys. Alternate keys can be
null.

Arithmetic Operators: +, -, *, /, %

Comparison Operators: +,!, =, <>, >, <, >=, <=, !>, !>

Logical Operators: ALL, AND, ANY, BETWEEN, LIKE, IN, NOT, OR, EXISTS

Constraint: can be used to specify the limit on the data type of table. Constraint
can be specified while creating or altering the table statement. Sample of constraint
are.

NOT NULL.
CHECK.
DEFAULT.
UNIQUE.
PRIMARY KEY.
FOREIGN KEY.
View: View is a virtual table based on the result-set of an SQL statement. A
view contains rows and columns, just like a real table. The fields in a view are fields
from one or more real tables in the database.

Index: Indexes are used by queries to find data from tables quickly. Indexes are
created on tables and views. It is similar to an index we find in a book.

Unique Index: This indexing does not allow the field to have duplicate values if
the column is unique indexed. Unique index can be applied automatically when
primary key is defined.

Clustered Index: This index determines the physical order of the table. Each table
can have only one clustered index.

Non-Clustered Index: Non-Clustered Index does not alter the physical order of
the table and maintains logical order of data. Each table can have 999 non-
clustered indexes.

Trigger: it is a special type of stored procedure. The main difference between a


trigger and a stored procedure is that a trigger is called automatically.

DML: Insert, Update, Delete, Instead of triggers. DDL: Create, Alter, Drop

Example: When a new student is added to the student database, new records
should be created in the related tables like Exam, Score and Attendance tables.

Transactions must have following properties:

ACID: ACID property is used to ensure that the data transactions are processed
reliably in a database system. A single logical operation of a data is called
transaction.

Atomicity: It requires that each transaction is all or nothing. It means if one part
of the transaction fails, the entire transaction fails and the database state is left
unchanged.

Consistency: The consistency property ensures that the data must meet all
validation rules. In simple words you can say that your transaction never leaves
your database without completing its state.

Isolation: This property ensures that the concurrent property of execution should
not be met. The main goal of providing isolation is concurrency control.
Durability: Durability simply means that once a transaction has been committed, it
will remain so, come what may even power loss, crashes or errors.

Data integrity: It ensures the consistency and correctness of data stored in a


database. It is broadly classified into the following four categories:

Entity Integrity: Entity integrity ensures that each row can be uniquely identified
by an attribute called the primary key. The primary key cannot be NULL.

Example: There might be two candidates for interview with the same name 'Alok'.
They can be identified using the unique code assigned to them.

Domain Integrity: It ensures that only a valid range of values is allowed to be


stored in a column. It can be enforced by restricting the type of data, the range of
values, and the format of data.

Referential Integrity: Referential Integrity ensures that the values of the foreign
key matches with the value of the corresponding primary key.

User-defined Integrity: User-defined integrity refers to a set by a user, which do


not belong to the entity, domain, and referential integrity categories.

Example: If you want a candidate who is less than 18 years to apply for a post.

Aggregate max(), count Calculated with respect to numeric.

Scalar UCASE(), NOW() Calculated with respect to strings.

Stored Procedure: A stored procedure is nothing more than prepared SQL code
that you save so you can reuse the code over and over again. So if you think about
a query that you write over and over again, instead of having to write that query
each time you would save it as a stored procedure.

Normalization: It is the process of organizing the data in database to avoid data


redundancy and dependency of data. It splits large tables into smaller tables and
defines relationships between them.

1NF: Each table cell should contain single value.

Each row needs to be unique.


2NF: Table is in 1NF.

All non-key attributes are fully functional dependent on the primary key.

3NF: It satisfies the criteria to be in the second normal form.

It does not contain columns that are not fully dependent upon the primary key.

BCNF: Must be in 3NF.

For any non-trivial functional dependency, X A, X must be a super-key.

Cursor: A cursor is a temporary work area created in the system memory when a
SQL statement is executed. A cursor contains information on a select statement and
the rows of data accessed by it. A cursor can hold more than one row, but can
process only one row at a time. The set of rows the cursor holds is called the active
set. There are two types of cursors in PL/SQL:

Implicit cursors: These are created by default when DML statements like,
INSERT, UPDATE, and DELETE statements are executed. They are also created
when a SELECT statement that returns just one row is executed.

Explicit cursors: They must be created when you are executing a SELECT
statement that returns more than one row. Even though the cursor stores multiple
records, only one record can be processed at a time.

Joins: Joins mean to combine two or more tables.

SQL Queries

-- New Database
Createdatabasemaster

--rename
sp_renamedb'master','master1'

--Drop
dropdatabasemaster

--user databse
Usedatabasemaster
--Create table
Createtable student(stdid varchar(20)primarykey, stdname varchar(20)notnull,
stdrollno intidentity (1,1), stdcity varchar(20), stddob datetime, stddept
varchar(20)unique, stdcontact int)
Createtable Employee(Employee_id intprimarykey, First_name varchar(20),
Last_name varchar(20), Salary int, Joining_date datetime, Department
varchar(20))
Createtable Incentives(Employee_ref_id intforeignkeyreferences
Employee(Employee_id), Incentive_date datetime, Incentive_amount int)

--Multiple primary key


Createtable student(stdid varchar(20), stdname varchar(20)notnull, stdrollno
intidentity (1,1), stdcity varchar(20), stddob datetime, stddept
varchar(20)unique, stdcontact int,Constraint pk primarykey
(stdid,stdcontact))

--Insert values
Insertinto student values(1,'Himanshu','Chd','01/22/1990','cse','950')
Insertinto student values(2,'Mani','delhi','12/11/1990','ece',960)
Insertinto student values(3,'rahul','goa','01/22/1989','maths',890)
Insertinto student values(4,'sahil','mumbai','02/15/1990','eng',789)
Insertinto student values(5,'gaurav','mohali','01/24/1990','IT',190)

--Insert values in multiple columns in one go


Insertinto student(stdid,stdname,stdcity,stddob,stddept,stdcontact)values
(6,'Bharat','UP','12/12/1990','mechanical',390),(7,'sachin','Utk','11/16/1990
','civil',189)

--delete all rows form a table


Deletefrom student

--delete column(s) from a table


Deletefrom student where stdcity='ece'
Truncatetable students

--Rename table
sp_rename'student','students'

--copy some columns or all columns to new table


Select stdid, stdcity into student from students
Select*into student from students

--copy some columns or all columns to existing table


Insertinto student select*from student
Insertinto student(stdid,stdciy)select stdid,stdcity from students

--Alter table add column


Altertable students add stdgender varchar(20)
Altertable students altercolumn stdfees int
Altertable students addprimarykey(stdid)
Altertable students dropprimarykey
Altertable students addunique (empsalary)
Altertable students dropunique
Altertable students addconstraint test default'himanshu'for empname
Altertable student Altercolumn stdadd varchar(15)
Altertable student dropcolumn stdid
ALTER TABLE Orders ADD FOREIGN KEY (PersonID) REFERENCES Persons(PersonID);

--Alter table rename column


sp_rename'students.stdgender','stgender'
--Delete duplicate records
Selectdistinct stdcity, stdname from students

--Count records
Selectcount(*)as Fees from students
Selectcount(distinct stdcity)from students

--Sum records
SelectSUM(stdfees)from students
SelectMax(stdfees)from students
SelectMin(stdfees)from students where stdrollno>6
SelectAVG(stdfees)from students

--Top records
SelectTop 3 stdname from students
SelectDistinctTop 3 stdname from students

--Wild cards
Select stdname from students where stdname like'H%'
Select stdname from students where stdname like'%H%'
Select stdname from students where stdname like'%u'
Select stdname from students where stdname like'M___'

--Less than, greater than, Between, IN


Select stdname from students where stdfees > 500
Select stdname from students where stdfees < 1000
Select stdname from students where stdfees Between 900 and 1000
Select*from employees where empname between'a'and'm'
Select*from students where stdname IN('Himanshu','gaurav')

--Date
Select stdname from students whereCONVERT(varchar(11),stddob)='1990'
Select stdname from students whereday(stddob)='22'
SelectDATEPART(MM,stddob)from students
SelectDay(stddob)from students
SELECTCONVERT(DATE, stddob)from students
selectCONVERT(VARCHAR(11),stddob, 111)from students
SelectGETDATE()

--Retrieve Null records


SELECT stdname from students where stdname isnotnull

--AND operator
Update students set stdfees=1000 where stddept='cse'and stdcity='Chd'

--OR operator
Update students set stdcity='chennai'where stddept='mechanical'or stdfees=190

--Order By
Select*from students orderby stdname
Select*from students orderby stdname Desc
--Retrieve random row
Select stdname from students orderbyNEWID()

--Update record
Update students set stdname='Gaurav'where stdcity='chennai'

--Delete record
Delete stdname from students where stddept='eng'

-- Groupby, Having
Select stdcity,sum(stdfees)from students groupby stdcity, stdfees
Select stdcity,SUM(stdfees)from students groupby stdcity
havingCOUNT(stdrollno)>1
Select stdcity from students groupby stdcity havingsum(stdfees)>500
select*from students

SelectUPPER(stdname)from students
SelectLOWER(stdname)from students
SelectSUBSTRING(stdname, 1,3)from students
SelectLEN(stdname)from students
SelectROUND(stdfees,1)from students

Select e.empname, e1.empaddress from employees As e, employeedetail As e1


where e.empid=e1.empid

Select e.empname, e1.empaddress, e1.empcontact from employees As e rightjoin


employeedetail As e1 on e.empid=e1.empid

Select e.empname, e1.empaddress from employees As e rightjoin employeedetail


as e1 on e.empid=e1.empid

select*from employee crossjoin employeedetail

------------------------------------
CreateIndex Index1 On employees(empid)

Dropindex employees.index1

Createview view1 Asselect empname, empid from employee

Select*from view1

Dropview view1

Createprocedure Testprocedure
(
@empcity varchar(20))
As
Begin
Select*from employees where empcity=@empcity
End

exec testprocedure

dropprocedure testprocedure
webSelenium
Difference webDriver and Remote Control:

webDriver controls browser at OS level while Selenium RC acts as a middleman


between your selenium commands and browser.

webDriver is faster since it speaks directly to the browser.

webDriver can driver HTMLUnit(headless) browser.

API used to interact with database:

Java Database Connectivity(JDBC) is a Java API which is used to connect and


interact with Database.

Generating Alert and highlighting elements:

We can generate Alerts and highlight elements using class JavascriptExecutor.

Implicit Wait: The implicit wait will tell to the web driver to wait for certain
amount of time before it throws a "No Such Element Exception". The default setting
is 0. Once we set the time, web driver will wait for that time before throwing an
exception.

driver.manage().timeouts().implicitlyWait(TimeOut, TimeUnit.SECONDS);

PageLoadTimeout: Sets the amount of time to wait for a page load to complete
before throwing an error.

driver.manage().timeouts().pageLoadTimeout(100, SECONDS);

ScriptTimeout: Once added in the script, the WebDriver instance waits for 20
seconds for every asynchronous script to get executed on the web page before
throwing an exception.

driver.manage().timeouts().setScriptTimeout(20, TimeUnit.SECONDS);

Explicit Wait: implicit wait will be applied to all elements of test case by default
while explicit will be applied to targeted element only. We have 3 types of wait
here:

Thread.sleep: it always force the browser to wait for a specific time. Time here we
provide is in milliseconds. Thread.Sleep(2000);

WebDriverWait: It is used to tell the Web Driver to wait for certain conditions
(Expected Conditions) or the maximum time exceeded before throwing an
"ElementNotVisibleException" exception.
WebDriverWait wait = new WebDriverWait(driver, 15);
wait.until(ExpectedConditions.elementToBeClickable(By.cssSelector("#submitButto
n1")));

Fluent Wait: The fluent wait is used to tell the web driver to wait for a condition, as
well as the frequency with which we want to check the condition before throwing an
"ElementNotVisibleException" exception.

Wait<WebDriver> wait = new FluentWait<WebDriver>(driver).withTimeout(30,


TimeUnit.SECONDS).pollingEvery(5,
TimeUnit.SECONDS).ignoring(NoSuchElementException.class);

Identifying Frames: Right click on page

Count total number of frames in a page:

List<WebElement> iframeElements = driver.findElements(By.tagName("iframe"));

Switching frames:

By Index: driver.switchTo().frame(0);

By Name: driver.switchTo().frame("iframe1");

By ID: driver.switchTo().frame("IF1");

Switching back to Main page:

driver.switchTo().defaultContent();

Get total number of links in page:


List<WebElement> allElements = driver.findElements(By.xpath("//a"));

Get total number of element in page:


List<WebElement> links = driver.findElements(By.xpath("//a"));
What getAttribute does:

Gets the value of a the given attribute of the element

Store all elements having //select tag in a page:

List<WebDriver> options=driver.findElements(By.xpath(//select));

Generate and insert Log in selenium webDriver: Download log4j jar file and
import it into your project. Logger class will be used to access its functions.

Dropdown handle:

Select dropdown=new Select(driver.findElement(By.name("salutationtype")));

Dropdown.SelectByVisibilityText();

Dropdown.SelectByvalue();

Dropdown.SelectByIndex();

Alert:

Alert alert = driver.switchTo().alert();

alert.getText();

Mouse movement:

Actions Action = new Actions(driver);

Actions.moveToElement(findElement(By.xpath("//div[@id='menu1']/div"))).build.pe
rform();

Double click on element:

Action.doubleClick(findElement(By.xpath("//div[@id='menu1']/div"))).perform;

Drag and Drop:

Action.dragAndDrop(driver1, driver2).build().perform();

Move JQuery Slider:

Action.dragAndDropBy(driver, 100, 0).build().perform();

To get the font size, font color, font type and back ground colour using
WebDriver:
driver.findelement(By.Xpath("Xpath ").getcssvalue("font-size);

driver.findelement(By.Xpath("Xpath ").getcssvalue("font-colour);

driver.findelement(By.Xpath("Xpath ").getcssvalue("font-type);

driver.findelement(By.Xpath("Xpath ").getcssvalue("background-colour);

To get the X,Y co-ordinates of an element:

Point point = driver.findElement(By.xpath("//img[@border='0']")).getLocation();

int xcord = point.getX();

Delete/Add a cookie from browser:

driver.manage().deleteAllCookies()

Reading captcha from Image:

ASPRISE OCR(Optical Character Recognition) library is used to get text from image.

Save Image:

action.contextClick(driver).build().perform();

action.sendKeys(Keys.CONTROL, "v").build().perform();

Then we can use Java Robot class to handle Save Image dialog.

How to handle network latency using selenium?

driver.manage.pageLoadingtime

Verify if Element is Present in Selenium WebDriver:

Boolean iselementpresent =
driver.findElements(By.xpath("//input[@id='text2']")).size()!= 0;

Multiple window handler:

Set<String> handles=driver.getWindowHandles();

Iterator<String> itr=handles.Iterator();

String PWindow=itr.next();

String CWindow=itr.next();

driver.switchto.window(CWindow);

Open a tab:

driver.findElement(By.cssSelector("body")).sendKeys(Keys.CONTROL +"t");
Switch to current selected tab's content:

driver.switchTo().defaultContent();

Screenshot capture in webdriver:

File screenshot = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);

FileUtils.copyFile(screenshot, new File("D:\\screenshot.jpg"));

AutoIT: It uses a combination of mouse movement, keystrokes and window


control manipulation to automate a task which is not possible by selenium
webdriver. Many web applications contains forms with file uploading feature,
Sometimes you need to test file downloading feature, Sometimes you need to
handle windows authentication popups.

SetSleep is an IDE command which haults the whole execution for the number of
seconds defined while Thread.sleep stops the execution for that line of code only.

Limitations of Selenium webDriver:

It does not support window based applications.

webDriver has no built-in command that automatically generates a Test Results


File.

Selenium user lacks online support for the problems they face.

Selenium script creation time is bit high.

Handling AJAX controls: The best approach for handling AJAX controls is with
WebDriverWait in combination with ExpectedCondition.

How to handle network latency using selenium?

driver.manage.pageLoadtimeout()

Recovery scenario in selenium: If you are using Java then you can use
exception handling to overcome same. By using Try Catch Block within your
Selenium WebDriver.

Object Repository: Object repository is the collection of object and object here is
locator. Here locator means web element id, name, CSS, XPath, class name etc.

The scenario is you have 100 test cases and in all test cases, you have login
scenario. So, if your application changes now and some locator changes like id
changes from email to login email then you have to modify all the test cases and
you have to change the id. This process does not make any sense so to overcome
with this we will move all locator in a separate file and we will link all test cases to
this file. In case any changes happen in our locator we will simply change in that
file, not our test cases.

Regular expressions: Regular Expressions in Selenium is mainly used in selecting


effective xpath.

Java
String Comparison: st1.equals(st2)

String Concatenation: st1.concat(st2)

Retrieving Character from Index: st1.charAt(9))

Length Of String: st1.length()

Convert String In Lower Case Letters: st1.toLowerCase()

Convert String In UpperCase Letters: st1.toUpperCase()

Retrieving Index Of 1st most character: st1.indexOf('i')

Retrieving Index Of 2nd most character: st1.indexOf('i', 3))

Retrieving Index Of specific word from string: st1.indexOf("Very")

Convert from Integer To String: String.valueOf(j)

Convert from String To Integer: Integer.parseInt(val1)

Retrieving sub string from string: st1.substring(5, 13)

Split String: String splt[] = st1.split("Very")

Trim String: st2.trim()

Array: An array can store multiple value of same data type(int, char, String) at the
same time and each stored data location has unique Index.

One Dimensional Array:

Ways to declare Array:

Int a[]=new int [6];

Int a[]={10,12,15,23,28,35};
Two Dimensional Array:

String str[][]=new String[3][2];

Convert String to Int: int i=Integer.pareInt(str);

Convert Int to String String str=Integer.toString(i);

JVM: JVM is responsible for converting byte code into machine readable code. JVM
is not platform independent, thats why you have different JVM for different
operating systems.

JDK: Java Development Kit (JDK) is for development purpose and JVM is a part of it
to execute the java programs. JDK provides all the tools, executables and binaries
required to compile, debug and execute a Java Program. The execution part is
handled by JVM to provide machine independence.

java.lang.Object is the root class of all the java classes and is imported by default.

Access Modifiers:
Difference between Static and Non Static Methods in Java:

We can call static methods directly while we have to create an object to call non
static methods.

We can access only static stuff inside static methods. However, we can access static
and non-static stuffs inside non static methods.

Constructor:

It is a code block which is Called and executed at the time of object creation
and constructs the values (i.e. data) for object.
They do not have return types, not even void and therefore they cannot
return values.
They cannot be inherited, though a derived class can call the base class
constructor.
Constructor is invoked whenever an object of its associated class is created.

Inheritance:

Inheritance is the process by which objects of one class acquire the


properties of objects of another class.
A class that is inherited is called a superclass.
The class that does the inheriting is called a subclass.
Inheritance is done by using the keyword extends.

Overloading: When we have more than one method with same name in a single
class but the arguments are different, then it is called as method overloading.

Overriding: Overriding concept comes in picture with inheritance when we have


two methods with same signature, one in parent class and another in child class.

Polymorphism: It is the ability by which we can create reference variables or


functions which behaves differently in different programmatic context. Two types:

Compile time polymorphism: Compile time polymorphism is also known as static


binding or method overloading. Static polymorphism is achieved through method
overloading. If a class has multiple methods having same name but different in
parameters, it is known as Method Overloading.
Run time polymorphism: It is also known as dynamic binding or method
overriding in java software development language. You can get method overriding
when you use inheritance. If subclass (child class) has the same method as
declared in the parent class, it is known as method overriding in java.

Interface: An interface in java is a blueprint of a class. It is used to achieve


abstraction and multiple inheritance in Java.

Abstraction: Abstraction is process of hiding implementation details from user.


User can use only functionality but cannot see how it is implemented.

Abstract Method: If any method is declared with abstract keyword then it is called
abstract method. Abstract method cannot have a body. Actual implementation of
abstract method will be done by its child class. If any class extends abstract class
then that subclass must have to implement all the abstract methods declared by its
super class (abstract class).

Abstract Class: A class which contains the abstract keyword in its declaration is
known as abstract class. It can have abstract and non-abstract methods (method
with body).

This class can have public, private, protected or constants and default
variables.
It needs to be extended and its method implemented. It cannot be
instantiated.
If a class has at least one abstract method, then the class must be declared
abstract.

Abstraction vs Interface:

Abstract keyword is used to create abstract class whereas interface is the keyword
for interfaces.

Abstract classes can have method implementations whereas interfaces cant.

You cannot extend more than one abstract class. You can implement more than one
interface.

We can run an abstract class if it has main() method but we cant run an interface
because they cant have main method implementation.

This: This is a reference variable that refers to the current object.


Super: The super keyword in java is a reference variable which is used to refer
immediate parent class object.

Array List: Java ArrayList class uses a dynamic array for storing the elements.

ArrayList<String> str=new ArrayList<String>();

Methods in ArrayList: add,indexof,get,set,size,remove

Java Hashtable: class implements a hashtable, which maps keys to values.

Hashtable<Integer,String> map=new Hashtable<Integer,String>();

Read-Write Test file in Java:

We can use java built in class File to create new file, FileWriter and BufferedWriter
class to write in to file, FileReader and BufferedReader class to read text file.

String TestFile = "D:\\temp.txt";

File FC = new File(TestFile) //Created object of java File class.

FC.createNewFile(); //Creates file.

FileReader FR=new FileReader(TestFile);

BufferedReader BR=new BufferedReader(FR); //Reading from file

FileWriter FW=new FileWriter(TestFile);

BufferedWriter BW=new BufferedWriter(FW); //Writing in to file

BW.newLine();

BW.write(Hello);

BW>Close();

Exceptions in Java: Exception is an error event generated during the execution of


webdriver test case or java software program which disrupts test execution in
between.

There are mainly two types of exceptions: Checked and Unchecked exception.

Checked exceptions: are checked at compile-time. It means if a method is


throwing a checked exception then it should handle the exception using try-catch
block or it should declare the exception using throws keyword.

Checked exceptions are: SQLException, IOException, DataAccessException,


CassNotFoundException, InvocationTargetException.
Unchecked Exception: are not checked at compile time. It means if your program
is throwing an unchecked exception and even if you didnt handle/declare that
exception, the program wont give a compilation error. You should handle them
using try-Catch block.

Unchecked exceptions are: NullPointerException, ArrayIndexOutOfBoundsException,


ArithmeticException, IllegalArgumentException.

Difference between throw and throws:

public void test(){

throw new exception(Something went wrong);

public void test() throws Throwable{

Difference between final, finally and finalize:

Encapsulation: it is one of the OOP fundamental concept. It is the process of


packing code and data together in to a single Unit. Best example is capsule where
powder of several medicines is packed in single unit. It is also known as "data
hiding" technique as fields of class are declared private and providing access to the
fields via public methods. So anyone cannot access private data fields directly
outside the class.

Program to get systems current date:


Is constructor inherited and Can we make a constructor final?

No, constructor is not inherited and we cant make constructor final.

Main method is static because object is not required to call static method if It
were non-static method, jvm creates object first then call main() method that will
lead to the problem of extra memory allocation.

Is there any case when finally will not be executed?

Finally block will not be executed if program exits(either by calling System.exit()

Garbage collection: Garbage Collection is the process of identifying which objects


are in use and which are not, and deleting the unused objects. In Java, process of
deallocating memory is handled automatically by the garbage collector. We can run
garbage collector forcibly by using System.gc().

What is the purpose of finalize() method?

Unlike c++, we dont need to destroy objects explicitly in Java. Garbage Collector
does that automatically. Sometimes an object can hold non-java resources such as
file handle or database connection, then you want to make sure these resources are
also released before object is destroyed. To perform such operation we call finalize
method.

List vs Set

List can hold duplicate values but Set doesnt allow this.
In List interface data is present in the order you inserted but in the case of
Set insertion order is not preserved.

Break and continue are two important keywords used in Loops. When a break
keyword is used in a loop, loop is broken instantly while when continue keyword is
used, current iteration is broken and loop continues with next iteration.

String vs StringBuffer: String is an Immutable class, i.e. you can not modify its
content once created. While StringBuffer is a mutable class, means you can change
its content later. Whenever we alter content of String object, it creates a new string
and refer to that, it does not modify the existing one. This is the reason that the
performance with StringBuffer is better than with String.

StringBuffer: StringBuffer is synchronized that is StringBuffer is thread safe


means it does not allow two threads to simultaneously access the same method.
But being thread safe has disadvantages too as the performance of the StringBuffer

JSON: JSON is JavaScript Object Notation, it is a much lighter and readable


alternative to XML. It is an independent and easily parse-able in all programming
languages. It is primarily used for Communicating between client server or server
-server communication.

TestNG Interview Questions

Explain what is TestNG?

TestNG is an automated open source testing framework. It is based on JUnit


framework but is not a JUnit extension.

Advantages of TestNG over Junit?

TestNG supports following three additional setup: @Before/AfterSuite,


@Before/AfterTest and @Before/AfterGroup
In TestNG, it is possible to run selenium test cases in parallel
We can set priority in test cases.
In Selenium TestNG projects, there is no need to extend any class.

Annotations in TestNG and their sequence?

@BeforeSuite
@BeforeTest
@BeforeClass
@BeforeMethod
@Test
@AfterMethod
@AfterClass
@AfterTest
@AfterSuite

How to pass parameter through testng.xml file to a test case?

What is the significance of <testng.xml> file?

You can configure test suite comprising of multiple test cases to run from a single
place.
You can include or exclude test methods test execution.

You can configure parallel test execution.

In TestNG how can you disable a test?

To disable the test case you dont want, you can use annotations:

@Test(enabled = false).

Explain @Test(InvocationCount=x) and @Test(threadPoolSize=x)?

The invocationcount tells how many times TestNG should run this test method

The threadPoolSize attribute tells to form a thread pool to run the test method
through multiple threads.

What does the test timeout mean in TestNG?

The maximum number of milliseconds a test case should take.


Mention different ways in which you can produce reports for TestNG
results?

It can produce reports by using Listeners and Reporters.

What are listeners?

Listeners listen to the event defined in the selenium script and behave
accordingly. The main purpose of using listeners is to create logs. There are many
types of listeners such as WebDriver Listeners and TestNG Listeners. Using TestNG
listeners we could generate logs and customize TestNG Reports.

How to exclude a @Test method from a test case with two @Test methods?
Is it possible?

Yes, you need to add @Test method in the exclude tag of <testng.xml> file as
below.

<exclude name="Your Test Method Name To Exclude"/>

How to define the priority of @Test method

@Test(priority=0). That means @Test method with priority = 0 will run 1st and
@Test method with priority = 1 will execute 2nd and so on.

Specify any 6 assertions of TestNG to be used in a Selenium WebDriver.

assertEquals, assertNotEquals, assertTrue, , assertFalse, assertNull, assertNotNull.

Java Database Connvectivity(JDBC) is an API required for database testing in


selenium webDriver.

Assert vs Verify command:

When an assert fails, the test will be aborted where if a verify fails, the test will
continue executing and logging the failure.

How many types of assert are in TestNG?


There are two types of assert:

Hard assert: Hard Assert throws an AssertException immediately when an assert


statement fails and test suite continues with next @Test. The disadvantage of Hard
Assert It marks method as fail if assert condition gets failed and the remaining
statements inside the method will be aborted.

Soft Assert Soft Assert collects errors during @Test. Soft Assert does not throw
an exception when an assert fails and would continue with the next step after the
assert statement. If there is any exception and you want to throw it then you need
to use assertAll() method as a last statement in the @Test and test suite again
continue with next @Test as it is.

TestNG soft assertion allows to continue the test execution even if the assertion is
failed. That means once the soft assertion fails, remaining part of the <@Test>
method is executed and the assertion failure is reported at the end of the <@Test>
method.

What is exception test in TestNG?

You can verify whether a code throws the expected exception or not.

Here, testException() method was marked as passed by TestNG during execution.

How to exclude a particular test method from a test case execution?

How to disable/ignore a test case in TestNG ?

@Test(enabled=false)
How to skip a @Test method from execution in TestNG?

Difference between PageFactory and PageObject Model

How to lazy load objects using DataProviders?

DataProviders

Listeners

Maven
Explain what is Maven?

Maven is a powerful project management tool that is based on POM (project object
model). It is used for projects build and dependency.

POM: POM stands for Project Object Model. The pom.xml file contains information
of project and project configuration. It is an XML file which holds the information
about the project and configuration details used to build a project by Maven.

How to install Maven?

Download maven and extract it


Add JAVA_HOME and MAVEN_HOME in environment variable
Add maven path in environment variable
Verify Maven by writing mvn version in the command prompt.

Explain what is Maven Repository? What are their types?

A Maven repository is a location where all the project jars, library jars, plugins or
any other particular project related artifacts are stored and can be easily used by
Maven. Their types are local, central and remote.

Local Repository: Maven local repository is created by maven in your local system
when you run any maven command. We can change the location of maven local
repository by changing the settings.xml file.
Central Repository: Maven central repository is located on the web. It has been
created by the apache maven community itself.

Remote Repository: Maven remote repository is located on the web. Most of


libraries can be missing from the central repository such as JBoss library etc, so we
need to define remote repository in pom.xml file.

What are the three build lifecycles of Maven?

The three build lifecycles are

Clean: cleans up artifacts created by prior builds.


Default (or build): This is used to build the application.
Site: generates site documentation for the project.

pom.xml vs setting.xml: settings.xml must be specific to the current user and


that pom.xml configurations are specific to the project.

Maven Snapshot: It is a version that has not yet released. The difference between
a "real" version and a snapshot version is that snapshots might get updates. That
means that downloading 1.0-SNAPSHOT today might give a different file than
downloading it yesterday or tomorrow.

Potrebbero piacerti anche