R20CSE32L3 Software Testing Methodologies Laboratory
R20CSE32L3 Software Testing Methodologies Laboratory
DEPARTMENT OF CSE
INDEX
1. CONSTRUCTS
INTROSPECTION OF MATRIX
2.
MULTIPLICATION
3. SYSTEM SPECIFICATIONS
4. TEST CASES
5. TEST PLAN
6. TESTING TOOL
7. SELENIUM
8. BUGBIT
(TEST MANAGEMENT TOOL)
9. BUG TRACKING TOOL
(BUGZILLA)
10. OPEN SOURCE TESTING TOOL
EXPERIMENT # 1
CONSTRUCTS
1.1 OBJECTIVE:
1. do …while
declare i,
intialize n to 5 and j to 0.
read i value .
loop :
if (i%2== 0)
print i as even number. And
increment i and j value.
otherwise print i as odd number . and increment i and j value .
if i>0 and j<n go to loop
2. while
declare i, intialize n to 5 and j to 0. read i value .
loop : if i>0 and j<n.
if i%2 == 0 print i as even number and increment i and j value.
otherwise print i as odd number and increment i and j value .
go to loop
3. if….else
declare i value. read i value .
if i%2== 0 print i as even number.
otherwise odd number.
4. switch
declare a,b,c.
read i value.
print enter a,b values . read a,b values . switch ( case value = i)
if case value = 1
c is sum of a and b
if case value =2
c is difference of a and b
if case value = 3
c is multiplication of a and b. if case value = 4 c is division of a and b .
5. for loop
declare i value.
read i value .
loop initialize i to 1 if i<=5
print i as even number
else
print as odd number. increment i value
1.4 PROCEDURE:
1. Create : Open editor vi x.c write a program after that press ESC and: wq for save and Quit.
2. Compile: gcc x.c.
3. Execute: . / a.out.
1. do…while
#include
<stdio.h>
void main ()
{
int i, n=5,j=0;
printf(“enter a no”);
scanf(“%d”,&i);
do
{ if(i%2==
0)
{
printf("%d", i);
printf("is a even no.");
i++;
j++;
}
else
{
printf("%d", i);
printf("is a odd no.\n"); i++; j++;
}
}
while(i>0&&j<n);
getch();
2. while
#include<stdio.h>
#include <conio.h>
void main ()
{
int i,n=5,j=1;
printf(―enter a no‖);
scanf(“%d”,&i);
while (i>0 && j<n)
{ if(i%2==
0)
{
printf(“%d”,i);
printf(“is a even number”);
i++;
j++;
}
else
{
printf(“%d”,i);
printf(“its a odd number”);
i++;
j++;
}
}
getch();
3. if….else
#include<stdio.h>
#include <conio.h>
void main ()
{
int I,c;
printf(“enter a number “);
scanf(“%d” ,&i);
if(i%2==0)
{
printf(“%d” ,i);
printf({“s a even number”);
}
else
{
printf(“%d”,i);
printf(“is a odd number”);
}
}
4. switch
#include<stdio.h>
#include <conio.h>
void main()
{
int a,b,c;
printf(“1.add/n 2.sub /n 3.mul /n 4.div /n enter your choice”);
scanf(“%d‖”, &i);
printf(“enter a,b values”);
scanf(“%d%d” ,&a,&b);
switch(i)
{
case 1: c=a+b;
printf(“the sum of a & b is: %d”,c);
break;
case 2: c=a-b;
printf(”the diff of a & b is: %d” ,c);
break;
case 3: c=a*b;
printf(“the mul of a & b is: %d”,c);
break;
case 4: c=a/b;
printf(“the div of a & b is: %d‖ ,c);
break:;
default:
printf(“enter your choice”);
break;
}
getch();
}
5. for
#include<stdio.h>
#include <conio.h>
main()
{
int i;
printf(“enter a no”);
scanf(“%d‖”,&i); for(i=1;i<=5;i++)
{ if(i%2==
0)
{
printf(“%d”, i);
printf(“is a even no”);
i++;
}
else
{
printf(“%d”, i);
printf(“is a odd no”);
i++;
}
}
getch();
}
1.6 INPUT/OUTPUT
1. do…while
2. while
3. if …else
Test cases:
Test case no: 1
4. switch
2.1 OBJECTIVE:
A program written in c language for matrix multiplication fails ―Introspect the causes for its failure and
write down the possible reasons for its failure.
1. Read the no. of rows (r1) and cols (c1) of a matrix a[3][3].
2. Read the no. of rows (r2) and cols. (c2) of matrix b[3][3].
3. If c1=r2 then display matrix multiplication is possible otherwise display impossible
4. If c1=r2 then read the elements into both the matrices a andb.
5. Initialize a resultant matrix c[3][3] with 0.
6. Calculate c[i][j] = c[i][j] + a[i][k] * b[k][j].
7. Display the resultant matrix
2.3 PROCEDURE:
a. Create : Open editor vi x.c write a program after that press ESC and: wq for save and Quit.
b. Compile: gcc x.c.
c. Execute: . / a.out.
#include<stdio.h>
#include<conio.h>
void main()
{
int a[3][3],b[3][3],c[3][3],i,j,k,m,n,p,q;
clrscr();
int a[3][3],b[3][3],c[3][3],i,j,k,m,n,p,q;
clrscr();
printf(―Enter matrix no.of rows & cols); scanf(―%d%d‖,&m,&n);
printf(― Enter 2matrix no.of rows & cols‖) ;
scanf(―%d%d‖,&p,&q);
printf("\n enter the matrix elements"); for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("\n a matrix is\n"); for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
printf("%d\t",a[i][j]);
}
printf("\n");
}
for(i=0;i<p;i++)
{
for(j=0;j<q;j++)
{
scanf("%d\t",&b[i][j]);
}
}
printf("\n b matrix is\n");
for(i=0;i<p;i++)
{
for(j=0;j<q;j++)
{
printf("%d\t",b[i][j]);
}
printf("\n");
}
for(i=0;i<m;i++)
{
for(j=0;j<q;j++)
{
c[i][j]=0; for(k=0;k<n;k++)
{
c[i][j]=c[i][j]+a[i][k]*b[k][j];
}
}
}
for(i=0;i<m;i++)
{
for(j=0;j<q;j++)
{
printf("%d\t",c[i][j]);
}
printf("\n");
}
getch();
}
Test cases:
Test case no: 1
Test case name: Equal no. of rows & cols
SYSTEM SPECIFICATIONS
3.1 OBJECTIVE:
1. Study the system specifications of ATM system and report various bugs in it.
2. Study the system specifications of banking application and report various bugs in it.
TEST CASES
4.1 OBJECTIVE:
Study the Test Cases of banking applications and report the various bugs in it.
TEST PLAN
5.1 OBJECTIVE:
Create a test plan document for any application (e.g. Library Management System)
1. GUI TEST
Pass criteria: librarians could use this GUI to interface with the backend library
database without any difficulties.
2. DATABASE TEST
Pass criteria: Results of all basic and advanced operations are normal (refer to section 4)
3. UPDATE/DELETE STUDENT
3. CHECK-IN BOOK
1. Librarians can check in a book using its call number
2. The check-in can be initiated from a previous search operation where user
has selected a set of books.
3. The return date would automatically reflect the current system date.
4. Any late fees would be computed as difference between due date and
return date at rate of 10 cents a day.
TESTING TOOL
6.1 OBJECTIVE :
Win Runner uses TSL, or Test Script Language. The goal of Win Runner is to make sure
Another impressive aspect of Win Runner is the ability to record various interactions, and
transform them into scripts. Win Runner is designed for testing graphical user interfaces. When
the user make an interaction with the GUI, this interaction can be recorded. Re-cording the
interactions allows determining various bugs that need to be fixed. When the test is completed,
Win Runner will provide with detailed information regarding the results.
1. Context Sensitive
Context Sensitive mode records your actions on the application being tested in terms of the
GUI objects you select (such as windows, lists, and buttons), while ignoring the physical location
of the object on the screen. Every time you perform an operation on the application being tested, a
TSL statement describing the object selected and the action performed is generated in the test script.
As you record, Win Runner writes a unique description of each selected object to a GUI map.
2. Analog
Analog mode records mouse clicks, keyboard input, and the exact x and y coordinates
traveled by the mouse. When the test is run, Win Runner retraces the mouse tracks. Use Analog
mode when exact mouse coordinates are important to your test, such as when testing a drawing
application.
Before you begin creating tests, you should familiarize yourself with the Win Runner main window.
The first time you start Win Runner, the Welcome to Win Runner window and the What‗s
New in Win Runner help open. From the Welcome window you can create a new test, open an
existing test, or view an overview of Win Runner in your default browser. If you do not want this
window to appear the next time you start Win Runner, clear the Show on Startup check box.To
show the Welcome to Win Runner window upon startup from within Win Runner, choose
Settings > General Options, click the Environment tab, and select the Show Welcome screen
checkbox.
The main Win Runner window contains the following key elements:
Create a script by recording in Context Sensitive mode that tests the process of opening
an order in the Flight Reservation application. You will create the script
If Win Runner is not already open, choose Programs > Win Runner > Win Runner on the
Start menu.
If the Welcome window is open, click the New Test button. Otherwise, choose File > New.
A new test window opens in Win Runner.
Choose Programs > Win Runner > Sample Applications > Flight 1A on the Start menu. In
the Login window, type your name and the password mercury, and click OK. The name you
type must be at least four characters long. Position the Flight Reservation application and
Win Runner so that they are both clearly visible on your desktop.
In WinRunner, choose Create > Record—Context Sensitive orclick the Record button on the toolbar.
From this point on, Win Runnerrecords all mouse clicks and keyboard input. Note that the text, ―Rec‖
appears in blue above the recording button. This indicates that you are recording in Context Sensitive
mode. The status bar also informs you of your current recording mode.
In the Flight Reservation application, choose File > Open Order. In the Open Order dialog
box, select the Order No. check box. Type 3 in the adjacent box, and click OK. Watch how
Win Runner generates a test script in the test window as you work.
6. Stop recording.
In Win Runner, choose Create > Stop Recording or click the Stop button on the toolbar.
Choose File > Save or click the Save button on the toolbar. Save the test as lesson3 in
a convenient location on your hard drive. Click Save to close the Save Test dialog
box. Note that Win Runner saves the lesson3 test in the file system as a folder, and
not as an individual file. This folder contains the test script and the results that are
generated when you run the test.
Output: Win Runner Test Results window is open and displays the test results.
Conclusion: Recording in Context Sensitive mode is cleared and test results are also
seen.
EXPERIMENT # 6(B)
Synchronizing test
When you run tests, your application may not always respond to input with
the same speed. For example, it might take a few seconds:
1. To retrieve information from a database
2. For a window to pop up
3. For a progress bar to reach 100%
4. For a status message to appear
If Win Runner is not already open, choose Programs > Win Runner > Win
Runner on the Start menu. If the Welcome window is open, click the New
Test button. Otherwise, choose File > New. A new test window opens.
Choose Programs > Win Runner > Sample Applications > Flight 1A on the
Start menu. In the Login window, type your name and the password mercury,
and click OK. Reposition the Flight Reservation application and Win Runner
so that they are both clearly visible on your desktop.
Choose Create > Record Context Sensitive or click the Record button on the
tool bar.Win Runner will start recording the test.
Click the Insert Order button. When the insertion is complete, the ―Insert
Done‖ message appears in the status bar.
7. Delete the order.
Click the Delete Order button and click Yes in the message window to confirm the
deletion.
8. Stop recording.
Choose File > Save. Save the test as lesson4 in a convenient location on your
hard drive. Click Save to close the Save Test dialog box.
Output: Win Runner Test Results window is open and displays the test results.
Conclusion: Importance of Synchronizing test is cleared and test results are also
seen.
VIVA QUESTIONS:
SELENIUM
7.1 OBJECTIVE:
Study of any web testing tool (e.g. Selenium)
1. Selenium is a robust set of tools that supports rapid development of test automation for web-
based applications. Selenium provides a rich set of testing functions specifically geared to
the needs of testing of a web application. These operations are highly flexible, allowing
many options for locating UI elements and comparing expected test results against actual
application behavior.
2. One of Selenium‗s key features is the support for executing one‗s tests on multiple browser
platforms.
3. Selenium Components
4. Selenium is composed of three major tools. Each one has a specific role in aiding the
development of web application test automation.
Selenium-RC provides an API (Application Programming Interface) and library for each of its
supported languages: HTML, Java, C#, Perl, PHP, Python, and Ruby. This ability to use
Selenium-RC with a high level programming language to develop test cases also allows the
automated testing to be integrated with a project‗s automated build environment.
SELENIUM-GRID
Selenium-Grid allows the Selenium-RC solution to scale for large test suites or test suites that
must be run in multiple environments. With Selenium-Grid, multiple instances of Selenium-RC
are running on various operating system and browser configurations; Each of these when
launching register with a hub. When tests are sent to the hub they are then redirected to an
available Selenium-RC, which will launch the browser and run the test. This allows for running
tests in parallel, with the entire test suite theoretically taking only as long to run as the longest
individual test.
1. Tests developed on Firefox via Selenium-IDE can be executed on any other supported browser
via a simple Selenium-RC command line.
2. Selenium-RC server can start any executable, but depending on browser security set-tings
there may be technical limitations that would limit certain features.
FLEXIBILITY AND EXTENSIBILITY
Selenium is highly flexible. There are multiple ways in which one can add functionality to
Selenium‗s framework to customize test automation for one‗s specific testing needs. This is,
perhaps, Selenium‗s strongest characteristic when compared with proprietary test automation
tools and other open source solutions. Selenium-RC support for multiple programming and
scripting languages allows the test writer to build any logic they need into their automated testing
and to use a preferred programming or scripting language of one‗s choice.
Selenium-IDE allows for the addition of user-defined user extensions for creating additional
commands customized to the user‗s needs. Also, it is possible to re-configure how the Selenium-
IDE generates its Selenium-RC code. This allows users to customize the generated code to fit in
with their own test frameworks. Finally, Selenium is an Open Source project where code can be
modified and enhancements can be submitted for contribution.
TEST SUITES
A test suite is a collection of tests. Often one will run all the tests in a test suite as one continuous
batch job. When using Selenium -IDE, test suites also can be defined using a simple HTML file.
The syntax again is simple. An HTML table defines a list of tests where each row defines the file
system path to each test. An example tells it all.
<html>
<head>
<title>Test Suite Function Tests – Priority 1</title></head>
<body>
<table>
<tr><td><b>Suite Of Tests</b></td></tr>
<tr><td><a href=‖./Login.html‖>Login</a></td></tr>
<tr><td><a href=‖./SearchValues.html>‖ Test Searching for Values</a></td></tr>
<tr><td><a href=‖./SaveValues.html‖>Test Save</a></td></tr>
</table></body>
</html>
A file similar to this would allow running the tests all at once, one after another, from the
Selenium-IDE.
Test suites can also be maintained when using Selenium-RC. This is done via programming and
can be done a number of ways. Commonly Junit is used to maintain a test suite if one is using
Selenium-RC with Java. Additionally, if C# is the chosen language, Nunit could be employed. If
using an interpreted language like Python with Selenium-RC than some simple programming
would be involved in setting up a test suite. Since the whole reason for using
Sel-RC is to make use of programming logic for your testing this usually
isn‗t a problem.
BUGBIT
8.1 OBJECTIVE :
Test Director offers an organized framework for testing applications before they are
deployed. Since test plans evolve with new or modified application requirements,
you need a central data repository for organizing and managing the testing process.
TestDirector guides through the requirements specification, test planning, test
execution, and defect tracking phases of the testing process. The Test Director
testing process includes four phases:
Specifying Requirements
Planning Tests
1. The Test Plan Manager enables to divide application according to functionality.
Application can be divided into units, or subjects, by creating a test plan tree.
2. Define subjects according to:
3. Application functionality-such as editing, file operations, and reporting
4. Type of testing-such as functional, user interface, performance, and load
5. As the tests are also linked to defects, this helps ensure compliance with testing
requirements throughout the testing process.
Running Tests
As the application constantly changes, using test lab, run manual and automated
tests in the project in order to locate defects and assess quality.
1. By creating test sets and choosing which tests to include in each set, test suite
can be created? A test set is a group of tests in a Test Director Project
database designed to achieve specific testing goals.
Tracking Defects
1. Product–>Component
2. Assigned to
3. Status (New, Assigned, Fixed etc)
4. Summary
5. Bug priority
6. Bug severity (blocker, trivial etc)
7. Bug reporter
Using Bugzilla:
Bugzilla usage involves the following activities Setting Parameters and Default
Preferences
5. Select from the list of mail transports to match the transport we‗re
using. If evaluating a click2try application, select test. If using
SMTP, set any of the other SMTP options for your environment.
Click Save Changes.
6. In the left side Index list, click Bug Change Policies.
7. Select On for comment on create, which will force anyone who
enters a new bug to enter a comment, to describe the bug. Click Save
Changes.
8. Click Default Preferences at the bottom of the page.
9. Select the display order from the drop-down list next to the When viewing a
bug, show comments in this order field. Click Submit Changes.
Before entering bugs, make sure we add some new users. We can enter users very easily,
with a minimum of information. Bugzilla uses the email address as the user ID,
because users are frequently notified when a bug isentered, either becausethey entered the
bug, because the bug is assigned to them, or because they‗ve chosen to track bugs in a
certain project.
Impersonating a User:
Impersonating a user is possible, though rare, that we may need to file or manage a
bug in an area that is the responsibility of another user when that user is not available.
Perhaps the user is on vacation, or is temporarily assigned to another project. We can
impersonate the user to create or manage bugs that belong to that user.
Adding Products
We‗ll add a product in Bugzilla for every product we are developing. To start with,
when we first login to Bugzilla, we‗ll find a test product called TestProduct. We
should delete this and create a new product.
To add a product:
Eventually, we‗ll end up with thousands of bugs listed in the system. There are
several ways to view the bugs. The easiest is to click the My Bugs link at the bottom
of the page. Because we‗ve only got one bug reported, we‗ll use the standard Search
function.
To find a bug:
1. Click Reports.
2. Click the Search link on the page, not the one in the top menu. This opens a
page titled Find a Specific Bug.
3. Select the Status.
4. Select the Product.
5. Enter a word that might be in the title of the bug.
6. Click Search. If any bugs meet the criteria that we have entered, Bugzilla
displays them in a list summary.
7. Click the ID number link to view the full bugreport.
Modifying Bug Reports
Suppose we want to change the status of the bug. We‗ve reviewed it and have
determined that it belongs to one of the users we have created earlier.
10.1 OBJECTIVE:
Study of any open source testing tool (Test Link).
Test link is an open source test management tool. It enables creation and organization of test cases and
helps manage into test plan. Allows execution of test cases from test link itself. One can easily track test
results dynamically, generate reports, generate test metrics, prioritize test cases and assign unfinished
tasks. It‘s a web based tool with GUI, which provides an ease to develop test cases, organize test cases
into test plans, execute these test cases and generate re-ports. Test link exposes API, written in PHP, can
help generate quality assurance dashboards. The functions like AddTestCase ToTestPlan,
Assign Requirements, Create Test Case etc. helps create and organize test cases per test plan. Functions
like GetTestCasesForTestPlan, GetLastExecutionResult allows one to create quality assurance
dashboard. TestLink enables easily to create and manage Test cases as well as organize them into Test
plans. These Test plans allow team members to execute Test cases and track test results dynamically,
generate reports, trace software requirements, prioritize and assign tasks. Read more about implemented
features and try demo pages.
Overall structure
There are three cornerstones: Product, Test Plan and User. All other data are relations or attributes for
this base. First, definition of a couple of terms that are used throughout the documentation.
1. Product: A Product is something that will exist forever in TestLink. Products will under-go many
different versions throughout their lifetimes. Product includes Test Specification with Test Cases
and should be sorted via Keywords.
2. Test Plan: Test Plans are created when you‗d like to execute test cases. Test plans can be made up
of the test cases of one or many Products. Test Plan includes Builds, Test Case Suite and Test
Results.
3. User: A User has a Role that defines available Test Link features.
Test Link breaks down the test case structure into three levels Components, Categories, and test cases.
These levels are persisted throughout the application.
1. Component: Components are the parents of Categories. Each Component can have many
2. Categories.
3. Category: Categories are the parents of test cases. Each Category can have many test cases.
4. Test Case: Test cases are the fundamental piece of TestLink.
5. Test Specification: All Components, Categories and test cases within Product.
6. Test Case Suite: All Components, Categories and test cases within Test Plan.
Tester must follow this structure: Component, Category and test case. At first you create Component(s) for
your Product. Component includes Categories. Category has the similar meaning but is second level of Test
Specification and includes just Test Cases.User can also copy or move Test Cases.
Test cases, Categories, and Components may be deleted from a test plan by users with lead permissions
from the delete test cases screen. Deleting data may be useful when first creating a test plan since there are
no results. However, Deleting test cases will cause the loss of all results associated with them. Therefore,
extreme caution is recommended when using this functionality.
Requirements relation
Test cases could be related with software/system requirements as n to n. The functionality must be enabled
for a Product. User can assign Test Cases and Requirements via link Assign Requirements in the main
screen.
Test Plans
Test plan contains name, description, collection a chosen test cases, builds, test results, milestones, tester
assignment and priority definition.
Creating a new Test Plan
Test Plans may be deleted from the Create test plan page (link Create Test Plan) by users with lead
privileges. Test plans are the basis for test case execution. Test plans are made up of test cases imported
from Products at a specific point of time. Test plans can only be created by users with lead privileges.
Test plans may be created from other test plans. This allows users to create test plans from test cases
that at a desired point in time. This may be necessary when creating a test plan for a patch. In order for a
user to see a test plan they must have the proper rights. Rights may be assigned (by leads) in the define
User/Project
Rights section. This is an important thing to remember when users tell you they can‗t see the project
they are working on.
Test Execution
Test Status
Execution is the process of assigning a result (pass, fail, blocked) to a test case for a specific build.
Blocked‗test case is not possible to test for some reason (e.g. a problem in configuration disallows to
run a tested functionality).
1. Test Results screen is shown via click on an appropriate Component, Category or test case in
navigation pane. The title shows the current build and owner. The colored bar indicate status of the
test case.
2. Yellow box includes test scenario of the test case.
3. Updated Test Cases: If users have the proper rights they can go to the Update modified testcase page
through the link on main page. It is not necessary for users to update test cases if there has been a
1. Easy in tracking test cases(search with keyword, test case id, version etc)
2. We can add our custom fields to test cases.
3. Allocating the work either test case creation/execution any kind of documents is easy
4. when a test cases is updated the previous version also can be tracked
5. We can generate results build wise
6. Test plans are created for builds and work allocations can be done.
Report, is one of the awesome functionality present in the Test link, it generates reports in desired
format like HTML/ CSV /Excel and we can create graphs too. And the above all is done on the
privileges based which is an art of the testlink and i liked this featuremuch
1. Administrator create a Product Fast Food‖ and a user Adam with rights leader and Bela with rights
Senior tester.
2. Adam imports Software Requirements and for part of these requirements generates empty Test
cases.
3. Bela describe test scenario of these Test cases that are organized according to Components and
Categories.
4. Adam creates Keyword: Regression‖ and assigns this keyword to ten of these test cases.
5. Adam creates a Test Plan Fish & Chips, Build Fish 0.1 and add Test Cases with keywords
Regression.
6. Adam and Bela execute and record the testing with result: 5 passed, 1 failed and 4 are blocked.
7. Developers make a new build Fish 0.2 and Bela tests the failed and blocked test cases only.
Exceptionally all these five Test cases passed.
8. Manager would like to see results. Administrator explains him that he can create account himself on
the login page. Manager does it. He has Guestrights and could see results and Test cases. He can
see that everything passed in overall report and problems in build Fish 0.1 in a report for particular
Build. But he can change nothing.