SlideShare a Scribd company logo
Unit 4
Testing Web Applications
• Web pages and websites have become an
integral part of modern civilization.
• We may visit a website and may find a good
number of web pages designed for specific
applications.
• The quality of a web application must be
assured in terms of response time, ease of
use, number of users, ability to handle varied
spikes in traffic, provide accurate
information, etc.
• Compromise in any of these parameters may
compel the customers to move on to the
competitor’s site.
• Testing these web pages is a real challenge
because conventional testing techniques may
not be directly applicable
WHAT IS WEB TESTING?
• The main challenge of testing a web
application is not only to find common
software errors, but also to test associated
quality related risks that are specific to a web
application.
• We should know the architecture and key
areas of web application to effectively plan
and execute the testing
Web Application Testing Challenges
Testing is a fundamental challenge when
developing web applications.
Below are five web application testing
challenges faced by web developers during the
development process.
1.Integration
While developing any application, we don’t know which
device, operating system & browsers our customers will be
using while browsing our web application.
We call it responsive web application development.
But, in software testing industry, they need to be tested for
various functionalities to work on any environment, device
and browser.
2. Security
We all are aware of the cyber threats that can take place at any moment.
Regular security testing is required to check for any cyber threat.
Also, data integrity tests need to be performed if there are any chances
of data loss.
Testers take due time to perform security tests as they carefully deal
with the unsecured data transfer.
How about the risks based on Intranet-based applications and Internet-
based applications?
Intranet-based applications are bound to pre-defined usage of software
and hardware required and they can be tested easily.
But, when it comes to Internet-based applications, security measures
are defined much more clearly by the skilled testers and QA team.
3. Performance
Application’s Page/Loading Speed matters a lot.
And seriously, we make sure our customer’s application loads
much faster as delay in a single second can divert the user and
we don’t want that, period.
Hardware testing, misunderstanding the required application’s
features can surely lead to a breach of application
performance. Integration and interoperability testing directly
influence performance testing.
4. Lower Internet Speed/Bandwidth
Low Internet speed is hated by you, me and everyone.
So, we want applications to work on those devices as well
where people don’t have high Internet Bandwidth.
While considering testing Internet-based applications, with
low Internet speed, we can imagine that various web
components can take more time to load and that can affect
other components as well.
So, this is quite important to test.
5. Firewalls
The web applications need to be tested across various
firewalls.
There are chances that certain ports might have been blocked
and still the web application is expected to behave well.
These scenarios need to be tested as well.
6. Cross Browser
Web applications need to be tested on various browsers to
ensure the website works perfectly fine in each and every
browser. Here, various browser testing tools can help.
In fact, an application needs to be considered to perform
browser testing as similar browsers can be used in various
devices with varying screen resolution and software and
hardware specifications.
2016
Strategies of testing web application (5 marks)
• Functionality
• Usability
• Browser compatibility
• Security
• Load and stress
• Storage and Database
FUNCTIONAL TESTING
• Functional testing involves checking of the
specified functionality of a web application.
• Functional test cases for web applications may be
generated using boundary value analysis,
equivalence class testing, decision table testing
and many other techniques.
• Table 11.2 presents some sample functional test
cases of the order process form of an online
shopping website.
• This example of eCommerce application sells
products such as computers, mobile phones,
cameras, electronics, etc.
• For each item it lists the name, quality, price and
brief description.
 Software Testing Introduction (Part 4))
 Software Testing Introduction (Part 4))
 Software Testing Introduction (Part 4))
• It also displays an image of the item.
• The user may browse through the product and search
any product by its name, price or any other descriptive
keyword.
• The user is required to register on the website to
obtain access to the online shopping cart (a common
tool used by users to place an order online).
• The user selects various items and adds them to the
shopping cart.
• After selecting items and adding those to the shopping
cart, the user may choose to checkout in order to
generate a bill.
• The application then requests the user to enter his
credit card information and shipping preferences and
after that the order is completed.
• Finally, the application displays the maximum
number of days in which the item will be
delivered to the user.
• The user may enquire about the order status
any time.
• The option for providing feedback is also
available on the website.
• The home page of this web application is
given in Figure 11.4.
 Software Testing Introduction (Part 4))
2. USER INTERFACE TESTING
• User interface testing tests that the user
interaction features work correctly.
• These features include hyperlinks, tables, forms,
frames and user interface items such as text
fields, radio buttons, check boxes, list boxes,
combo boxes, command buttons and dialog
boxes.
• User interface testing ensures that the application
handles mouse and keyboard events correctly
and displays hyperlinks, tables, frames, buttons,
menus, dialog boxes, error message boxes, and
toolbars properly.
1. Navigation Testing
• Navigation testing investigates the proper functioning
of all the internal and external links.
• Navigation testing must ensure that websites provide
consistent, well-organized links and should also
provide alternative navigation schemes such as search
options and site maps.
• The placement of navigation links on each page must
be checked.
• Search based navigation facility must also be
thoroughly tested and search items should be
consistent across one page to another.
• All the combinations of keywords and search criteria
must be verified in navigation testing.
• Table 11.3 presents test cases for navigation testing for
an online shopping website as
• given in Figure 11.4.
• In Table 11.5, the given user interface testing
checklist includes issues on hyperlinks for
testers to ensure their proper functioning.
 Software Testing Introduction (Part 4))
 Software Testing Introduction (Part 4))
• Manual checking of hyperlinks can be very time
consuming.
• There are various online tools available for
checking broken links, accuracy and availability of
links and obtaining advice on search engines.
• Some tools for navigation testing include
Performance Technologies’ TestLink, W3C’s Link
checker, Xenu’s LinkSleuth, Dead Links’ Dead
Links, LinkTiger’s LinkTiger, Viable Software
Alternative’s LinkRunner, Elsop’s LinkScan, REl
Software’s Link Validator, UCI’s MQMspider and
Illumit’s WebLight.
Form Based Testing
• Websites that include forms need to ensure that all
the fields in the form are working properly.
• Form-based testing involves the following issues:
Proper navigation from one field of the form to
another using the tab key.
1. Ensures that the data entered in the form is in a
valid format.
2. Checks that all the mandatory fields are entered in
the form.
3. Consider the registration form of an online shopping
website (web page is given in Figure 11.5).
Its inputs include login id, password, repeat password,
name, last name, email address, phone number,
shipping details (address, city, state, zip code) and
billing details (address, city, state, zip code). Its form
based test cases are shown in Table 11.4
 Software Testing Introduction (Part 4))
 Software Testing Introduction (Part 4))
Browser Testing
• There are a large number of browsers available
and the behavior of each of them may vary.
Although it is impractical to test the web
application with all the browsers, it is necessary to
verify the web application with specified and
prioritized platforms to ensure its correct
functioning.
• Browser testing verifies the functioning of web
application in terms of text, audio, video and
operating system corresponding to different
browsers.
• Browser compatibility matrix may be created to
test the web application on different browsers.
Table 11.7 presents browser compatibility matrix
for testing a web application.
 Software Testing Introduction (Part 4))
Usability Testing
• What makes a web application usable? Usability is one
of the quality attributes that a web application must
possess.
• It is important to develop a website that is easy to use.
Whenever the user browses an online shopping
website, several questions may come to his/her mind.
• What is the credibility and reputation of the website?
Are shipping charges applicable? In how many days a
product will be delivered? Is there any guidance on
how to place an order?
• In case of any problem, is there any grievance
redressal mechanism(complain from citizens and
consumers)?
• These kinds of usability issues are faced by everyone
who tries to purchase an item from an online shopping
website
• Usability is concerned with the degree to
which the software fulfils the user’s
specifications and expectations.
• It is the measurement of the amount of
satisfaction of the user.
• It also assesses the extent to which the user
finds the software easy to use, learn and
understand.
• Usability can be divided into one or more
attributes such as accuracy, efficiency,
completeness, learn ability, satisfaction,
clarity and accuracy of online help and
written documentation
 Software Testing Introduction (Part 4))
 Software Testing Introduction (Part 4))
Alpha and Beta Testing
• These terms are used when the software is
developed as a product for anonymous
customers.
• Therefore, acceptance testing is not possible.
• Some potential customers are identified to test
the product.
• The alpha tests are conducted at the developer’s
site by the customer.
• These tests are conducted in a controlled
environment and may start when the formal
testing process is near completion.
• The beta tests are conducted by potential
customers at their sites. Unlike alpha testing, the
developer is not present here.
• It is carried out in an uncontrolled real life
environment by many potential customers.
• Customers are expected to report failures, if any,
to the company.
• These failure reports are studied by the
developers and appropriate changes are made in
the software.
• Beta tests have shown their advantages in the
past and releasing a beta version of the software
to the potential customer has become a common
practice.
• The company gets the feedback of many potential
customers without making any payment.
• The other good thing is that the reputation of the
company is not at stake even if many failures are
encountered.
• Acceptance Testing:
• This term is used when the software is developed
for a specific customer.
• The customer is involved during acceptance
testing.
• He/she may design adhoc test cases or well-
planned test cases and execute them to see the
correctness of the software.
• This type of testing is called acceptance testing
and may be carried out for a few weeks or
months.
• The discovered errors are fixed and modified and
then the software is delivered to the customer
SECURITY TESTING
• Security is the procedure used to protect information
from various threats.
• It is very important to protect sensitive and critical
information and data while communicating over the
network.
• The user wants implementation of a safeguard to
protect personal, sensitive and financial information.
• We want data to be accurate, reliable and protected
against unauthorized access.
• Security involves various threats such as unauthorized
users, malicious users, message sent to an
unintended user, etc.
• Some of the security threats are shown in Figure 11.10
• The primary requirement of security includes:
(i) Authentication: Is the information sent from an
authenticated user?
(ii) Access Control: Is data protected from unauthorized
users?
(iii) Integrity: Does the user receive exactly what is sent?
(iv) Delivery: Is the information delivered to the intended
user?
(v) Reliability: What is the frequency of a failure? How
much time does the network take to recover from a
failure?
• What measures are taken to counter catastrophic
failure?
(vi) Non-repudiation: Is the receiver able to prove that
the data received came from a specific sender?
 Software Testing Introduction (Part 4))
• A web application must fulfil the above
mentioned primary security requirements.
• Testing the threats and vulnerabilities in a web
application is an important activity.
• The tester must check the web application
against all known internet threats.
PERFORMANCE TESTING
• How long does an application take to respond to a user
click?
• We must ensure that the user does not wait for a
service for long, otherwise the potential user will
move on to the competitor’s site.
• To ensure that the web application can bear the load
during the peak hours along with serving the user in a
timely and reliable manner, performance tests
including load and stress tests need to be conducted.
• One of the key advantages of web application is that
numerous users can have access to the application
simultaneously.
• Hence, the performance of the application during the
peak periods must be tested and monitored carefully.
• Several factors that may influence performance
include:
(i) Memory available
(ii) Network bandwidth
(iii) Number of users
(iv) User type
(v) Time to download
(vi) Varied client machine configurations
1. Stress Testing
• Stress testing involves execution of a web
application with more than maximum and varying
loads for long periods.
• Unlike performance and load testing, stress
testing evaluates the response of the system
when the system is given a load beyond its
specified limits.
• It is also used to monitor and check the reliability
of a web application when available resources are
on beyond maximum usage.
• The behavior of the system is monitored to
determine when the system under stress test fails
and how does it recover from the failure.
• Stress tests may test the web application for
the following:
1. CPU and memory usage
2. Response time
3. Backend database
4. Different types of users
5. Concurrent users
• The system performance is expected to
degrade when a large number of users hit the
web site simultaneously.
• After the completion of stress tests, the
testing team must analyze the noted system’s
performance degradation points and
compare them with the acceptable
performance of the system.
2. Load Testing
• Load testing involves testing the web application
under real world scenarios by simulating
numerous users accessing the web application
simultaneously.
• It tests the web application by providing it
maximum load.
• The development of plans for load testing should
begin as early as possible during the software life
cycle.
• Early testing will help in detection of problems
prior to deployment of the web application.
• Load testing may follow the following steps in
order to ensure reasonable performance during
peak hours
1. Defining the testing strategy and
determining the number of users
2. Identifying potential metrics
3. Choosing the right tool and executing the
load test
4. Interpreting the results
Example
Suppose a website is designed and web server
can handle load upto 100 request at a time.
When load testing is performed than max 100
or less users can request to access the website.
load testing checks the performance of website
When stress testing is performed than there is
no limit on numbers of users accessing website
at a particular time.
Stress testing checks the reliability of the
website.
 Software Testing Introduction (Part 4))
DATABASE TESTING
• In web applications, many applications are
database driven, for example, e-commerce
related websites or business-to-business
applications.
• It is important for these applications to work
properly and provide security to the user’s
sensitive data such as personal details and
credit card information.
• For example, consider the example for
purchasing items from an online store.
• If the user performs a search based on some
keywords and price preferences, a database
query is created by the database server.
• Suppose due to some programming fault in
the query, the query does not consider the
price preferences given by the customer, this
will produce erroneous results.
• These kinds of faults must be tested and
removed during database testing
• kinds of faults must be tested and removed
during database testing.
• Important issues in database testing may
include:
1. Data validation
2. Data consistency
3. Data integrity
4. Concurrency control and recovery
5. Data manipulation operations such as
addition, deletion, updation and retrieval of
data.
6. Database security
WEB METRICS
• Web page metrics can be effectively used in measuring
various attributes of a web page.
• Table 11.13 provides comprehensive web page
measures.
• There are 41 web page metrics which influence
usability.
• These attributes/metrics can be divided into three
categories: Page composition metrics
• (i) Page formatting metrics and
• (ii) Overall page quality or assessment metrics
• (iii) Most of the page composition and page formatting
metrics can be easily calculated but the attributes that
fall in the category 3 i.e. overall page quality or
assessment metrics, requires designer and/or user
evaluation [MALH10].
 Software Testing Introduction (Part 4))
Object Oriented Testing
• The whole object oriented testing revolves around
the fundamental entity known as “class”.
• With the help of “class” concept, larger systems can
be divided into small well defined units which may
then be implemented separately.
• The object oriented testing can be classified as like
conventional systems.
• These are called as the levels for testing
Classes and Objects
• We consider the same example of sending a book to a
teacher.
• The selection of the courier company is based on its
reputation and proximity to our house.
• A courier management system is required in order to
send a book to a teacher.
• All courier types (such as book, pen, etc.) may be
combined to form a group and this group is known as a
class.
• All objects are instances of a class.
• The class describes the structure of the instances
which include behaviour and information.
• In our example, courier (containing courier details) is
a class and all courier types are its objects as shown
in Figure 9.1.
 Software Testing Introduction (Part 4))
WHAT IS OBJECT ORIENTED TESTING
• Object oriented programming concepts are different
from conventional programming and have become the
preferred choice for a large scale system design.
• The fundamental entity is the class that provides an
excellent structuring mechanism.
• It allows us to divide a system into well defined units
which may then be implemented separately.
• We still do unit testing although the meaning of unit
has changed.
• We also do integration and system testing to test the
correctness of implementation.
• We also do regression testing in order to ensure that
changes have been implemented correctly.
• However, many concepts and techniques are different
from conventional testing.
Levels of Testing
• We may have 3 or 4 levels of testing
depending on our approach.
The various testing levels are:
1. Method testing (Unit testing)
2. Class testing (Unit testing)
3. Inter-class testing (Integration testing)
4. System testing
What is a Unit?
• In conventional programming, a unit is the smallest
portion of the program that can be compiled and
executed.
• We may call it a module, component, function or
procedure.
• In object oriented system, we have two options for a
unit.
1. We may treat each class as a unit or may treat each
method within a class as a unit.
• If a class is tested thoroughly, it can be reused
without being unit tested again.
• Unit testing of a class with a super class may be
impossible to do without the super classes’
methods/variables.
• One of the solutions is to merge the super class and
the class under test so that all methods and variables
are available.
• Generally, classes are selected as a unit for the
purpose of unit testing.
Base Class
Child Class
Explanation
• If we want to test Derived class than we have
to merge Base class and Derived class and
than perform testing on member functions
and data members of both class.
• Another way to test a class, we may create an
instance of the class i.e. object, and pass the
appropriate parameters to the constructor.
• We may further call the methods of the object
passing parameters and receive the results.
• We should also examine the internal data of
the object.
• The encapsulation plays an important role in
class testing because data and function
(operations) are combined in a class.
• We concentrate on each encapsulated class
during unit testing but each function may be
difficult to test independently.
Example
Class Student
{
int rollno;
Char name[30];
public Student (int r, char n[30])
{
rollno=r;
strcpy(name,n);
}
};
public void show()
{
cout<<“Rollno ”<<rollno<<“Name “<<name;
}
void main()
{
printf(“Enter Rollno between 1 to 50“);
Scanf(“%d”,&rollno”);
Printf(“Enter Name :”);
Scanf(“%s”,name);
if(rollno>50 || rollno<1)
printf(“Rollno is invalid !!!!”);
else
{
Student obj1=new Student(51,”himanshu”);
Student obj2=new Student(0,”Ram”);
Student obj3=new Student(1,”Rahul”);
obj1.show();
obj2.show();
obj3.show();
} getch();
}
Output
Rollno is invalid
Rollno is invalid
Rollno 1 Name Rahul
2. Inter-Class testing
• It is also called as integration or subsystem
testing.
• Inter class testing involves the testing of
modules or sub-systems and their
coordination with other modules.
Example
#include<conio.h>
#include<stdio.h>
Void input()
{ int rollno;
Char name[30];
printf(“Enter Rollno between 1 to 50 :”);
scanf(“%d”,&rollno);
printf(“Enter Name :”);
scanf(“%s”,name);
display(rollno,name);
}
Void display(int rollno, char name[30])
{
If(rollno>50 || rollno<1)
printf(“You have entered a invalid rollno”);
else
printf(“Roll no : %d Name : %s”,rollno,name);
}
Void main()
{
input();
}
Test Case
1. Enter Rollno : 12
Enter Name : Ram
Output : Roll no : 12 Name : Ram
2. Enter Rollno: 0
Enter Name : xyz
Output: You have entered a invalid rollno
3. Enter Rollno: 51
Enter Name : yxs
Output: You have entered a invalid rollno
3. System testing, the system is tested as whole
and primarily functional testing techniques are
used to test the system.
• Non-functional requirements like
performance, reliability, usability and test-
ability are also tested.
• Integration testing in object oriented system is also
called inter-class testing.
• We do not have hierarchical control structure in object
orientation and thus conventional integration testing
techniques like top down, bottom up and sandwich
integration cannot be applied.
• There are three popular techniques for inter-class
testing in object oriented systems.
• The first is the thread based testing where we
integrate classes that are needed to respond to an
input given to the system.
• Whenever we give input to a system, one or more
classes are required to be executed that respond to
that input to get the result.
• We combine such classes which execute together for a
particular input or set of inputs and this is treated as a
thread.
• The second is the use case based testing
where we combine classes that are required
by one use case.
• The third is the cluster testing where we
combine classes that are required to
demonstrate one collaboration.
• In all three approaches, we combine classes
on the basis of a concept and execute them to
see the outcome.
• Thread based testing is more popular due to
its simplicity and easy implementability.
Object oriented testing techniques
• Path testing, state based testing and class
testing are popular object oriented testing
techniques.
1. PATH TESTING
• path testing is a structural testing technique
where the source code is required for the
generation of test cases.
1.1 Activity Diagram
• The first step of path testing is to convert source
code into its activity diagram.
• In Unified Modeling Language (UML), activity
diagram is used to represent sequences in which
all activities are performed.
• This is similar to a flow graph which is the basis of
conventional path testing.
• Activity diagram may be generated from a use
case or from a class.
• It may represent basic flow and also possible
alternative flows.
• As shown in Figure 9.5, the start state is
represented by a solid circle and the end state is
represented by a solid circle inside a circle.
• The activities are represented by rectangles with
rounded corners along with their descriptions.
• Activities are nothing but the set of operations.
• After execution of these set of activities, a transition
takes place to another activity.
• Transitions are represented by an arrow.
• When multiple activities are performed
simultaneously, the situation is represented by a
symbol ‘fork’.
• The parallel activities are combined after the
completion of such activities by a symbol ‘join’.
• The number of fork and join in an activity diagram are
the same.
• The branches are used to describe what activities are
performed after evaluating a set of conditions.
• Branches may also be represented as
diamonds with multiple labelled exit arrows.
• A guard condition is a boolean expression and
is also written along with branches.
• An activity diagram consisting of seven
activities is shown in Figure 9.5.
 Software Testing Introduction (Part 4))
• In the activity diagram given in Figure 9.5, Activity
2 and Activity 3 are performed simultaneously
and combined by a join symbol.
• After Activity 4, a decision is represented by a
diamond symbol and if the guard condition is true,
Activity 5 is performed, otherwise Activity 6 is
performed.
• The fork has one incoming transition (Activity 1 is
split into sub activities) and two outgoing
transitions.
• Similarly join has two incoming transitions and
one outgoing transition.
• The symbols of an activity diagram are given in
Table 9.1.
 Software Testing Introduction (Part 4))
2. Calculation of Cyclomatic Complexity
cyclomatic complexity of a graph is given as:
V(G)=e-n+2P
3. Generation of Test Case
After the identification of independent paths,
we may generate test cases that traverse all
independent paths at the time of executing the
program.
This process will ensure that each transition of
the activity diagram is traversed at least once.
• Consider the program given in Figure 9.9 for
determination of the largest amongst three
numbers.
• There are three methods in this program
getdata, validate and maximum.
• Design test cases for validate and maximum
methods of the class using path testing.
 Software Testing Introduction (Part 4))
 Software Testing Introduction (Part 4))
 Software Testing Introduction (Part 4))
 Software Testing Introduction (Part 4))
 Software Testing Introduction (Part 4))
2. STATE BASED TESTING
• State based testing is used as one of the most
useful object oriented software testing
techniques.
• It uses the concept of state machine of electronic
circuits where the output of the state machine is
dependent not only on the present state but also
on the past state.
• A state represents the effect of previous inputs.
• Hence, in state machine, the output is not only
dependent on the present inputs but also on the
previous inputs.
• In electronic circuits, such circuits are called
sequential circuits.
2.1 What is a State Machine
• State machines are used to model the behavior of
objects.
• A state machine represents various states which
an object is expected to visit during its lifetime in
response to events or methods along with its
responses to these events or methods.
• A state is represented by rectangles with
rounded corners and transitions are represented
by edges (arrows).
• Events and actions are represented by
annotations on the directed edges.
• A typical state machine is shown in Figure 9.12
and descriptions of its associated terms are given
in Table 9.6.
 Software Testing Introduction (Part 4))
 Software Testing Introduction (Part 4))
• In the Figure 9.12, there are two states state1 and
state2.
• If at state1, input A is given and (x>y), then state1 is
changed to state2 with an output ‘next’.
• At state2, if the input is B and (x<y), then state2 is
changed to state1 with an output ‘previous’.
• Hence, a transition transfers a system from one state
to another state.
• The first state is called the accepting state and
another is called the resultant state.
• Both states (accepting and resultant) may also be the
same in case of self-loop conditions.
• The state in question is the current state or present
state.
• Transition occurs from the current state to the
resultant state.
3. CLASS TESTING
• A class is very important in object oriented
programming.
• Every instance of a class is known as an object.
• Testing of a class is very significant and critical in
object oriented testing where we want to verify the
implementation of a class with respect to its
specifications.
• If the implementation is as per specifications, then it is
expected that every instance of the class may behave
in the specified way.
• Class testing is similar to the unit testing of a
conventional system.
• We require stubs and drivers for testing a ‘unit’ and
sometimes, it may require significant effort.
• Similarly, classes also cannot be tested in
isolation.
• They may also require additional source code
(similar to stubs and drivers) for testing
independently
1. How Should We Test a Class?
• We want to test the source code of a class.
Validation and verification techniques are
equally applicable to test a class.
• We may review the source code during
verification and may be able to detect a good
number of errors.
• Reviews are very common in practice, but
their effectiveness is heavily dependent on the
ability of the reviewer(s).
• Another type of testing is validation where
we may execute a class using a set of test
cases.
• We should always remember that classes are
tested by creating instances and testing the
behaviour of those instances [MCGR01].
2. Issues Related to Class Testing
• How should we test a class?
• We may test it independently, as a unit or as a
group of a system.
• The decision is dependent on the amount of
effort required to develop a test driver, severity
of class in the system and associated risk with it
and so on.
• If a class has been developed to be a part of a
class library, thorough testing is essential even if
the cost of developing a test driver is very high
• Classes should be tested by its developers after
developing a test driver.
• Developers are familiar with the internal design,
complexities and other critical issues of a class under
test and this knowledge may help to design test cases
and develop test driver(s).
• Class should be tested with respect to its specifications.
If some unspecified behaviors have been implemented,
we may not be able to test them.
• We should always be very careful for additional
functionalities which are not specified.
• Generally, we should discourage this practice and if it
has been implemented in the SRS document, it should
immediately be specified.
• A test plan with a test suite may discipline the testers
to follow a predefined path.
• This is particularly essential when developers are also
the testers
3. Generating Test Cases
• One of the methods of generating test cases is
from pre and post conditions specified in the use
cases.
• The pre and post conditions of every method may
be used to generate test cases for class testing.
• Every method of a class has a pre-condition that
needs to be satisfied before the execution.
• Similarly, every method of a class has a post-
condition that is the resultant state after the
execution of the method.
• Consider a class ‘stack’ given in Figure 9.16 with
two attributes (x and top) and three methods
(stack(), push(x), pop()).
 Software Testing Introduction (Part 4))
• We should first specify the pre and post
conditions for every operation/method of a
class.
• We may identify requirements for all possible
combinations of situations in which a
precondition can hold and post-conditions can
be achieved.
• We may generate test cases to address what
happens when a pre-condition is violated
• We consider the stack class given in Figure
9.16 and identify the following pre and post
conditions of all the methods in the class:
• After the identification of pre and post
conditions, we may establish logical relationships
between pre and post conditions.
• Every logical relationship may generate a test
case.
• We consider the push() operation and establish
the following logical relationships:
Constructor
Push Method
Pop Method
We may identify test cases for every operation/method using
pre and post conditions.
We should generate test cases when a pre-condition is true
and false.
Both are equally important to verify the behaviour of a class.
We may generate test cases for push(x) and pop() operations
(refer Table 9.11 and Table 9.12).
 Software Testing Introduction (Part 4))
• Example 9.3. Consider the example of
withdrawing cash from an ATM machine given
in example 9.2.
• Generate test cases using class testing.
 Software Testing Introduction (Part 4))
 Software Testing Introduction (Part 4))
What is GUI Software Testing?
• GUI testing is a testing technique in which the
application's user interface is tested whether
the application performs as expected with
respect to user interface behaviour.
• GUI Testing includes the application behaviour
towards keyboard and mouse movements and
how different GUI objects such as toolbars,
buttons, menubars, dialog boxes, edit fields,
lists, behavior to the user input.
GUI Testing Guidelines
1. Check Screen Validations
2. Verify All Navigations
3. Check usability Conditions
4. Verify Data Integrity
5. Verify the object states
6. Verify the date Field and Numeric Field
Formats
GUI Testing Techniques / Methods
• GUI testing can be done in three ways:
1. Manual Based Testing
2. Record and Replay
3. Model Based Testing
1. Manual Based Testing
• Under this approach, graphical screens are
checked manually by testers in conformance
with the requirements stated in the business
requirements document.
2. Record and Replay
• GUI testing can be done using automation
tools. This is done in 2 parts.
• During Record, test steps are captured by the
automation tool.
• During playback, the recorded test steps are
executed on the Application Under Test.
• Example of such tools - QTP.
 Software Testing Introduction (Part 4))
3. Model Based Testing
• A model is a graphical description of a system's
behavior.
• It helps us to understand and predict the system
behavior.
• Models help in a generation of efficient test cases
using the system requirements.
• The following needs to be considered for this model
based testing:
1. Build the model
2. Determine Inputs for the model
3. Calculate the expected output for the model
4. Run the tests
5. Compare the actual output with the expected output
6. A decision on further action on the model
 Software Testing Introduction (Part 4))
Ad

More Related Content

Similar to Software Testing Introduction (Part 4)) (20)

BOOST YOUR WEBSITE WITH TOP STRATEGIES TOOLS FOR WEB APP TESTING.pdf
BOOST YOUR WEBSITE WITH TOP STRATEGIES TOOLS FOR WEB APP TESTING.pdfBOOST YOUR WEBSITE WITH TOP STRATEGIES TOOLS FOR WEB APP TESTING.pdf
BOOST YOUR WEBSITE WITH TOP STRATEGIES TOOLS FOR WEB APP TESTING.pdf
asiyahanif9977
 
Best Practices & Testing Process of Mobile Application Testing.pptx
Best Practices & Testing Process of Mobile Application Testing.pptxBest Practices & Testing Process of Mobile Application Testing.pptx
Best Practices & Testing Process of Mobile Application Testing.pptx
Calidad Infotech
 
GUI, Performance, Load and API testing with Test Studio
GUI, Performance, Load and API testing with Test StudioGUI, Performance, Load and API testing with Test Studio
GUI, Performance, Load and API testing with Test Studio
Thessaloniki Software Testing and QA meetup
 
Mobile Website Testing_ A Comprehensive Guide .pdf
Mobile Website Testing_ A Comprehensive Guide .pdfMobile Website Testing_ A Comprehensive Guide .pdf
Mobile Website Testing_ A Comprehensive Guide .pdf
Steve Wortham
 
Automated Front End Testing_ Navigating Types and Tools for Optimal Web Devel...
Automated Front End Testing_ Navigating Types and Tools for Optimal Web Devel...Automated Front End Testing_ Navigating Types and Tools for Optimal Web Devel...
Automated Front End Testing_ Navigating Types and Tools for Optimal Web Devel...
flufftailshop
 
Automated Front End Testing_ Navigating Types and Tools for Optimal Web Devel...
Automated Front End Testing_ Navigating Types and Tools for Optimal Web Devel...Automated Front End Testing_ Navigating Types and Tools for Optimal Web Devel...
Automated Front End Testing_ Navigating Types and Tools for Optimal Web Devel...
flufftailshop
 
Web Engineering: A Practitioner Approach -Testing web app - Content Managemen...
Web Engineering: A Practitioner Approach -Testing web app - Content Managemen...Web Engineering: A Practitioner Approach -Testing web app - Content Managemen...
Web Engineering: A Practitioner Approach -Testing web app - Content Managemen...
Esraa Farrag
 
Automated Front End Testing_ Navigating Types and Tools for Optimal Web Devel...
Automated Front End Testing_ Navigating Types and Tools for Optimal Web Devel...Automated Front End Testing_ Navigating Types and Tools for Optimal Web Devel...
Automated Front End Testing_ Navigating Types and Tools for Optimal Web Devel...
kalichargn70th171
 
Testing webapps, websites and mobile applications
Testing webapps, websites and mobile applicationsTesting webapps, websites and mobile applications
Testing webapps, websites and mobile applications
urgentpager
 
The Ultimate Website Testing Checklist for 2022
 The Ultimate Website Testing Checklist for 2022 The Ultimate Website Testing Checklist for 2022
The Ultimate Website Testing Checklist for 2022
VOCSO Technologies
 
A comprehensive guide on advantages, methods, and process of Usability Testin...
A comprehensive guide on advantages, methods, and process of Usability Testin...A comprehensive guide on advantages, methods, and process of Usability Testin...
A comprehensive guide on advantages, methods, and process of Usability Testin...
Calidad Infotech
 
most common Web Testing interview questions and answers.pptx
most common Web Testing interview questions and answers.pptxmost common Web Testing interview questions and answers.pptx
most common Web Testing interview questions and answers.pptx
MetSylvaMetuge
 
Mobile App Testing: Importance, Strategies, and Best Practices
Mobile App Testing: Importance, Strategies, and Best PracticesMobile App Testing: Importance, Strategies, and Best Practices
Mobile App Testing: Importance, Strategies, and Best Practices
StudySection
 
Understanding Web App Testing_ A Detailed Guide for Developers and QA Teams.p...
Understanding Web App Testing_ A Detailed Guide for Developers and QA Teams.p...Understanding Web App Testing_ A Detailed Guide for Developers and QA Teams.p...
Understanding Web App Testing_ A Detailed Guide for Developers and QA Teams.p...
Steve Wortham
 
Ensuring Effective Performance Testing in Web Applications.pdf
Ensuring Effective Performance Testing in Web Applications.pdfEnsuring Effective Performance Testing in Web Applications.pdf
Ensuring Effective Performance Testing in Web Applications.pdf
kalichargn70th171
 
Web testing
Web testingWeb testing
Web testing
Aprna Tripathi
 
How to Conduct Effective Functional Testing on a Web Application.pdf
How to Conduct Effective Functional Testing on a Web Application.pdfHow to Conduct Effective Functional Testing on a Web Application.pdf
How to Conduct Effective Functional Testing on a Web Application.pdf
Alpha BOLD
 
Performance testing
Performance testingPerformance testing
Performance testing
Ranpreet kaur
 
Understanding Automated Testing Tools for Web Applications.pdf
Understanding Automated Testing Tools for Web Applications.pdfUnderstanding Automated Testing Tools for Web Applications.pdf
Understanding Automated Testing Tools for Web Applications.pdf
kalichargn70th171
 
Presentation on mobile app testing
Presentation on mobile app testingPresentation on mobile app testing
Presentation on mobile app testing
Uttam Shrestha
 
BOOST YOUR WEBSITE WITH TOP STRATEGIES TOOLS FOR WEB APP TESTING.pdf
BOOST YOUR WEBSITE WITH TOP STRATEGIES TOOLS FOR WEB APP TESTING.pdfBOOST YOUR WEBSITE WITH TOP STRATEGIES TOOLS FOR WEB APP TESTING.pdf
BOOST YOUR WEBSITE WITH TOP STRATEGIES TOOLS FOR WEB APP TESTING.pdf
asiyahanif9977
 
Best Practices & Testing Process of Mobile Application Testing.pptx
Best Practices & Testing Process of Mobile Application Testing.pptxBest Practices & Testing Process of Mobile Application Testing.pptx
Best Practices & Testing Process of Mobile Application Testing.pptx
Calidad Infotech
 
Mobile Website Testing_ A Comprehensive Guide .pdf
Mobile Website Testing_ A Comprehensive Guide .pdfMobile Website Testing_ A Comprehensive Guide .pdf
Mobile Website Testing_ A Comprehensive Guide .pdf
Steve Wortham
 
Automated Front End Testing_ Navigating Types and Tools for Optimal Web Devel...
Automated Front End Testing_ Navigating Types and Tools for Optimal Web Devel...Automated Front End Testing_ Navigating Types and Tools for Optimal Web Devel...
Automated Front End Testing_ Navigating Types and Tools for Optimal Web Devel...
flufftailshop
 
Automated Front End Testing_ Navigating Types and Tools for Optimal Web Devel...
Automated Front End Testing_ Navigating Types and Tools for Optimal Web Devel...Automated Front End Testing_ Navigating Types and Tools for Optimal Web Devel...
Automated Front End Testing_ Navigating Types and Tools for Optimal Web Devel...
flufftailshop
 
Web Engineering: A Practitioner Approach -Testing web app - Content Managemen...
Web Engineering: A Practitioner Approach -Testing web app - Content Managemen...Web Engineering: A Practitioner Approach -Testing web app - Content Managemen...
Web Engineering: A Practitioner Approach -Testing web app - Content Managemen...
Esraa Farrag
 
Automated Front End Testing_ Navigating Types and Tools for Optimal Web Devel...
Automated Front End Testing_ Navigating Types and Tools for Optimal Web Devel...Automated Front End Testing_ Navigating Types and Tools for Optimal Web Devel...
Automated Front End Testing_ Navigating Types and Tools for Optimal Web Devel...
kalichargn70th171
 
Testing webapps, websites and mobile applications
Testing webapps, websites and mobile applicationsTesting webapps, websites and mobile applications
Testing webapps, websites and mobile applications
urgentpager
 
The Ultimate Website Testing Checklist for 2022
 The Ultimate Website Testing Checklist for 2022 The Ultimate Website Testing Checklist for 2022
The Ultimate Website Testing Checklist for 2022
VOCSO Technologies
 
A comprehensive guide on advantages, methods, and process of Usability Testin...
A comprehensive guide on advantages, methods, and process of Usability Testin...A comprehensive guide on advantages, methods, and process of Usability Testin...
A comprehensive guide on advantages, methods, and process of Usability Testin...
Calidad Infotech
 
most common Web Testing interview questions and answers.pptx
most common Web Testing interview questions and answers.pptxmost common Web Testing interview questions and answers.pptx
most common Web Testing interview questions and answers.pptx
MetSylvaMetuge
 
Mobile App Testing: Importance, Strategies, and Best Practices
Mobile App Testing: Importance, Strategies, and Best PracticesMobile App Testing: Importance, Strategies, and Best Practices
Mobile App Testing: Importance, Strategies, and Best Practices
StudySection
 
Understanding Web App Testing_ A Detailed Guide for Developers and QA Teams.p...
Understanding Web App Testing_ A Detailed Guide for Developers and QA Teams.p...Understanding Web App Testing_ A Detailed Guide for Developers and QA Teams.p...
Understanding Web App Testing_ A Detailed Guide for Developers and QA Teams.p...
Steve Wortham
 
Ensuring Effective Performance Testing in Web Applications.pdf
Ensuring Effective Performance Testing in Web Applications.pdfEnsuring Effective Performance Testing in Web Applications.pdf
Ensuring Effective Performance Testing in Web Applications.pdf
kalichargn70th171
 
How to Conduct Effective Functional Testing on a Web Application.pdf
How to Conduct Effective Functional Testing on a Web Application.pdfHow to Conduct Effective Functional Testing on a Web Application.pdf
How to Conduct Effective Functional Testing on a Web Application.pdf
Alpha BOLD
 
Understanding Automated Testing Tools for Web Applications.pdf
Understanding Automated Testing Tools for Web Applications.pdfUnderstanding Automated Testing Tools for Web Applications.pdf
Understanding Automated Testing Tools for Web Applications.pdf
kalichargn70th171
 
Presentation on mobile app testing
Presentation on mobile app testingPresentation on mobile app testing
Presentation on mobile app testing
Uttam Shrestha
 

More from Thapar Institute (19)

Digital Electronics Unit_4_new.pptx
Digital Electronics Unit_4_new.pptxDigital Electronics Unit_4_new.pptx
Digital Electronics Unit_4_new.pptx
Thapar Institute
 
Digital Electronics Unit_3.pptx
Digital Electronics Unit_3.pptxDigital Electronics Unit_3.pptx
Digital Electronics Unit_3.pptx
Thapar Institute
 
Digital Electronics Unit_2.pptx
Digital Electronics Unit_2.pptxDigital Electronics Unit_2.pptx
Digital Electronics Unit_2.pptx
Thapar Institute
 
Digital Electronics Unit_1.pptx
Digital Electronics Unit_1.pptxDigital Electronics Unit_1.pptx
Digital Electronics Unit_1.pptx
Thapar Institute
 
C Language Part 1
C Language Part 1C Language Part 1
C Language Part 1
Thapar Institute
 
Compiler Design Introduction
Compiler Design Introduction Compiler Design Introduction
Compiler Design Introduction
Thapar Institute
 
Web Technology Part 4
Web Technology Part 4Web Technology Part 4
Web Technology Part 4
Thapar Institute
 
Web Technology Part 3
Web Technology Part 3Web Technology Part 3
Web Technology Part 3
Thapar Institute
 
Web Technology Part 2
Web Technology Part 2Web Technology Part 2
Web Technology Part 2
Thapar Institute
 
Web Technology Part 1
Web Technology Part 1Web Technology Part 1
Web Technology Part 1
Thapar Institute
 
TOC Introduction
TOC Introduction TOC Introduction
TOC Introduction
Thapar Institute
 
CSS Introduction
CSS Introduction CSS Introduction
CSS Introduction
Thapar Institute
 
COA (Unit_4.pptx)
COA (Unit_4.pptx)COA (Unit_4.pptx)
COA (Unit_4.pptx)
Thapar Institute
 
COA(Unit_3.pptx)
COA(Unit_3.pptx)COA(Unit_3.pptx)
COA(Unit_3.pptx)
Thapar Institute
 
COA (Unit_2.pptx)
COA (Unit_2.pptx)COA (Unit_2.pptx)
COA (Unit_2.pptx)
Thapar Institute
 
COA (Unit_1.pptx)
COA (Unit_1.pptx)COA (Unit_1.pptx)
COA (Unit_1.pptx)
Thapar Institute
 
Software Testing Introduction (Part 3)
 Software Testing Introduction (Part 3) Software Testing Introduction (Part 3)
Software Testing Introduction (Part 3)
Thapar Institute
 
Software Testing Introduction (Part 2)
Software Testing Introduction (Part 2)Software Testing Introduction (Part 2)
Software Testing Introduction (Part 2)
Thapar Institute
 
Software Testing Introduction (Part 1)
Software Testing Introduction (Part 1)Software Testing Introduction (Part 1)
Software Testing Introduction (Part 1)
Thapar Institute
 
Ad

Recently uploaded (20)

Solar-wind hybrid engery a system sustainable power
Solar-wind  hybrid engery a system sustainable powerSolar-wind  hybrid engery a system sustainable power
Solar-wind hybrid engery a system sustainable power
bhoomigowda12345
 
Artificial hand using embedded system.pptx
Artificial hand using embedded system.pptxArtificial hand using embedded system.pptx
Artificial hand using embedded system.pptx
bhoomigowda12345
 
Passive House Canada Conference 2025 Presentation [Final]_v4.ppt
Passive House Canada Conference 2025 Presentation [Final]_v4.pptPassive House Canada Conference 2025 Presentation [Final]_v4.ppt
Passive House Canada Conference 2025 Presentation [Final]_v4.ppt
IES VE
 
Deploying & Testing Agentforce - End-to-end with Copado - Ewenb Clark
Deploying & Testing Agentforce - End-to-end with Copado - Ewenb ClarkDeploying & Testing Agentforce - End-to-end with Copado - Ewenb Clark
Deploying & Testing Agentforce - End-to-end with Copado - Ewenb Clark
Peter Caitens
 
Sequence Diagrams With Pictures (1).pptx
Sequence Diagrams With Pictures (1).pptxSequence Diagrams With Pictures (1).pptx
Sequence Diagrams With Pictures (1).pptx
aashrithakondapalli8
 
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptxThe-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
james brownuae
 
Time Estimation: Expert Tips & Proven Project Techniques
Time Estimation: Expert Tips & Proven Project TechniquesTime Estimation: Expert Tips & Proven Project Techniques
Time Estimation: Expert Tips & Proven Project Techniques
Livetecs LLC
 
A Comprehensive Guide to CRM Software Benefits for Every Business Stage
A Comprehensive Guide to CRM Software Benefits for Every Business StageA Comprehensive Guide to CRM Software Benefits for Every Business Stage
A Comprehensive Guide to CRM Software Benefits for Every Business Stage
SynapseIndia
 
How to Install and Activate ListGrabber Plugin
How to Install and Activate ListGrabber PluginHow to Install and Activate ListGrabber Plugin
How to Install and Activate ListGrabber Plugin
eGrabber
 
Memory Management and Leaks in Postgres from pgext.day 2025
Memory Management and Leaks in Postgres from pgext.day 2025Memory Management and Leaks in Postgres from pgext.day 2025
Memory Management and Leaks in Postgres from pgext.day 2025
Phil Eaton
 
From Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
From Vibe Coding to Vibe Testing - Complete PowerPoint PresentationFrom Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
From Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
Shay Ginsbourg
 
Do not let staffing shortages and limited fiscal view hamper your cause
Do not let staffing shortages and limited fiscal view hamper your causeDo not let staffing shortages and limited fiscal view hamper your cause
Do not let staffing shortages and limited fiscal view hamper your cause
Fexle Services Pvt. Ltd.
 
Buy vs. Build: Unlocking the right path for your training tech
Buy vs. Build: Unlocking the right path for your training techBuy vs. Build: Unlocking the right path for your training tech
Buy vs. Build: Unlocking the right path for your training tech
Rustici Software
 
Autodesk Inventor Crack (2025) Latest
Autodesk Inventor    Crack (2025) LatestAutodesk Inventor    Crack (2025) Latest
Autodesk Inventor Crack (2025) Latest
Google
 
[gbgcpp] Let's get comfortable with concepts
[gbgcpp] Let's get comfortable with concepts[gbgcpp] Let's get comfortable with concepts
[gbgcpp] Let's get comfortable with concepts
Dimitrios Platis
 
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
OnePlan Solutions
 
sequencediagrams.pptx software Engineering
sequencediagrams.pptx software Engineeringsequencediagrams.pptx software Engineering
sequencediagrams.pptx software Engineering
aashrithakondapalli8
 
Best HR and Payroll Software in Bangladesh - accordHRM
Best HR and Payroll Software in Bangladesh - accordHRMBest HR and Payroll Software in Bangladesh - accordHRM
Best HR and Payroll Software in Bangladesh - accordHRM
accordHRM
 
Top 12 Most Useful AngularJS Development Tools to Use in 2025
Top 12 Most Useful AngularJS Development Tools to Use in 2025Top 12 Most Useful AngularJS Development Tools to Use in 2025
Top 12 Most Useful AngularJS Development Tools to Use in 2025
GrapesTech Solutions
 
Orion Context Broker introduction 20250509
Orion Context Broker introduction 20250509Orion Context Broker introduction 20250509
Orion Context Broker introduction 20250509
Fermin Galan
 
Solar-wind hybrid engery a system sustainable power
Solar-wind  hybrid engery a system sustainable powerSolar-wind  hybrid engery a system sustainable power
Solar-wind hybrid engery a system sustainable power
bhoomigowda12345
 
Artificial hand using embedded system.pptx
Artificial hand using embedded system.pptxArtificial hand using embedded system.pptx
Artificial hand using embedded system.pptx
bhoomigowda12345
 
Passive House Canada Conference 2025 Presentation [Final]_v4.ppt
Passive House Canada Conference 2025 Presentation [Final]_v4.pptPassive House Canada Conference 2025 Presentation [Final]_v4.ppt
Passive House Canada Conference 2025 Presentation [Final]_v4.ppt
IES VE
 
Deploying & Testing Agentforce - End-to-end with Copado - Ewenb Clark
Deploying & Testing Agentforce - End-to-end with Copado - Ewenb ClarkDeploying & Testing Agentforce - End-to-end with Copado - Ewenb Clark
Deploying & Testing Agentforce - End-to-end with Copado - Ewenb Clark
Peter Caitens
 
Sequence Diagrams With Pictures (1).pptx
Sequence Diagrams With Pictures (1).pptxSequence Diagrams With Pictures (1).pptx
Sequence Diagrams With Pictures (1).pptx
aashrithakondapalli8
 
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptxThe-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
james brownuae
 
Time Estimation: Expert Tips & Proven Project Techniques
Time Estimation: Expert Tips & Proven Project TechniquesTime Estimation: Expert Tips & Proven Project Techniques
Time Estimation: Expert Tips & Proven Project Techniques
Livetecs LLC
 
A Comprehensive Guide to CRM Software Benefits for Every Business Stage
A Comprehensive Guide to CRM Software Benefits for Every Business StageA Comprehensive Guide to CRM Software Benefits for Every Business Stage
A Comprehensive Guide to CRM Software Benefits for Every Business Stage
SynapseIndia
 
How to Install and Activate ListGrabber Plugin
How to Install and Activate ListGrabber PluginHow to Install and Activate ListGrabber Plugin
How to Install and Activate ListGrabber Plugin
eGrabber
 
Memory Management and Leaks in Postgres from pgext.day 2025
Memory Management and Leaks in Postgres from pgext.day 2025Memory Management and Leaks in Postgres from pgext.day 2025
Memory Management and Leaks in Postgres from pgext.day 2025
Phil Eaton
 
From Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
From Vibe Coding to Vibe Testing - Complete PowerPoint PresentationFrom Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
From Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
Shay Ginsbourg
 
Do not let staffing shortages and limited fiscal view hamper your cause
Do not let staffing shortages and limited fiscal view hamper your causeDo not let staffing shortages and limited fiscal view hamper your cause
Do not let staffing shortages and limited fiscal view hamper your cause
Fexle Services Pvt. Ltd.
 
Buy vs. Build: Unlocking the right path for your training tech
Buy vs. Build: Unlocking the right path for your training techBuy vs. Build: Unlocking the right path for your training tech
Buy vs. Build: Unlocking the right path for your training tech
Rustici Software
 
Autodesk Inventor Crack (2025) Latest
Autodesk Inventor    Crack (2025) LatestAutodesk Inventor    Crack (2025) Latest
Autodesk Inventor Crack (2025) Latest
Google
 
[gbgcpp] Let's get comfortable with concepts
[gbgcpp] Let's get comfortable with concepts[gbgcpp] Let's get comfortable with concepts
[gbgcpp] Let's get comfortable with concepts
Dimitrios Platis
 
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
OnePlan Solutions
 
sequencediagrams.pptx software Engineering
sequencediagrams.pptx software Engineeringsequencediagrams.pptx software Engineering
sequencediagrams.pptx software Engineering
aashrithakondapalli8
 
Best HR and Payroll Software in Bangladesh - accordHRM
Best HR and Payroll Software in Bangladesh - accordHRMBest HR and Payroll Software in Bangladesh - accordHRM
Best HR and Payroll Software in Bangladesh - accordHRM
accordHRM
 
Top 12 Most Useful AngularJS Development Tools to Use in 2025
Top 12 Most Useful AngularJS Development Tools to Use in 2025Top 12 Most Useful AngularJS Development Tools to Use in 2025
Top 12 Most Useful AngularJS Development Tools to Use in 2025
GrapesTech Solutions
 
Orion Context Broker introduction 20250509
Orion Context Broker introduction 20250509Orion Context Broker introduction 20250509
Orion Context Broker introduction 20250509
Fermin Galan
 
Ad

Software Testing Introduction (Part 4))

  • 2. Testing Web Applications • Web pages and websites have become an integral part of modern civilization. • We may visit a website and may find a good number of web pages designed for specific applications. • The quality of a web application must be assured in terms of response time, ease of use, number of users, ability to handle varied spikes in traffic, provide accurate information, etc.
  • 3. • Compromise in any of these parameters may compel the customers to move on to the competitor’s site. • Testing these web pages is a real challenge because conventional testing techniques may not be directly applicable
  • 4. WHAT IS WEB TESTING? • The main challenge of testing a web application is not only to find common software errors, but also to test associated quality related risks that are specific to a web application. • We should know the architecture and key areas of web application to effectively plan and execute the testing
  • 5. Web Application Testing Challenges Testing is a fundamental challenge when developing web applications. Below are five web application testing challenges faced by web developers during the development process.
  • 6. 1.Integration While developing any application, we don’t know which device, operating system & browsers our customers will be using while browsing our web application. We call it responsive web application development. But, in software testing industry, they need to be tested for various functionalities to work on any environment, device and browser.
  • 7. 2. Security We all are aware of the cyber threats that can take place at any moment. Regular security testing is required to check for any cyber threat. Also, data integrity tests need to be performed if there are any chances of data loss. Testers take due time to perform security tests as they carefully deal with the unsecured data transfer. How about the risks based on Intranet-based applications and Internet- based applications? Intranet-based applications are bound to pre-defined usage of software and hardware required and they can be tested easily. But, when it comes to Internet-based applications, security measures are defined much more clearly by the skilled testers and QA team.
  • 8. 3. Performance Application’s Page/Loading Speed matters a lot. And seriously, we make sure our customer’s application loads much faster as delay in a single second can divert the user and we don’t want that, period. Hardware testing, misunderstanding the required application’s features can surely lead to a breach of application performance. Integration and interoperability testing directly influence performance testing.
  • 9. 4. Lower Internet Speed/Bandwidth Low Internet speed is hated by you, me and everyone. So, we want applications to work on those devices as well where people don’t have high Internet Bandwidth. While considering testing Internet-based applications, with low Internet speed, we can imagine that various web components can take more time to load and that can affect other components as well. So, this is quite important to test.
  • 10. 5. Firewalls The web applications need to be tested across various firewalls. There are chances that certain ports might have been blocked and still the web application is expected to behave well. These scenarios need to be tested as well.
  • 11. 6. Cross Browser Web applications need to be tested on various browsers to ensure the website works perfectly fine in each and every browser. Here, various browser testing tools can help. In fact, an application needs to be considered to perform browser testing as similar browsers can be used in various devices with varying screen resolution and software and hardware specifications.
  • 12. 2016 Strategies of testing web application (5 marks) • Functionality • Usability • Browser compatibility • Security • Load and stress • Storage and Database
  • 13. FUNCTIONAL TESTING • Functional testing involves checking of the specified functionality of a web application. • Functional test cases for web applications may be generated using boundary value analysis, equivalence class testing, decision table testing and many other techniques. • Table 11.2 presents some sample functional test cases of the order process form of an online shopping website. • This example of eCommerce application sells products such as computers, mobile phones, cameras, electronics, etc. • For each item it lists the name, quality, price and brief description.
  • 17. • It also displays an image of the item. • The user may browse through the product and search any product by its name, price or any other descriptive keyword. • The user is required to register on the website to obtain access to the online shopping cart (a common tool used by users to place an order online). • The user selects various items and adds them to the shopping cart. • After selecting items and adding those to the shopping cart, the user may choose to checkout in order to generate a bill. • The application then requests the user to enter his credit card information and shipping preferences and after that the order is completed.
  • 18. • Finally, the application displays the maximum number of days in which the item will be delivered to the user. • The user may enquire about the order status any time. • The option for providing feedback is also available on the website. • The home page of this web application is given in Figure 11.4.
  • 20. 2. USER INTERFACE TESTING • User interface testing tests that the user interaction features work correctly. • These features include hyperlinks, tables, forms, frames and user interface items such as text fields, radio buttons, check boxes, list boxes, combo boxes, command buttons and dialog boxes. • User interface testing ensures that the application handles mouse and keyboard events correctly and displays hyperlinks, tables, frames, buttons, menus, dialog boxes, error message boxes, and toolbars properly.
  • 21. 1. Navigation Testing • Navigation testing investigates the proper functioning of all the internal and external links. • Navigation testing must ensure that websites provide consistent, well-organized links and should also provide alternative navigation schemes such as search options and site maps. • The placement of navigation links on each page must be checked. • Search based navigation facility must also be thoroughly tested and search items should be consistent across one page to another. • All the combinations of keywords and search criteria must be verified in navigation testing. • Table 11.3 presents test cases for navigation testing for an online shopping website as
  • 22. • given in Figure 11.4. • In Table 11.5, the given user interface testing checklist includes issues on hyperlinks for testers to ensure their proper functioning.
  • 25. • Manual checking of hyperlinks can be very time consuming. • There are various online tools available for checking broken links, accuracy and availability of links and obtaining advice on search engines. • Some tools for navigation testing include Performance Technologies’ TestLink, W3C’s Link checker, Xenu’s LinkSleuth, Dead Links’ Dead Links, LinkTiger’s LinkTiger, Viable Software Alternative’s LinkRunner, Elsop’s LinkScan, REl Software’s Link Validator, UCI’s MQMspider and Illumit’s WebLight.
  • 26. Form Based Testing • Websites that include forms need to ensure that all the fields in the form are working properly. • Form-based testing involves the following issues: Proper navigation from one field of the form to another using the tab key. 1. Ensures that the data entered in the form is in a valid format. 2. Checks that all the mandatory fields are entered in the form. 3. Consider the registration form of an online shopping website (web page is given in Figure 11.5). Its inputs include login id, password, repeat password, name, last name, email address, phone number, shipping details (address, city, state, zip code) and billing details (address, city, state, zip code). Its form based test cases are shown in Table 11.4
  • 29. Browser Testing • There are a large number of browsers available and the behavior of each of them may vary. Although it is impractical to test the web application with all the browsers, it is necessary to verify the web application with specified and prioritized platforms to ensure its correct functioning. • Browser testing verifies the functioning of web application in terms of text, audio, video and operating system corresponding to different browsers. • Browser compatibility matrix may be created to test the web application on different browsers. Table 11.7 presents browser compatibility matrix for testing a web application.
  • 31. Usability Testing • What makes a web application usable? Usability is one of the quality attributes that a web application must possess. • It is important to develop a website that is easy to use. Whenever the user browses an online shopping website, several questions may come to his/her mind. • What is the credibility and reputation of the website? Are shipping charges applicable? In how many days a product will be delivered? Is there any guidance on how to place an order? • In case of any problem, is there any grievance redressal mechanism(complain from citizens and consumers)? • These kinds of usability issues are faced by everyone who tries to purchase an item from an online shopping website
  • 32. • Usability is concerned with the degree to which the software fulfils the user’s specifications and expectations. • It is the measurement of the amount of satisfaction of the user. • It also assesses the extent to which the user finds the software easy to use, learn and understand. • Usability can be divided into one or more attributes such as accuracy, efficiency, completeness, learn ability, satisfaction, clarity and accuracy of online help and written documentation
  • 35. Alpha and Beta Testing • These terms are used when the software is developed as a product for anonymous customers. • Therefore, acceptance testing is not possible. • Some potential customers are identified to test the product. • The alpha tests are conducted at the developer’s site by the customer. • These tests are conducted in a controlled environment and may start when the formal testing process is near completion. • The beta tests are conducted by potential customers at their sites. Unlike alpha testing, the developer is not present here.
  • 36. • It is carried out in an uncontrolled real life environment by many potential customers. • Customers are expected to report failures, if any, to the company. • These failure reports are studied by the developers and appropriate changes are made in the software. • Beta tests have shown their advantages in the past and releasing a beta version of the software to the potential customer has become a common practice. • The company gets the feedback of many potential customers without making any payment. • The other good thing is that the reputation of the company is not at stake even if many failures are encountered.
  • 37. • Acceptance Testing: • This term is used when the software is developed for a specific customer. • The customer is involved during acceptance testing. • He/she may design adhoc test cases or well- planned test cases and execute them to see the correctness of the software. • This type of testing is called acceptance testing and may be carried out for a few weeks or months. • The discovered errors are fixed and modified and then the software is delivered to the customer
  • 38. SECURITY TESTING • Security is the procedure used to protect information from various threats. • It is very important to protect sensitive and critical information and data while communicating over the network. • The user wants implementation of a safeguard to protect personal, sensitive and financial information. • We want data to be accurate, reliable and protected against unauthorized access. • Security involves various threats such as unauthorized users, malicious users, message sent to an unintended user, etc. • Some of the security threats are shown in Figure 11.10
  • 39. • The primary requirement of security includes: (i) Authentication: Is the information sent from an authenticated user? (ii) Access Control: Is data protected from unauthorized users? (iii) Integrity: Does the user receive exactly what is sent? (iv) Delivery: Is the information delivered to the intended user? (v) Reliability: What is the frequency of a failure? How much time does the network take to recover from a failure? • What measures are taken to counter catastrophic failure? (vi) Non-repudiation: Is the receiver able to prove that the data received came from a specific sender?
  • 41. • A web application must fulfil the above mentioned primary security requirements. • Testing the threats and vulnerabilities in a web application is an important activity. • The tester must check the web application against all known internet threats.
  • 42. PERFORMANCE TESTING • How long does an application take to respond to a user click? • We must ensure that the user does not wait for a service for long, otherwise the potential user will move on to the competitor’s site. • To ensure that the web application can bear the load during the peak hours along with serving the user in a timely and reliable manner, performance tests including load and stress tests need to be conducted. • One of the key advantages of web application is that numerous users can have access to the application simultaneously. • Hence, the performance of the application during the peak periods must be tested and monitored carefully. • Several factors that may influence performance include:
  • 43. (i) Memory available (ii) Network bandwidth (iii) Number of users (iv) User type (v) Time to download (vi) Varied client machine configurations
  • 44. 1. Stress Testing • Stress testing involves execution of a web application with more than maximum and varying loads for long periods. • Unlike performance and load testing, stress testing evaluates the response of the system when the system is given a load beyond its specified limits. • It is also used to monitor and check the reliability of a web application when available resources are on beyond maximum usage. • The behavior of the system is monitored to determine when the system under stress test fails and how does it recover from the failure.
  • 45. • Stress tests may test the web application for the following: 1. CPU and memory usage 2. Response time 3. Backend database 4. Different types of users 5. Concurrent users
  • 46. • The system performance is expected to degrade when a large number of users hit the web site simultaneously. • After the completion of stress tests, the testing team must analyze the noted system’s performance degradation points and compare them with the acceptable performance of the system.
  • 47. 2. Load Testing • Load testing involves testing the web application under real world scenarios by simulating numerous users accessing the web application simultaneously. • It tests the web application by providing it maximum load. • The development of plans for load testing should begin as early as possible during the software life cycle. • Early testing will help in detection of problems prior to deployment of the web application. • Load testing may follow the following steps in order to ensure reasonable performance during peak hours
  • 48. 1. Defining the testing strategy and determining the number of users 2. Identifying potential metrics 3. Choosing the right tool and executing the load test 4. Interpreting the results
  • 49. Example Suppose a website is designed and web server can handle load upto 100 request at a time. When load testing is performed than max 100 or less users can request to access the website. load testing checks the performance of website When stress testing is performed than there is no limit on numbers of users accessing website at a particular time. Stress testing checks the reliability of the website.
  • 51. DATABASE TESTING • In web applications, many applications are database driven, for example, e-commerce related websites or business-to-business applications. • It is important for these applications to work properly and provide security to the user’s sensitive data such as personal details and credit card information.
  • 52. • For example, consider the example for purchasing items from an online store. • If the user performs a search based on some keywords and price preferences, a database query is created by the database server. • Suppose due to some programming fault in the query, the query does not consider the price preferences given by the customer, this will produce erroneous results. • These kinds of faults must be tested and removed during database testing
  • 53. • kinds of faults must be tested and removed during database testing. • Important issues in database testing may include: 1. Data validation 2. Data consistency 3. Data integrity 4. Concurrency control and recovery 5. Data manipulation operations such as addition, deletion, updation and retrieval of data. 6. Database security
  • 54. WEB METRICS • Web page metrics can be effectively used in measuring various attributes of a web page. • Table 11.13 provides comprehensive web page measures. • There are 41 web page metrics which influence usability. • These attributes/metrics can be divided into three categories: Page composition metrics • (i) Page formatting metrics and • (ii) Overall page quality or assessment metrics • (iii) Most of the page composition and page formatting metrics can be easily calculated but the attributes that fall in the category 3 i.e. overall page quality or assessment metrics, requires designer and/or user evaluation [MALH10].
  • 56. Object Oriented Testing • The whole object oriented testing revolves around the fundamental entity known as “class”. • With the help of “class” concept, larger systems can be divided into small well defined units which may then be implemented separately. • The object oriented testing can be classified as like conventional systems. • These are called as the levels for testing
  • 57. Classes and Objects • We consider the same example of sending a book to a teacher. • The selection of the courier company is based on its reputation and proximity to our house. • A courier management system is required in order to send a book to a teacher. • All courier types (such as book, pen, etc.) may be combined to form a group and this group is known as a class. • All objects are instances of a class. • The class describes the structure of the instances which include behaviour and information. • In our example, courier (containing courier details) is a class and all courier types are its objects as shown in Figure 9.1.
  • 59. WHAT IS OBJECT ORIENTED TESTING • Object oriented programming concepts are different from conventional programming and have become the preferred choice for a large scale system design. • The fundamental entity is the class that provides an excellent structuring mechanism. • It allows us to divide a system into well defined units which may then be implemented separately. • We still do unit testing although the meaning of unit has changed. • We also do integration and system testing to test the correctness of implementation. • We also do regression testing in order to ensure that changes have been implemented correctly. • However, many concepts and techniques are different from conventional testing.
  • 60. Levels of Testing • We may have 3 or 4 levels of testing depending on our approach. The various testing levels are: 1. Method testing (Unit testing) 2. Class testing (Unit testing) 3. Inter-class testing (Integration testing) 4. System testing
  • 61. What is a Unit? • In conventional programming, a unit is the smallest portion of the program that can be compiled and executed. • We may call it a module, component, function or procedure. • In object oriented system, we have two options for a unit. 1. We may treat each class as a unit or may treat each method within a class as a unit. • If a class is tested thoroughly, it can be reused without being unit tested again. • Unit testing of a class with a super class may be impossible to do without the super classes’ methods/variables. • One of the solutions is to merge the super class and the class under test so that all methods and variables are available.
  • 62. • Generally, classes are selected as a unit for the purpose of unit testing.
  • 64. Explanation • If we want to test Derived class than we have to merge Base class and Derived class and than perform testing on member functions and data members of both class.
  • 65. • Another way to test a class, we may create an instance of the class i.e. object, and pass the appropriate parameters to the constructor. • We may further call the methods of the object passing parameters and receive the results. • We should also examine the internal data of the object. • The encapsulation plays an important role in class testing because data and function (operations) are combined in a class. • We concentrate on each encapsulated class during unit testing but each function may be difficult to test independently.
  • 66. Example Class Student { int rollno; Char name[30]; public Student (int r, char n[30]) { rollno=r; strcpy(name,n); } }; public void show() { cout<<“Rollno ”<<rollno<<“Name “<<name; }
  • 67. void main() { printf(“Enter Rollno between 1 to 50“); Scanf(“%d”,&rollno”); Printf(“Enter Name :”); Scanf(“%s”,name); if(rollno>50 || rollno<1) printf(“Rollno is invalid !!!!”); else { Student obj1=new Student(51,”himanshu”); Student obj2=new Student(0,”Ram”); Student obj3=new Student(1,”Rahul”); obj1.show(); obj2.show(); obj3.show(); } getch(); }
  • 68. Output Rollno is invalid Rollno is invalid Rollno 1 Name Rahul
  • 69. 2. Inter-Class testing • It is also called as integration or subsystem testing. • Inter class testing involves the testing of modules or sub-systems and their coordination with other modules.
  • 70. Example #include<conio.h> #include<stdio.h> Void input() { int rollno; Char name[30]; printf(“Enter Rollno between 1 to 50 :”); scanf(“%d”,&rollno); printf(“Enter Name :”); scanf(“%s”,name); display(rollno,name); }
  • 71. Void display(int rollno, char name[30]) { If(rollno>50 || rollno<1) printf(“You have entered a invalid rollno”); else printf(“Roll no : %d Name : %s”,rollno,name); } Void main() { input(); }
  • 72. Test Case 1. Enter Rollno : 12 Enter Name : Ram Output : Roll no : 12 Name : Ram 2. Enter Rollno: 0 Enter Name : xyz Output: You have entered a invalid rollno 3. Enter Rollno: 51 Enter Name : yxs Output: You have entered a invalid rollno
  • 73. 3. System testing, the system is tested as whole and primarily functional testing techniques are used to test the system. • Non-functional requirements like performance, reliability, usability and test- ability are also tested.
  • 74. • Integration testing in object oriented system is also called inter-class testing. • We do not have hierarchical control structure in object orientation and thus conventional integration testing techniques like top down, bottom up and sandwich integration cannot be applied. • There are three popular techniques for inter-class testing in object oriented systems. • The first is the thread based testing where we integrate classes that are needed to respond to an input given to the system. • Whenever we give input to a system, one or more classes are required to be executed that respond to that input to get the result. • We combine such classes which execute together for a particular input or set of inputs and this is treated as a thread.
  • 75. • The second is the use case based testing where we combine classes that are required by one use case. • The third is the cluster testing where we combine classes that are required to demonstrate one collaboration. • In all three approaches, we combine classes on the basis of a concept and execute them to see the outcome. • Thread based testing is more popular due to its simplicity and easy implementability.
  • 76. Object oriented testing techniques • Path testing, state based testing and class testing are popular object oriented testing techniques.
  • 77. 1. PATH TESTING • path testing is a structural testing technique where the source code is required for the generation of test cases.
  • 78. 1.1 Activity Diagram • The first step of path testing is to convert source code into its activity diagram. • In Unified Modeling Language (UML), activity diagram is used to represent sequences in which all activities are performed. • This is similar to a flow graph which is the basis of conventional path testing. • Activity diagram may be generated from a use case or from a class. • It may represent basic flow and also possible alternative flows. • As shown in Figure 9.5, the start state is represented by a solid circle and the end state is represented by a solid circle inside a circle.
  • 79. • The activities are represented by rectangles with rounded corners along with their descriptions. • Activities are nothing but the set of operations. • After execution of these set of activities, a transition takes place to another activity. • Transitions are represented by an arrow. • When multiple activities are performed simultaneously, the situation is represented by a symbol ‘fork’. • The parallel activities are combined after the completion of such activities by a symbol ‘join’. • The number of fork and join in an activity diagram are the same. • The branches are used to describe what activities are performed after evaluating a set of conditions.
  • 80. • Branches may also be represented as diamonds with multiple labelled exit arrows. • A guard condition is a boolean expression and is also written along with branches. • An activity diagram consisting of seven activities is shown in Figure 9.5.
  • 82. • In the activity diagram given in Figure 9.5, Activity 2 and Activity 3 are performed simultaneously and combined by a join symbol. • After Activity 4, a decision is represented by a diamond symbol and if the guard condition is true, Activity 5 is performed, otherwise Activity 6 is performed. • The fork has one incoming transition (Activity 1 is split into sub activities) and two outgoing transitions. • Similarly join has two incoming transitions and one outgoing transition. • The symbols of an activity diagram are given in Table 9.1.
  • 84. 2. Calculation of Cyclomatic Complexity cyclomatic complexity of a graph is given as: V(G)=e-n+2P 3. Generation of Test Case After the identification of independent paths, we may generate test cases that traverse all independent paths at the time of executing the program. This process will ensure that each transition of the activity diagram is traversed at least once.
  • 85. • Consider the program given in Figure 9.9 for determination of the largest amongst three numbers. • There are three methods in this program getdata, validate and maximum. • Design test cases for validate and maximum methods of the class using path testing.
  • 91. 2. STATE BASED TESTING • State based testing is used as one of the most useful object oriented software testing techniques. • It uses the concept of state machine of electronic circuits where the output of the state machine is dependent not only on the present state but also on the past state. • A state represents the effect of previous inputs. • Hence, in state machine, the output is not only dependent on the present inputs but also on the previous inputs. • In electronic circuits, such circuits are called sequential circuits.
  • 92. 2.1 What is a State Machine • State machines are used to model the behavior of objects. • A state machine represents various states which an object is expected to visit during its lifetime in response to events or methods along with its responses to these events or methods. • A state is represented by rectangles with rounded corners and transitions are represented by edges (arrows). • Events and actions are represented by annotations on the directed edges. • A typical state machine is shown in Figure 9.12 and descriptions of its associated terms are given in Table 9.6.
  • 95. • In the Figure 9.12, there are two states state1 and state2. • If at state1, input A is given and (x>y), then state1 is changed to state2 with an output ‘next’. • At state2, if the input is B and (x<y), then state2 is changed to state1 with an output ‘previous’. • Hence, a transition transfers a system from one state to another state. • The first state is called the accepting state and another is called the resultant state. • Both states (accepting and resultant) may also be the same in case of self-loop conditions. • The state in question is the current state or present state. • Transition occurs from the current state to the resultant state.
  • 96. 3. CLASS TESTING • A class is very important in object oriented programming. • Every instance of a class is known as an object. • Testing of a class is very significant and critical in object oriented testing where we want to verify the implementation of a class with respect to its specifications. • If the implementation is as per specifications, then it is expected that every instance of the class may behave in the specified way. • Class testing is similar to the unit testing of a conventional system. • We require stubs and drivers for testing a ‘unit’ and sometimes, it may require significant effort.
  • 97. • Similarly, classes also cannot be tested in isolation. • They may also require additional source code (similar to stubs and drivers) for testing independently
  • 98. 1. How Should We Test a Class? • We want to test the source code of a class. Validation and verification techniques are equally applicable to test a class. • We may review the source code during verification and may be able to detect a good number of errors. • Reviews are very common in practice, but their effectiveness is heavily dependent on the ability of the reviewer(s).
  • 99. • Another type of testing is validation where we may execute a class using a set of test cases. • We should always remember that classes are tested by creating instances and testing the behaviour of those instances [MCGR01].
  • 100. 2. Issues Related to Class Testing • How should we test a class? • We may test it independently, as a unit or as a group of a system. • The decision is dependent on the amount of effort required to develop a test driver, severity of class in the system and associated risk with it and so on. • If a class has been developed to be a part of a class library, thorough testing is essential even if the cost of developing a test driver is very high
  • 101. • Classes should be tested by its developers after developing a test driver. • Developers are familiar with the internal design, complexities and other critical issues of a class under test and this knowledge may help to design test cases and develop test driver(s). • Class should be tested with respect to its specifications. If some unspecified behaviors have been implemented, we may not be able to test them. • We should always be very careful for additional functionalities which are not specified. • Generally, we should discourage this practice and if it has been implemented in the SRS document, it should immediately be specified. • A test plan with a test suite may discipline the testers to follow a predefined path. • This is particularly essential when developers are also the testers
  • 102. 3. Generating Test Cases • One of the methods of generating test cases is from pre and post conditions specified in the use cases. • The pre and post conditions of every method may be used to generate test cases for class testing. • Every method of a class has a pre-condition that needs to be satisfied before the execution. • Similarly, every method of a class has a post- condition that is the resultant state after the execution of the method. • Consider a class ‘stack’ given in Figure 9.16 with two attributes (x and top) and three methods (stack(), push(x), pop()).
  • 104. • We should first specify the pre and post conditions for every operation/method of a class. • We may identify requirements for all possible combinations of situations in which a precondition can hold and post-conditions can be achieved. • We may generate test cases to address what happens when a pre-condition is violated • We consider the stack class given in Figure 9.16 and identify the following pre and post conditions of all the methods in the class:
  • 105. • After the identification of pre and post conditions, we may establish logical relationships between pre and post conditions. • Every logical relationship may generate a test case. • We consider the push() operation and establish the following logical relationships: Constructor Push Method Pop Method
  • 106. We may identify test cases for every operation/method using pre and post conditions. We should generate test cases when a pre-condition is true and false. Both are equally important to verify the behaviour of a class. We may generate test cases for push(x) and pop() operations (refer Table 9.11 and Table 9.12).
  • 108. • Example 9.3. Consider the example of withdrawing cash from an ATM machine given in example 9.2. • Generate test cases using class testing.
  • 111. What is GUI Software Testing? • GUI testing is a testing technique in which the application's user interface is tested whether the application performs as expected with respect to user interface behaviour. • GUI Testing includes the application behaviour towards keyboard and mouse movements and how different GUI objects such as toolbars, buttons, menubars, dialog boxes, edit fields, lists, behavior to the user input.
  • 112. GUI Testing Guidelines 1. Check Screen Validations 2. Verify All Navigations 3. Check usability Conditions 4. Verify Data Integrity 5. Verify the object states 6. Verify the date Field and Numeric Field Formats
  • 113. GUI Testing Techniques / Methods • GUI testing can be done in three ways: 1. Manual Based Testing 2. Record and Replay 3. Model Based Testing
  • 114. 1. Manual Based Testing • Under this approach, graphical screens are checked manually by testers in conformance with the requirements stated in the business requirements document.
  • 115. 2. Record and Replay • GUI testing can be done using automation tools. This is done in 2 parts. • During Record, test steps are captured by the automation tool. • During playback, the recorded test steps are executed on the Application Under Test. • Example of such tools - QTP.
  • 117. 3. Model Based Testing
  • 118. • A model is a graphical description of a system's behavior. • It helps us to understand and predict the system behavior. • Models help in a generation of efficient test cases using the system requirements. • The following needs to be considered for this model based testing: 1. Build the model 2. Determine Inputs for the model 3. Calculate the expected output for the model 4. Run the tests 5. Compare the actual output with the expected output 6. A decision on further action on the model
  翻译: