Key Concepts:
The structure of a Test Framework, its components, and the process to create one will be presented. A Test Framework provides a means to automate tests fast and guarantee their extended existence. It makes the automation process straightforward and systematic, simplifies the error debugging procedures, makes the testware tolerant to all kinds of object changes and reliable in an unstable test environment. The presentation is not an illustration of a specific test framework implementation, but rather a description of the features that should be mandatory attributes of any test framework.
Learning Objectives:
How to present the testware internally as a hierarchy of test sets (structural level), use cases (functional - scenario level), test cases (the scenario steps with verification), test actions (the interface "action" words). How to present the testware externally as a set of configuration files, scripts, libraries.How to separate the business action words from the interface action words and the respective drivers.How to create debug logs that allow to identify the source of a failure in minutes.
4. 4
www.qualitymanagementconference.com
To paraphrase a quote from Tolstoy’s Anna Karenina:
All successful test automation projects
are alike; each unsuccessful automation
project fails in its own way.
Test Automation
5. 5
www.qualitymanagementconference.com
Test Tools Implementation
Programming language Test language
Data
structures
variables, arrays, hashes TS,UC,TC,TA, buffer
Control
statements
if, case compare
for, while, until loop for TS,UC,TC,TA
Functions subroutine, procedure TC {set, test, compare, tear
down}
Control
flow
algorithm unconditional sequence
Users Developers prefer to use
open source software
which can be adapted
Testers prefer to use
commercial tools, with
technical support
8. 8
www.qualitymanagementconference.com
Test Design Techniques:
• Boundary analysis
• Path sensitization
Derived Test Design Methods:
• Arithmetic expressions
• Relational expressions
• Logical expressions
• Algorithm
• State machine
• Instruction set
• Syntax
Test Design Techniques
From test techniques to test methods,
Professional Tester, issue 29, October 2014
9. 9
www.qualitymanagementconference.com
• Test Set (TS) is a part of the testware that verifies a
particular architectural unit of the system.
• Use Case (UC) is a collection of end-to-end scenarios to
cover the functionality of a subsystem.
• Test Case (TC) is a single verification act that moves the
object-to-test from an initial state, executes a test, compares
the actual and expected results, and returns it back to its
initial state; a UC consists of TCs.
• Test Action (TA) is the simplest act of communication with
the object-to-test. A TA supports the interfaces of the object-
to-test (CLI, GUI, SNTP, HTTP).
Testware Hierarchy
14. Test Language
• A test is presented as an unconditional
sequence of TS/UC/TC/TA executions
• The instruction set includes the following
command groups:
– run TS/UC/TC commands (one or multiple
times)
– connection commands
– compare commands
– variable manipulation commands
– limited control commands-pause/stop/exit
14
www.qualitymanagementconference.com
15. Reliability
• returning the object to its initial state
• handling multiple echoes
• support for stimulus-response
synchronization
• multiple connection attempts
15
www.qualitymanagementconference.com
18. Verdicts
18
www.qualitymanagementconference.com
Test
object
Verdict Conditions
TA OK
TIMEOUT
ERROR
‘MATCH’ detected in Output Buffer
‘MATCH’ not found after predefined elapsed time
Predefined error detected in Output Buffer
TC PASS
FAIL
All TAs are ‘OK’ & expected result is found in
Output Buffer
At least one TA is not ‘OK’ or a compare failed
UC PASS
FAIL
All TCs ‘PASS’ed
At least one TC ‘FAIL’ed
TS PASS
FAIL
All UCs ‘PASS’ed
At least one UC ‘FAIL’ed
20. The test framework is a data driven
application that reads test data,
provides syntax checking and compiles
the data into internal test structures,
creates the necessary connections to
the object to test, executes the tests
and finally creates the log and result
files.
20
www.qualitymanagementconference.com
Framework Functionality
21. Debug Log Structure
• Supports TS/UC/TC/TA hierarchy and IDs
• TA: output buffer, rules to capture it, and
how verdict was determined, based on the
buffer content.
• TC: expected and real results and how
verdict was determined, based on the
comparison constraints.
• UC/ TS: how verdict determined, based on
the children verdicts
21
www.qualitymanagementconference.com
22. 10/10/10 Goals
• Test design in 10 minutes
A framework shifts the testers’ focus from writing new
test scripts to reusing existing ones
• Error detection in 10 minutes
The debug file structure allows for easy error
identification and creation of “defect tracker”
• Testware maintenance in 10 minutes
Testware is organized in a fashion that allows to make
unique changes for any single changes in the object-to-
test.
22
www.qualitymanagementconference.com
26. tesToy Test Script
26
www.qualitymanagementconference.com
UC set test environment
run general::setDir ("/home/user/bin")
UC verify out-boundary data
run general::whichTriangle ( "", "", "", "error")
run general::whichTriangle ("5", "", "", "error")
run general::whichTriangle ("5", "5", "", "error")
run general::whichTriangle ( "", "5", "5", "error")
run general::whichTriangle ("5", "5", "a", "error")
UC verify that length of first side is less than other two
run general::whichTriangle ( "6", "2", "3", "NT")
UC verify 'a=b' condition
run general::whichTriangle ("11", "3", "9", "RT")
run general::whichTriangle ("11","11", "9", "IT")
28. Further Reading
• Embedding testability, Professional Tester, issue 27, August 2014,
8– 15. – how to build testability for an embedded system
• From test techniques to test methods, Professional Tester, issue
29, October 2014, 4 – 14. – how to build the minimum number of
tests that covers all implementation errors
• Automating Inside the Lines, Professional Tester, 2015, issue 30.
– how to build a test automation framework
• A Continuous Integration Test Framework, Testing Experience,
issue 28, December 2014, 30 – 34. – how to build a continuous
integration test framework
• QA of Testing, Professional Tester, issue 28, October 2014, 9 – 12.
- how to automatically monitor the test completeness
28
www.qualitymanagementconference.com
29. Thank you for attending this session
Send your comments or questions to
gregory.solovey@alcatel-lucent.com
29
www.qualitymanagementconference.com