Software Testing Unit1
Software Testing Unit1
Software Testing Unit1
Software testing can be stated as the process of verifying and validating whether a software or
application is bug-free, meets the technical requirements as guided by its design and
development, and meets the user requirements effectively and efficiently by handling all the
exceptional and boundary cases.
The process of software testing aims not only at finding faults in the existing software but
also at finding measures to improve the software in terms of efficiency, accuracy, and
usability. It mainly aims at measuring the specification, functionality, and performance of a
software program or application.
1. Verification: it refers to the set of tasks that ensure that the software correctly
implements a specific function.
2. Validation: it refers to a different set of tasks that ensure that the software that has
been built is traceable to customer requirements.
1. Manual Testing: Manual testing includes testing software manually, i.e., without using any
automation tool or any script. In this type, the tester takes over the role of an end-user and
tests the software to identify any unexpected behavior or bug. There are different stages for
manual testing such as unit testing, integration testing, system testing, and user acceptance
testing. Testers use test plans, test cases, or test scenarios to test software to ensure the
completeness of testing. Manual testing also includes exploratory testing, as testers explore
the software to identify errors in it.
1. Black Box Testing: The technique of testing in which the tester doesn’t have access to
the source code of the software and is conducted at the software interface without any
concern with the internal logical structure of the software is known as black-box
testing.
2. White-Box Testing: The technique of testing in which the tester is aware of the
internal workings of the product, has access to its source code, and is conducted by
making sure that all internal operations are performed according to the specifications
is known as white box testing.
End users, testers, and developers. Normally done by testers and developers.
This can only be done by a trial and error Data domains and internal boundaries can be
method. better tested.
What are different levels of software testing?
2. Integration Testing: A level of the software testing process where individual units are
combined and tested as a group. The purpose of this level of testing is to expose faults
in the interaction between integrated units.
3. System Testing: A level of the software testing process where a complete, integrated
system/software is tested. The purpose of this test is to evaluate the system’s
compliance with the specified requirements.
Note: Software testing is a very broad and vast topic and is considered to be an integral and
very important part of software development and hence should be given its due importance.
Software testing is an activity which aims at evaluating the quality of a software product
and also to improve it by identifying defects. Software testing strives to achieve its
objectives but has certain limitations. However, adherence to the established objectives
ensures effective testing. In this article, we will focus on the following points:
The work products such as Requirement document, Design, and User Stories should be
verified before the developer picks it up for development. Identifying any ambiguity or
contradicting requirements at this stage saves considerable development and test time. The
static analysis of the code (reviews, walk-thru, inspection, etc.) happens before the code
integrates/is ready for testing. This idea of testing is known as Verification. It is the process
of evaluating the product during the development phase of each work product.
This objective reveals the fact that the essential elements of testing should be to fulfill the
customer’s needs. Testers test the product and ensure the implementation of all the specified
requirements have. Developing all the test cases, regardless of the testing technique ensures
verification of the functionality for every executed test case. The Tester should also create a
requirement traceability matrix (RTM), which will ensure the mapping of all the test cases to
requirements. RTM is an effective way to ensure that test cases have got the right
requirement coverage.
To validate if the test object is complete and works as per the expectation of the users and the
stakeholders:
Testing ensures the implementation of requirements along with the assurance that they work
as per the expectation of users. This idea of testing is called Validation. It is the process of
checking the product after development. Validation can be a manual or automation. It
usually employs various types of testing techniques, i.e., Black Box, White Box, etc.
Generally, testers perform validation, whereas customers can also validate the product as
part of User acceptance testing. Every business considers the customer as the king. Thus the
customer's satisfaction is a predominant need for any business. For example, customer
satisfaction and loyalty in online shopping and ecommerce environments is a useful
indicator for long-term business success.
To build confidence in the quality level of the test object:
One of the critical objectives of software testing is to improve software quality. High-Quality
software means a lesser number of defects. In other words, the more efficient the testing
process is, the fewer errors you will get in the end product. Which, in turn, will increase the
overall quality of the test object. Excellent quality contributes to a significant increase in
customer satisfaction as well as lower maintenance costs.
One of the objectives of software testing is to avoid the mistakes in the early stage of the
development. Early detection of errors significantly reduces the cost and effort. The
prevention of defects involves doing a root cause analysis of the defects found previously and
after that, taking specific measures to prevent the occurrence of those types of errors in the
future. Efficient testing helps in providing an error-free application. If you prevent defects, it
will result in reducing the overall defect count in the product, which further ensures a high-
quality product to the customer.
Another essential objective of software testing is to identify all defects in a product. The main
motto of testing is to find maximum defects in a software product while validating whether
the program is working as per the user requirements or not. Defects should be identified as
early in the test cycle as possible.
E.g., a defect found in the UAT phase will be much costlier to fix than the same defect found
in the Sprint testing phase.
The purpose of testing is to provide complete information to the stakeholders about technical
or other restrictions, risk factors, ambiguous requirements, etc. It can be in the form of test
coverage, testing reports covering details like what is missing, what went wrong. The aim is
to be transparent and make stakeholders fully understand the issues affecting quality.
The possibility of loss is also known as risk. The objective of software testing is to reduce the
occurrence of the risk. Each software project is unique and contains a significant number of
uncertainties from different perspectives, such as market launch time, budget, the technology
chosen, implementation, or product maintenance. If we do not control these uncertainties, it
will impose potential risks not only during the development phases but also during the whole
life cycle of the product. So, the primary objective of software testing is to integrate the Risk
management process to identify any risk as soon as possible in the development process.
To comply with contractual, legal, or regulatory requirements or standards, and to verify the
test object’s compliance with such requirements or standards:
This objective ensures that software developed for a specific region must follow the legal
rules and regulations of that region. Moreover, the software product must be compatible with
the national and international standards of testing. We have ISO/IEC/IEEE 29119 standards
that deal with the software testing concept.
E.g., each country has laws specific to accessibility requirements which must be fulfilled to
avoid legal implications. The European Union has strict rules on how the Personal
Identifiable Information (PII) like Social security number etc. should be handled. Failure to
adhere to such requirements will lead to failure of the product, no matter how defect-free it
has been working!
Do the Software Testing Objectives vary with the type of Testing Technique and SDLC
model?
Yes, sometimes, the objectives can vary based on the type of testing techniques. Let's
understand it by using some basic testing types.
In addition to the type of testing, the objectives also vary with the SDLC model. For instance,
in a waterfall model, the aim is to be as detailed as possible in the artifact creation (e.g., test
cases). Whereas in the agile model, the artifacts are created just in time and with the
minimum required details.
created just in time and with the minimum required details.
PSYCHOLOGY OF TESTING
mutual understanding among team members and helps them work towards a common goal.
But Testers are all about analysis. Once it has all been put together, the tester likes to take it
apart again, piece by piece, this time looking for those little corners, edges, and absurdities
that hide in those weird and strange interactions that come from those new and amazing ways
testing or reviewing a product, testers mainly look for defects or failures in the product. If we
are building or developing applications, we have to work positively to solve the problems
during the development process and to make the product according to the user specification.
As an example,
Identifying defects during static testing such as requirements review or user story
refinement session or identifying failures during dynamic test execution, may be perceived
as Criticism of the product and of its author. So the developer or the analyst may have
problems with you as a tester because he thinks that you are criticizing them.
There’s an element of human psychology called Confirmation bias, which means that most of
people find it difficult to accept information that disagrees with currently held believes.
For example, since developers expect their code to be correct, they have a confirmation bias
that makes it difficult to accept that the code is incorrect. In addition to confirmation bias,
other cognitive biases may make it difficult for people to understand or accept information
produced by testing.
Further, it is a common human trait to blame the bearer of bad news and information
produced by testing often contains bad news.
To try to reduce these perceptions, information about defects and failures should be
developers can be reduced. This applies during both static and dynamic testing in which
Static Testing is a software testing technique where the software is tested without executing
the code and Dynamic Testing will use the dynamic behaviour of the code by opening the
application and run it.
Testers and test managers need to have good interpersonal skills to be able to communicate
effectively about the defects, failures, test results, test progress and risks and to build positive
relationships among colleagues.
Communication, if done in a polite and respectful manner can help build a strong and reliable
relationship between the team members and help them avoid any misunderstanding.
Finding and reporting defects can be an achievement for the tester but is merely an
inconvenience for programmers, designers, developers, and other stakeholders of the project.
As testing can be a destructive activity, it is important for software testers to report defects
and failures as objectively and politely as possible to avoid hurting and upsetting other
members related to the project.
• Remind everyone about their common goal of having better quality systems.
• For the organization, defects found and fixed during testing will save money,
• Communicate test results and other findings in a neutral, fact focused way
without criticizing the person who created the defected item.
• Write objectives, defect reports and review findings.
• Try to understand how the other person feels and the reasons they may react
• Confirm that the other person has understood what has been said.
• Clearly define the right set of test objectives has important psychological
implications.
• Most people tend to align their plans and behaviors with the objectives set by the
team, management, and stakeholders. So it’s also important that testers adhere to
these objectives with minimum personnel bias.
While testing their own code they find many problems so the programmers, architect, and
developers always test their own code before giving it to anyone. However, we all know that
it is difficult to find our own mistakes. It might be due to some reasons such as,
So, programmers, architects, business analysts depend on others to help test their work. This
other person might be some other developer from the same team or the Testing specialists or
professional testers.
and other stakeholders get more accurate test results, which helps them build a better software
product, with innovative and unique features and functionality.
There are several levels of independence in software testing which is listed here from the
lowest level of independence to the highest:
iv. Tests by a person from a different organization or company, such as outsourced testing or
certification by an external body.
To achieve successful testing it’s important for the software engineers to consider the
psychological aspects of testing, as they can interrupt the result of testing and can impact the
performance of the end product. The importance of these technological aspects is similar to
any other tool or technique adopted for the process of testing.
The mindset of the team members, the communication between them, and most importantly
the test independence while performing the testing is crucial and needs great consideration.
Therefore, if you want your software testing to be free of any hurdles, do consider the
psychological aspects stated above.
Testing is the process of executing a program to find errors. To make our software perform
well it should be error-free. If testing is done successfully it will remove all the errors from
the software.
Principles of Testing:-
1. Unit Testing
It focuses on the smallest unit of software design. In this, we test an individual unit or group
of interrelated units. It is often done by the programmer by using sample input and observing
its corresponding outputs.
Example:
2. Integration Testing
The objective is to take unit-tested components and build a program structure that has been
dictated by design. Integration testing is testing in which a group of components is combined
to produce output.
Integration testing is of four types: (i) Top-down (ii) Bottom-up (iii) Sandwich (iv) Big-Bang
Example:
(a) Black Box testing:- It is used for validation. In this, we ignore internal
working mechanisms and focus on what is the output?.
3. Regression Testing
Every time a new module is added leads to changes in the program. This type of testing
makes sure that the whole component works properly even after adding components to the
complete program.
Example
In school, record suppose we have module staff, students and finance
combining these modules and checking if on integration of these modules
works fine in regression testing
4. Smoke Testing
This test is done to make sure that the software under testing is ready or stable for further
testing
It is called a smoke test as the testing of an initial pass is done to check if it did not catch the
fire or smoke in the initial switch on.
Example:
If the project has 2 modules so before going to the module make sure that
module 1 works properly
5. Alpha Testing
This is a type of validation testing. It is a type of acceptance testing which is done before the
product is released to customers. It is typically done by QA people.
Example:
6. Beta Testing
The beta test is conducted at one or more customer sites by the end-user of the software. This
version is released for a limited number of users for testing in a real-time environment
Example:
7. System Testing
This software is tested such that it works fine for the different operating systems. It is covered
under the black box testing technique. In this, we just focus on the required input and output
without focusing on internal working. In this, we have security testing, recovery testing,
stress testing, and performance testing
Example:
In this, we give unfavorable conditions to the system and check how they perform in those
conditions.
Example:
(a) Test cases that require maximum memory or other resources are
executed
(b) Test cases that may cause thrashing in a virtual operating system
(c) Test cases that may cause excessive disk requirement
9. Performance Testing
It is designed to test the run-time performance of software within the context of an integrated
system. It is used to test the speed and effectiveness of the program. It is also called load
testing. In it we check, what is the performance of the system in the given load.
Example:
This testing is a combination of various testing techniques that help to verify and validate
object-oriented software. This testing is done in the following manner:
• Testing of Requirements,
• Design and Analysis of Testing,
• Testing of Code,
• Integration testing, System testing, User Testing.
Acceptance testing is done by the customers to check whether the delivered products perform
the desired tasks or not, as stated in requirements.
Software testing strategy is the planning done before testing commences and exercised
systematically to test the software. The testing strategy could be developed by the project
manager, or by the software engineers or it could even be a testing specialist.
Developing a testing strategy for software is important because if testing is not conducted
properly it would lead to wastage of time and effort and it would even be the case that some
error or bugs remain undetected. Some general characteristics that should be considered while
developing the testing strategy are as follow:
1. For successful testing, you should conduct the technical evaluation, it would
reveal many of the error before the testing starts. It would help in correcting
the technical error before the testing commences & would save time while
testing the software.
2. Testing must start from the core of the software design and it must progress
outward to incorporate testing of the entire software.
3. You should not follow the same strategy to test all the software. Appropriate
testing strategies must be developed for different software engineering
approach.
4. Generally, the developer of the software conduct the software testing, and in
case the project is large a separate team must be allotted to test the software.
5. Though debugging and testing are two distinct jobs; debugging must be
incorporated in every testing strategy.
The software testing strategy is implemented at two levels, low-level testing and high-
level testing. Low-level testing is conducted at the core of software design like verifying
the code segments of the software. Whereas, high-level testing is conducted to validate
software functions against the specified requirements of the customers.
In a simple language, verification answers the question of whether ‘we are implementing the
software correctly?’ & validating answers, the question of whether ‘we are implementing the
correct software?’.
While developing the software the software engineers first review the customer requirements,
then models it and finally go for coding. That means while developing the software
developers move inwards the spiral in an anticlockwise direction.
For testing, initially, the core part of the software is tested, each unit of the software is tested
separately to ensure that as a unit this component functions properly. Then the testing
proceeds outward the spiral along the streamlines. Moving outwards the spiral in the
clockwise direction gradually widens the scope of testing and in each turn, testing integrates
the components and ensure that all the elements of the software are functioning properly and
the desired performance is achieved.
In the image below you can see the levels of testing strategies that are developed to test the
entire software.
Unit Testing
Unit testing focuses on testing the lowest component of the software individually which is
also called unit. Unit testing involves the testing of each code segment to ensure that it
functions properly.
Integration Testing
The unit components are integrated to implement the complete software. Integration testing
involves testing the design structure of the software which include modelling and software
architecture. It focuses on verifying whether functions of the software are working properly
or not.
Validation Testing
Validation testing focuses on the testing of software against the requirements specified by the
customer.
System Testing
System testing focuses on testing the entire system as a whole and its other system elements.
It tests the performance of the system.
1. The first and foremost thing before developing and software are gathering customer
requirements. The requirements specified by the customer should be measurable so
that the testing result is not ambiguous.
2. The objective of testing should be in measurable terms. Like cost required to detect
and debug the error, time spends by the team to test the software.
3. While developing the testing strategy one must understand the need of the user who is
going to use the software.
4. The testing strategy should implement rapid testing cycles and the generated feedback
can be used in software quality control.
5. The software should be designed in a way that it is capable of diagnosing its own
errors.
6. Before testing the software do the technical analysis to discover the error before
testing commences.
7. The testing strategies should be improved for the better testing result of the software.
Key Takeaways
• The testing strategy is a plan of action developed for effective testing of the software.
• If the testing strategy is not planned properly it can waste the time, cost, effort and
resources of the organization.
• Testing strategies should include the steps involved in the testing, the time at which
these steps would be conducted to test the software. The testing strategy also
incorporates cost, time, effort and resources that would be required for testing.
• Software testing strategy incorporates verification and validation of the software.
• Verification of the software ensures that all the elements of the software are
functioning properly.
• Validation of the software ensures that the developed software satisfies the
requirement specified by the customer.
• The testing strategy moves outward in the clockwise direction the spiral from low-
level testing to high-level testing.
• The testing strategy includes unit testing, integration testing, validation testing &
system testing.
• The unit testing verifies the smallest component of the software like code segments.
• Integration testing verifies design and architecture of the software.
• Validation testing ensures that the software functions according to the requirements of
the customers.
• System testing ensures that the overall system is functioning effectively.
• The software testing strategies are developed by the project manager, developer or an
independent team is allotted for developing testing strategies.
• The testing strategy should incorporate technical review as it would discover error
prior testing starts.
Software testing is an important element of the software development lifecycle. While most
companies have dedicated testing and QA teams, there are companies that prefer hiring
developers that already have some knowledge of software testing. Here are the top principles
of software testing that every software developer should know.
3. Exhaustive testing
It is challenging to test all functions of the software with all valid and invalid combinations.
However exhaustive testing takes account of unlimited efforts. Project timelines do not allow
testing of different combinations.
4. Testing is context-dependent
Software testing is a broad concept which is applicable for software in every industry.
However, testing is always context-specific. Software testing in medical, advertising, travel is
different. Each domain needs to be tested differently. Testing a bank application is different
than testing e-commerce or advertising application.
5. Defect clustering
During testing, it often happens that the most errors are related to small modules. There can be
multiple reasons behind this. The basic principle of software testing states that 80% of
problems are usually found in 20% modules. Defect clustering is an important concept that
developers must learn.
• Verification is done at the starting of the development process. It includes reviews and
meetings, walk-throughs, inspection, etc. to evaluate documents, plans, code,
requirements and specifications.
• Suppose you are building a table. Here the verification is about checking all the parts of
the table, whether all the four legs are of correct size or not. If one leg of table is not of
the right size it will imbalance the end product. Similar behavior is also noticed in case
of the software product or application. If any feature of software product or application
is not up to the mark or if any defect is found then it will result into the failure of the
end product. Hence, verification is very important. It takes place at the starting of the
development process.
1. Verification helps in lowering down the count of the defect in the later stages of
development.
2. Verifying the product at the starting phase of the development will help in
understanding the product in a better way.
3. It reduces the chances of failures in the software application or product.
4. It helps in building the product as per the customer specifications and needs.
VALIDATION OF SOFTWARE TESTING
Activities:
• Unit Testing
• Integration Testing
• System Testing
• User Acceptance Testing
Virtual Users:
Virtual user is a common terminology used from a performance testing point of view. A
Virtual user generator enables testers to create virtual users in order to increase the user load
on the application under test.
Virtual user generator captures the requests to create a virtual user and it can read user
operations.
For defect prevention, there are different methods that are generally used over a long period
of time. These methods or activities are given below :
As software development proceeds, the structure turns out to be more complicated. It is very
evident that any fault is difficult to find when the system becomes greater. So, the defect
prevention strategies in software testing turn out to be imperative.
The job of testers with the correct dimension of experience is exceptionally critical now; they
should be involved in defect prevention activities to guarantee the smooth working of
different tasks. It is extremely dangerous to trust that defects will occur at a later stage.
In Medical Science there is a principle, “Prevention is better than Cure”; the equivalent
applies to the Software Development Life Cycle. Consequently, it is extremely important to
control Defect Detection by removing them before they show up in the system. Such defect
prevention techniques assist testers with building a high-quality product and furthermore
reduce the project cost.
Defect prevention strategies in software testing are a standout amongst the most vital software
quality assurance activities of an SDLC, which directly affects controlling the cost of the
project and the quality of deliverables. The cost of rectifying the defect in the product is high
when contrasted with anticipating. Henceforth it is constantly advisable to take measures,
which will keep the defect being presented in the product, as early as possible.
The amount of rework is a noteworthy cost factor in software maintenance and development.
The number of defects and problems related to the product are an immediate contribution to
this cost. Estimation of issues and defects can assist us with understanding where and how the
defects and issues happen and give knowledge to strategies for detection, prevention, and
prediction and monitor costs.
In brief, following are the defect prevention roles for testers in each of the below stages:
• Design Review:
Design stage can be viewed as a system phase of sorts and experiencing it will guarantee that
the QA team understands the upsides and downsides of every procedure.
This sort of basic walkthrough will help uncover any issues with the said systems and fix
them before going further. This can be viewed as a feasibility study for the system.
• Code Review:
There isn’t a lot for testers to directly get engaged with this stage, yet the review goes on here
as well. Developers do code assessments, walkthroughs, and reviews before they unit and
integration test the application.
Software Defect Prevention Methods and Techniques:
Some traditional and common defect prevention strategies in software testing that have been
in use since a long time for defect prevention are listed below:
1. Review and Inspection: This technique incorporates the survey by an individual
colleague, peer reviews and assessment of all work products.
2. Walkthrough: This is pretty much like a review yet it’s mostly identified with
contrasting the system to the prototype which will give a superior thought in regards
to the accuracy as well as the look-and-feel of the system.
3. Defect Logging and Documentation: This strategy gives some key data,
arguments/parameters that can be utilized to help in analyzing
4. Root Cause Analysis: Root cause analysis incorporates two noteworthy
methodologies:
• Pareto Analysis:
The Pareto analysis is a formal and easy method which organizes the request of issue goals
for maximum impact. It expresses that 80% of the issue emerges because of 20% reasons.
• Fishbone Analysis:
It is also called Ishikawa Analysis this strategy is a more visual root cause analysis method.
There are no insights required as this technique depends on team-wide brainstorming.
Some of the advantages of defect prevention in software testing:
• Quicker Delivery – Accelerate the release cycles – Ensure smooth conveyances.
Software Development free of Hassles
• Increase Customer satisfaction
• Reduction of costs
• Reduction of Rework