Professional Documents
Culture Documents
Unit-03
School of CSA
Pinaka Pani. R
Assitant Professor
Outline
• Path Testing
• Control Flow Graph
• DD-Path Fraph
• Questions
Path testing
• Dataflow Testing
• Static Data Flow Testing
• Dynamic Data Flow testing
• Define/USE Testing
• Data Flow Testing : Key Steps
• Example Commission problem
• Data Flow Testing Strategies
Data flow Testing
• A structural or White box testing technique
• Focuses
Variables are defined and used at different points within the
program.
• Motivations of data flow testing
The memory location for a variable is accessed in a
“desirable” way.
Verify the correctness of data values “defined” (i.e.
generated) – observe that all the “uses” of the value produce the
desired results
• In short each data variable is tracked and its use is verified.
• This approach tends to uncover bugs like variables used but
not initialize, or declared but not used, and so on
Contd…
• Data flow testing can be performed at two conceptual levels.
– Static data flow testing
– Dynamic data flow testing
• Du-paths and dc-paths capture the essence of computing with stored data
values
• Du-Paths and dc-Paths describe the flow of data across source statements
from the locations.
• where the values are defined to the locations
21 22 23 24 25 26 27 28
2
30 9 3
3 4 3
3
1 5 8
3 3
2 6 3
3 3
9
3 7 4
0
4 4
Step 2 and 3 : Define/Use Nodes for variable in the commission
problem
Variable name Defined at node(P-use) Used at Node(C-use)
lprice 7 24
sprice 8 25
bprice 9 26
tlocks 10 , 16 16 , 21 , 24
tstocks 11 , 17 17 , 22 , 25
tbarrels 12 ,18 18 , 23 , 26
locks 13 , 19 14 , 16
stocks 15 17
barrels 15 18
lsales 24 27
ssales 25 27
bsales 26 27
27 28 , 29 , 33 , 34 ,37 , 39
sales
31 , 32 , 33 , 36 , 37 , 39 32 , 33 , 37 , 42
comm
Step 4 : identify du-pairs and their use (p- or c- )
Variable Path(Beginnin Definition-
du-path
name g , End nodes Clear
<7-8-9-10-11-12-13-14-15-16-
lprice (7 , 24) Yes
17-18-19-20-21-22-23-24>
<8-9-10-11-12-13-14-15-16-17-
Sprice (8, 25) 18-19-20-21-22-23-24-25>
YES
<10-11-12-13-14-15-16-17-18- NO
(10 , 21) 19-20-14-21>
total <10-11-12-13-14-15-16-17-18-
(10 , 24) NO
locks 19-20-14-21-22-23-24>
(16 , 16) <16-16> Yes
(16 , 21) <16-17-18-19-14-21> NO
(16 , 24) <16-17-18-19-20-14-21-22-23-24> NO
Step 4 : Identify du-pairs and their use (p- or c- ) Contd…
Variable Path(Beginning Definition-
du-path
name , End nodes Clear
(13 , 14) <13-14> Yes
( 13 , 16) <13-14-15-16> Yes
Locks (19 , 14) <19-20-14> Yes
(19 , 16) <19-20-14-15-16> Yes
(27 ,28) <27-28> Yes
(27 , 29) <27-28-29> Yes
(27 , 33) <27-28-29-30-31-32-33> Yes
Sales
(27 , 34) <27-28-29-34> Yes
(27 , 37) <27-28-29-34-35-36-37> Yes
(27 , 39) <27-28-29-34-38-39> Yes
( (31,32,33),42) <31-32-33-42> Yes
comm ((34 , 35) , 42) <34-35-42> Yes
((39 , 42 ) <39 - 42> Yes
Step 5 : Define the test cases
• All-c-uses
To achieve 100% All-c-uses data flow coverage at least one sub-
path from each variable definition to every c-use of that definition
must be executed.
• All-p-uses
To achieve 100% All-p-uses data flow coverage at least one sub-
path from each variable definition to every p-use of that definition
must be executed.
• All-uses
To achieve 100% All-uses data flow coverage at least one sub-
path from each variable definition to every use of that definition (both
p- and c- use) must be executed.
• All-du-paths
To achieve 100% All-du-paths data flow coverage every simple
sub-path from each variable definition to every use of that definition
must be executed.
Data Flow Testing Strategies
Procedure: Test the up modules and extend testing to the down levels.
•Aim: Check if up modules function as expected.
Merits
• Focuses on the core business processes.
• Tester can test by priority and find larger errors in the design.
• Early provision of Prototypes possible.
Demerits
• The modules at the lower level are insufficiently tested, and the specific
errors there may be discovered too late.
Top Down
1. Top-down
Bottom-up
Overview
History of Testing
What is Software Test Automation?
Why is Software Test Automation Important?
Software Test Automation Process
Approach to Test Automation
Types of automation framework
Classification of Software Test Tools
Test Automation and Tools for Software
Benefits of Automation
Automation Testing
Results Reporting
Plan Software Software Test Automation
Test Automation Process
This approach can be applied to any application that has a graphical user
interface. However, reliance on these features poses major reliability and
maintainability problems.
A variation on this type of tool is for testing of web sites. Here, the
"interface" is the web page. However, such a framework utilizes entirely
different techniques because it is reading HTML instead of observing
window events.
Different types of Automation Frameworks
The frameworks are categorized on the basis of the
automation component they leverage.
Data-driven testing
Modularity-driven testing
Keyword-driven testing
Hybrid testing
Model-based testing
Automation Testing Tools
Maveryx : Maveryx is a free and open source Test Automation Framework for functional
and regression testing of Java applications. Maveryx eliminates the GUI Map dependency.
Maveryx supports approximate matching to identify the GUI objects even in case of few or
partial information given by the tester in the test scripts. Maveryx works with Eclipse,
NetBeans, JUnit, IBM Rational Functional Tester, etc.
Requirement: OS Independent
Capedit : Capedit is a open-source packet modification tool. It is used for protocol testing.
This tool has some unique features like stream based packet field modification, packet
deletion/duplication/reordering, IP and MAC address find and replace, auto checksum for
IP/ICMP/IGMP/TCP/UDP.
Proprietary GUI testing tools
“AutoIt” - Microsoft Windows GUI Testing. Free of charge but not open source.
“GUIdancer” by “Bredex” – Tool for Java (Swing, RCP/SWT, GEF) and HTML web testing.
“IBM Rational Robot” by “IBM” – Tool for functional testing of client/server applications
“QF-Test” by “Quality First Software” - Tool for Java/Swing, Eclipse/SWT and HTML only
“SilkTest” by ”Micro Focus International” - Tool for functional and regression testing
“Telerik Test Studio” by “Telerik” – Tool for Load, Performance, System and mobile automation
testing
”Visual Studio Test professional” – Tool for UI testing using Test Automation FX by Windows
“Ranorex” automated testing software – Tool for web, desktop and mobile apps
Best Tools for Test Automation
1. QTP - HP-QuickTest Professional
2. Watir
3. TOSCA Test Suite
4. Selenium
5. Visual Studio Test Professional
6. WebUI Test Studio
7. Rational Functional Tester
8. Test Complete
9. Test partner
10. SOA Test
11. Test Drive
Automated Testing Tools
• xUnit
• Selenium
• Test Complete
• Custom
xUnit
xUnit is the white box automation testing framework.
Frameworks based on the design by Kent Beck - (born 1961) is an
American software engineer and the creator of extreme
programming.
Originally implemented for SmallTalk as SUnit.
Partial List of Frameworks
◦ NUnit (.net)
◦ JUnit (java)
◦ CUnit ( C )
◦ CPPUnit (C++)
◦ SUnit (SmallTalk)
xUnit test execution
◦ Setup
◦ Test body
◦ Teardown
xUnit architecture
All xUnit frameworks share the following basic component architecture, with some varied implementation details.
Test case
This is the most elemental class. All unit tests are inherited from here.
Test fixtures
A test fixture (also known as a test context) is the set of preconditions or state needed to run a test. The developer
should set up a known good state before the tests, and return to the original state after the tests.
Test suites
A test suite is a set of tests that all share the same fixture. The order of the tests shouldn't matter.
Test execution
The execution of an individual unit test proceeds as follows:
/* First, we should prepare our 'world' to make an isolated environment for testing */
setup();
...
/* Body of test - Here we make all the tests */
...
/* In the end, whether succeed or fail we should clean up so that other tests or code is not corrupted */
teardown();
The setup() and teardown() methods serve to initialize and clean up test fixtures.
Assertions
An assertion is a function or macro that verifies the behavior (or the state) of the unit under test. Failure of an assertion
typically throws an exception, aborting the execution of the current test.
Selenium
Testing tool for web applications.
Comes in API and tool form.
Supports:
◦ Windows: IE, Firefox, Seamonkey browser, Opera
◦ Mac OS X: Safari, Firefox, Camino, Seamonkey
◦ Linux: Firefox, Konqueror
Can create tests using the Selenium library in many languages
(Java, .NET, Perl, Python, HTML and Ruby)
Can create tests using their Selenium IDE which is implemented
as a Firefox extension.
◦ Once created in Firefox, the tests can be run in any of the supported
browsers.
Selenium Components
Selenium-IDE
Selenium-Grid
Selenium-IDE
• Integrated Development Environment for building Selenium test cases.
• Operates as a Firefox add-on and provides an interface for developing and running
individual test cases or entire test suites.
• Selenium-IDE has a recording feature, which will keep account of user actions as they are
performed and store them as a reusable script to play back.
• It also has a context menu (right-click) integrated with the Firefox browser, which allows
the user to pick from a list of assertions and verifications for the selected location.
• Offers full editing of test cases.
• Although it is a Firefox only add-on, tests created in it can also be run against other
browsers by using Selenium-RC & specifying the name of the test suite on the command
line.
Selenium Remote Control
• This allows for running tests in parallel, with the entire test suite
theoretically taking only as long to run as the longest individual test.
Steps to start with Selenium!
1) Begin: write and run tests in Firefox.
Selenium IDE is a Firefox add-on that records clicks, typing, and other
actions to make a test, which you can play back in the browser.
2) Accessors examine the state of the application and store the results in variables,
e.g. “storeTitle”.
• They are also used to automatically generate Assertions.
3) Assertions are like Accessors, but verify that the state of the application conforms
to what is expected. Eg. “make sure the page title is X”, “verify that this checkbox
is checked”.
The list of
actions in the
actual test
case
to
execute
The root of web
application you
want to test
Selenium IDE
Execution
Commands Record test
actions
Reference of the
currently selected
Specify commands,
command
including asserts
Test Suite
Executi
on
Control
Test Cases
Steps of
the
test case
Application
being tested
TestRunner Control
TestRunner Control Pause/Play
Run Selected Test Execution
Step through
Execution
Run All Tests
Control Speed
of Execution
Highlight Summary of
Elements in the the Test
Execution
Repeatable: Testers can test how the website or software reacts after
repeated execution of the same operation.
Reliable: Tests perform precisely the same operation each time they are
run thereby eliminating human error.
Comprehensive: Testers can build test suites of tests that covers every
feature in software application.
• http://www.autoitscript.com/site/autoit/
• http://www.autohotkey.com/
• http://sourceforge.net/projects/qaliber/
THANK YOU