staf 在自動化測試上的延伸應用 -- tmstaf (trendmicro staf)
DESCRIPTION
by 李志和 (Bevis Lee)TRANSCRIPT
![Page 1: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/1.jpg)
李志和 (Bevis Lee)Sr. Engineer, R&D Dept.
2012/06/10
STAF 在自動化測試上的延伸應用 –TMSTAF (TrendMicro STAF)
6/12/20121 | Copyright 2012 Trend Micro Inc.
![Page 2: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/2.jpg)
Agenda
• Brief Introduction of STAF
• What‟s TMSTAF?
• TMSTAF vs. QA automation
• Q&A
6/12/2012 2| Copyright 2012 Trend Micro Inc.
![Page 3: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/3.jpg)
Brief Introduction of STAF
6/12/2012 3| Copyright 2012 Trend Micro Inc.
![Page 4: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/4.jpg)
• History
– Created at IBM Austin in 1998
– Open-sourced (on SourceForge) in 2001
• http://staf.sourceforge.net/
46/12/2012 | Copyright 2012 Trend Micro Inc.
![Page 5: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/5.jpg)
• STAF runs as a daemon process, called STAFProc
6/12/2012 5| Copyright 2012 Trend Micro Inc.
![Page 6: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/6.jpg)
What‟s TMSTAF?
6/12/2012 6| Copyright 2012 Trend Micro Inc.
![Page 7: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/7.jpg)
6/12/2012 7| Copyright 2012 Trend Micro Inc.
TMSTAF = Trend Micro STAF
![Page 8: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/8.jpg)
6/12/2012 8Confidential | Copyright 2012 Trend Micro Inc.
TMSTAF Architecture
![Page 9: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/9.jpg)
6/12/2012 9| Copyright 2012 Trend Micro Inc.
![Page 10: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/10.jpg)
File Structure
6/12/2012 10| Copyright 2012 Trend Micro Inc.
![Page 11: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/11.jpg)
6/12/2012 11Confidential | Copyright 2012 Trend Micro Inc.
TMSTAF Features
![Page 12: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/12.jpg)
6/12/2012 12| Copyright 2012 Trend Micro Inc.
Testware configurations can be customized
Test suite, test case defined in Python syntax
Cross-platform execution
Command line interface
Testware concept included:
Test process included: Setup, Test and Teardown
Execution log for tracing
XML test report w/ email notification
![Page 13: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/13.jpg)
Testing Report
6/12/2012 13| Copyright 2012 Trend Micro Inc.
![Page 14: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/14.jpg)
Email Notification of Testing Result
6/12/2012 14| Copyright 2012 Trend Micro Inc.
![Page 15: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/15.jpg)
TMSTAF vs. QA‟s Automation
6/12/2012 15| Copyright 2012 Trend Micro Inc.
![Page 16: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/16.jpg)
QA‟s Automation Process
• Automation construction
• Automation online
6/12/2012 16| Copyright 2012 Trend Micro Inc.
Test
cases
creation
Test cases
convert to
automation
scripts
Automation
script pre-
run and
debug
Integrate
with build
release
process
Build
quality
verification
Automation
environment
setup
![Page 17: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/17.jpg)
6/12/2012 17Confidential | Copyright 2012 Trend Micro Inc.
Test Cases Creation
![Page 18: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/18.jpg)
• Based on concept of „test suite‟, test case can be created for both „manual‟ and „automation‟ use
6/12/2012 18| Copyright 2012 Trend Micro Inc.
![Page 19: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/19.jpg)
6/12/2012 19Confidential | Copyright 2012 Trend Micro Inc.
Automation
Environment Setup
![Page 20: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/20.jpg)
• Automation environment can be deployed easily
6/12/2012 20| Copyright 2012 Trend Micro Inc.
Automation Environment
Python 2.6
TMSTAF
framework
STAF 3.x
![Page 21: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/21.jpg)
6/12/2012 21Confidential | Copyright 2012 Trend Micro Inc.
Test Cases Convert to
Automation Scripts
![Page 22: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/22.jpg)
• Convert test case to automation scripts structurally
6/12/2012 22| Copyright 2012 Trend Micro Inc.
Automation
Module
Automation
ModuleTest step
Test stepTest case
(automation
script)
Automation
Module
![Page 23: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/23.jpg)
6/12/2012 23| Copyright 2012 Trend Micro Inc.
![Page 24: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/24.jpg)
6/12/2012 24| Copyright 2012 Trend Micro Inc.
![Page 25: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/25.jpg)
6/12/2012 25Confidential | Copyright 2012 Trend Micro Inc.
3 Weapons…
![Page 26: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/26.jpg)
I - Scenario Mechanism
6/12/2012 26| Copyright 2012 Trend Micro Inc.
var1 = 111
var2 = 222
func = PythonFunction('moduleATester', 'testFunc1')
r = self.addTest(func, [var1,var2])
r.failUnlessEqual(0)
var1 = 333
var2 = 444
func = PythonFunction('moduleATester', 'testFunc1')
r = self.addTest(func, [var1,var2])
r.failUnlessEqual(0)
test0010.py
test0020.py
![Page 27: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/27.jpg)
6/12/2012 27| Copyright 2012 Trend Micro Inc.
var1 = 111
var2 = 222
self.setScenario('_scenario01.py')
test0010.py
test0020.py
var1 = 333
var2 = 444
self.setScenario('_scenario01.py')
func = PythonFunction('moduleATester', 'testFunc1')
result = self.addTest(func, [var1,var2])
result.failUnlessEqual(0)
_scenario01.py
![Page 28: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/28.jpg)
II - Setup, Teardown and Test procedures
6/12/2012 28| Copyright 2012 Trend Micro Inc.
Test Case
Setup steps
Test steps
Teardown steps
![Page 29: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/29.jpg)
6/12/2012 29| Copyright 2012 Trend Micro Inc.
• Setup = addSetup()
• Test = addTest()
• Teardown = addTeardown()
![Page 30: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/30.jpg)
III - Result Verification
6/12/2012 30| Copyright 2012 Trend Micro Inc.
• Execution result of each steps (includes setup and teardown) can be verified easily
Passed if ‘result’ = 0
![Page 31: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/31.jpg)
6/12/2012 31Confidential | Copyright 2012 Trend Micro Inc.
Script Pre-run and
Debug
![Page 32: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/32.jpg)
6/12/2012 32| Copyright 2012 Trend Micro Inc.
• More efficiency development of automation
Refinement
of script
Script
execution
Debugging
of script
![Page 33: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/33.jpg)
6/12/2012 33| Copyright 2012 Trend Micro Inc.
• Script execution from command line interface
![Page 34: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/34.jpg)
6/12/2012 34| Copyright 2012 Trend Micro Inc.
Run Target Case
Run Target Suite
“-h” Online Help
Easy to Integrate
![Page 35: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/35.jpg)
6/12/2012 35| Copyright 2012 Trend Micro Inc.
• Execution log for tracing/debugging
![Page 36: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/36.jpg)
6/12/2012 36| Copyright 2012 Trend Micro Inc.
![Page 37: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/37.jpg)
6/12/2012 37Confidential | Copyright 2012 Trend Micro Inc.
Automation Online
![Page 38: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/38.jpg)
6/12/2012 38| Copyright 2012 Trend Micro Inc.
Build Release Flow
![Page 39: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/39.jpg)
6/12/2012 39| Copyright 2012 Trend Micro Inc.
1
2
3
4
5
![Page 40: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/40.jpg)
6/12/2012 40Confidential | Copyright 2012 Trend Micro Inc.
Build Quality
Verification
![Page 41: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/41.jpg)
6/12/2012 41| Copyright 2012 Trend Micro Inc.
Mail Notifications
![Page 42: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/42.jpg)
6/12/2012 42| Copyright 2012 Trend Micro Inc.
![Page 43: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/43.jpg)
6/12/2012 43| Copyright 2012 Trend Micro Inc.
![Page 44: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/44.jpg)
Detail Testing Report
6/12/2012 44| Copyright 2012 Trend Micro Inc.
![Page 45: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/45.jpg)
6/12/2012 45| Copyright 2012 Trend Micro Inc.
![Page 46: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/46.jpg)
6/12/2012 46| Copyright 2012 Trend Micro Inc.
![Page 47: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/47.jpg)
6/12/2012 47| Copyright 2012 Trend Micro Inc.
![Page 48: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/48.jpg)
6/12/2012 48| Copyright 2012 Trend Micro Inc.
![Page 49: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/49.jpg)
6/12/2012 49| Copyright 2012 Trend Micro Inc.
![Page 50: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/50.jpg)
6/12/2012 50| Copyright 2012 Trend Micro Inc.
![Page 51: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/51.jpg)
6/12/2012 51| Copyright 2012 Trend Micro Inc.
![Page 52: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/52.jpg)
6/12/2012 52Confidential | Copyright 2012 Trend Micro Inc.
So, with TMSTAF,
you can…
![Page 53: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/53.jpg)
6/12/2012 53| Copyright 2012 Trend Micro Inc.
Test
cases creation
Test cases
convert to
automation
scripts
Automation script
pre-run and debug
Automation
environment
setup
Test case can be used for both ‘manual’ and
‘automation’ use, no extra effort needs
Easy to setup automation environment for
development and execution
Implement test cases with structural and flexible
mechanism
More efficiency development and trouble-shooting
of automation
Integrate with
build release
process
Build quality
verification
Easy integrate with standard build release process
Useful information in testing report can help to
identify issue more quickly
![Page 54: STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)](https://reader033.vdocuments.pub/reader033/viewer/2022061504/554a0530b4c905e56c8b5546/html5/thumbnails/54.jpg)
Q&A
6/12/2012 54| Copyright 2012 Trend Micro Inc.