9. Test Plans
Test Suites
Test Configurations
Organize the testing effort in a Test Execution Plan
Create dynamic test suites for changing selection criteria
Define various test configurations and share automation across those
16. Test Suites Organization
Naming of test suites for agile environments:
Suite per user story (requirement based) and one additional
test suite for regression tests.(query based?)
(test cases are copied to the regression test suite)
22. mtm://<server name>:<port>/<tfs vdir>/<Collection name>/p:<project name>/<center
group>/<group specific>
Open Test results
Open Test Cases (or any work item)
Open Test Runs
Open Test Plans
Connect to test plans
mtm://server:8080/tfs/ProjectCollection/p:Project/testing/testcase/open?id=67
http://blogs.msdn.com/b/vstsqualitytools/archive/2010/02/09/sharing-content-in-microsoft-
test-manager.aspx
24. Test Case
Shared Steps
Test Data Iterations
Link test cases and requirements to provide requirement traceability
Data drive test cases with different parameters
Refactor common shared steps in test cases
32. Shared Steps
Refactor common shared steps in test cases
Reduce test maintenance by sharing test steps across test cases
33. Shared Steps
Shared Step candidates?
• REUSE – Many steps, reused for many test cases . Benefit: time, retyping, boring work.
• EXPECTED CHANGES – for example environment variables change [URL]. Benefit: Time, test cases
which need this step are updated automatically, also action recording.
• PRE- CONDITIONS – bring the system under test to a certain state and execute the different
verifications. Benefit: beside time, you are certain the application under test is in the same state for every test case
• BACK TO INITIAL STATE - after test execution bring the environment back to the initial state for
new test cases. Benefit: beside time, you are certain the application under test is always in a clean state for new test
cases.
34. Test Execution
Test Runner
A test that you will want to run multiple times.
Different manual tests that contain common steps.
Verifying a bug is fixed by using a manual test.
50. The Bug Flow
Link build 2 test
plan. T Execute File Bug Verify fix Close or
Configure Data E Manual by using reopen
collectors. S Tests playback Bug
T
Build
definition is
the
intergration
Setup build and
deploy D Resolve Checkin
E Bug Build
V Deploy
52. Test Impact
Assign build 2
test plan. T Execute Assign Evaluated and reset
Execute
Execute
Configure Data E ‘passed’ ‘NEW’ build tests impacted by
‘passed’
‘passed’
collectors. S Tests 2 Test Plan code churn
Tests
Tests
T
Build
definition is
the
intergration
Setup build and
deploy D Make Checkin
E code Build
V changes Deploy
56. PRO:
- Reuse scenario knowledge business user
- No typing detailed test steps
- Easy to parameterize
1 Record scenario by business user with - Writing standards for test steps
MTM on application under test. Action - MTM capabilities in step 3. (bug, codedUI,
recommended test etc …)
recording is captured. Most benefit during step 2 (test case writing),
benefit in step 1: run once in common situation.
Benefit in step 3: common MTM benefits (record
playback, fast forward, parameters etc) and
benefit of well written steps.
2 Create test steps (with parameters) in
MTM by using the action recording.
CON:
- Manual actions and tests.
- Test steps text are technical names
- Action recording (step 1) must be clean.
- Unknown what is validated, during step 2, need
additional knowledge.
- The business user must think of the important
scenarios
3 Save test case and execute it by a tester
The action recording during step 1 can have
on application under test, by using MTM. unnecessary steps, these can be removed during the
execution (1) or during the specification (2).
84. VS2010 Test Tools
UI Test Automation Capabilities
Fast Forward
CodedUI
Test Infrastructure
85. Test Automation Investment Levels
0 No investment in any kind of automation. Just click and test.
1 Clean up of the Action log maybe re-execute, for more smooth Fast Forward.
2 Basic CodedUI. Only use the default generation, add your own assertion.
3 Advanced CodedUI. Customize the CodedUI and UIMap for optimization.
90. Cleaning the action recording
When: executing the same test case on
multiple environments or when using test data
iteration or … and don’t forget the shared
steps
103. Where and how to run the automated test?
physical test environments
virtualized test environments
104. physical test virtualized test
environments environments
MTLM Client MTLM Client
Physical
Test Client TFS 2010 System Center Virtual
TFS 2010
Machine Manager
(SCVMM)
Hyper-V Library
Physical Host Shares
Test Client VM
VM
share
share
105. Build
application
physical test environments
versus
virtualized test environments
Provision
Run tests
‘clean’ env
Deploy
application
106. Lab for Physical
Environments, the
different flavors…
Visual Studio Team
Foundation
Server
Test Manager
Build Server Test Agent
Test Agent
Test Agent
107. Configurations for automated test execution:
A
Flavor A: Execution from VS2010…
Real developer test / test automation dry run
(Triggered by: right mouse click – run tests, in test project)
http://msdn.microsoft.com/en-us/library/dd286580.aspx
No additional configuration needed*
* Data Diagnostic Settings in the Local.Testsettings file are configurable.
Pro: Con:
Easy setup No collection of test results in TFS
Debug-able test automation Run on developer environment
108. Configurations for automated test execution:
B
Flavor B: Execution during build with Build controller…
not recommended, strange to run UI tests on build
Part of Build Verification Tests
(triggered by: build)
Set the Build Service to run in interactive mode
http://blogs.msdn.com/b/mathew_aniyan/archive/2009/05/26/coded-ui-test-in-a-team-build.aspx
Configure the build to run the tests
http://msdn.microsoft.com/en-us/library/ms182465.aspx#CreateBuildType
* Data Diagnostic Settings in the *.Testsettings file are configurable.
Pro: Con:
Easy setup No collection of test results in TFS
Test results in build result Build Controller needs to run in interactive mode
Tests are executed on build environment
Run on build environment
109. Configurations for automated test execution:
C
Flavor C: Execution during build with Test controller… B
Preferred configuration above flavor
Part of Build Verification Tests on multiple test agents
(triggered by: build)
Configure Test Controller (don’t register it with a project collection )
http://msdn.microsoft.com/en-us/library/dd648127.aspx#TestControllers
Configure Test Agents on clients (interactive mode)
http://msdn.microsoft.com/en-us/library/dd648127.aspx#TestAgents
Configure *.Testsettings file in solution to use Test Controller and Test Agents
Configure the build to run the tests (see B)
Pro: Con:
Test run on test environments No collection of test results in TFS
Tests run on multiple environments Harder to configure
Test Results in Build result Need for specific test client environments
Test Settings from VS
110. Configurations for automated test execution:
D
Flavor D: Execution from Microsoft Test Manager…than BVT
Other type of test
Part of Regression Tests
(triggered by: MTM user, right mouse click on test case, run)
Configure Test Controller (register it with a project collection )
Configure Test Agents on clients (interactive mode, can be the same as MTM)
Configure Lab Center in MTM to use test controller and create test ‘agent’ environment.
http://msdn.microsoft.com/en-us/library/ee390842.aspx
http://msdn.microsoft.com/en-us/library/dd293551.aspx
Associate CodedUI test with WI Test Case from VS.
http://www.richard-banks.org/2010/11/how-to-use-codedui-tests-watin-and-mtm.html
Pro: Con:
Test run on test environments Manually triggered by Tester
Tests run on multiple environments Hard to configure
Test Result in MTM and TFS Need for specific test client (same as MTM?)
Test Settings from MTM
111. Configurations for automated test execution:
E
Flavor E: Execution from MTM duringPreferred configuration above flavor C
Build…
Part of BVT Flavor D and E can be configured together
(triggered by: Build)
Configure Test Controller (register it with a project collection )
Configure Test Agents on clients (interactive mode, can be the same as MTM)
Configure Lab Center in MTM to use test controller and create test ‘agent’ environment.
Associate CodedUI test with WI Test Case from VS.
Create Build task to run TCM or MSTEST task for Test Plan
http://blogs.microsoft.co.il/blogs/shair/archive/2010/10/30/how-to-run-coded-ui-tests-from-command-line.aspx
Pro: Con:
Test run on test environments Hard to configure
Tests run on multiple environments Need for specific test client (same as MTM?)
Test Result in MTM and TFS
Triggered by build
121. Configurations for automated test execution:
C
Flavor C: Execution during build with Test controller… B
Preferred configuration above flavor
Part of Build Verification Tests on multiple test agents
(triggered by: build)
Configure Test Controller (don’t register it with a project collection )
http://msdn.microsoft.com/en-us/library/dd648127.aspx#TestControllers
Configure Test Agents on clients (interactive mode)
http://msdn.microsoft.com/en-us/library/dd648127.aspx#TestAgents
Configure *.Testsettings file in solution to use Test Controller and Test Agents
Configure the build to run the tests (see B)
Pro: Con:
Test run on test environments No collection of test results in TFS
Tests run on multiple environments Harder to configure
Test Results in Build result Need for specific test client environments
Test Settings from VS
127. Configurations for automated test execution:
D
Flavor D: Execution from Microsoft Test Manager…than BVT
Other type of test
Part of Regression Tests
(triggered by: MTM user, right mouse click on test case, run)
Configure Test Controller (register it with a project collection )
Configure Test Agents on clients (interactive mode, can be the same as MTM)
Configure Lab Center in MTM to use test controller and create test ‘agent’ environment.
http://msdn.microsoft.com/en-us/library/ee390842.aspx
http://msdn.microsoft.com/en-us/library/dd293551.aspx
Associate CodedUI test with WI Test Case from VS.
http://www.richard-banks.org/2010/11/how-to-use-codedui-tests-watin-and-mtm.html
Pro: Con:
Test run on test environments Manually triggered by Tester
Tests run on multiple environments Hard to configure
Test Result in MTM and TFS Need for specific test client (same as MTM?)
Test Settings from MTM
135. Configurations for automated test execution:
E
Flavor E: Execution from MTM duringPreferred configuration above flavor C
Build…
Part of BVT Flavor D and E can be configured together
(triggered by: Build)
Configure Test Controller (register it with a project collection )
Configure Test Agents on clients (interactive mode, can be the same as MTM)
Configure Lab Center in MTM to use test controller and create test ‘agent’ environment.
Associate CodedUI test with WI Test Case from VS.
Create Build task to run MTC or MSTEST task for Test Plan
http://blogs.microsoft.co.il/blogs/shair/archive/2010/10/30/how-to-run-coded-ui-tests-from-command-line.aspx
Pro: Con:
Test run on test environments Hard to configure
Tests run on multiple environments Need for specific test client (same as MTM?)
Test Result in MTM and TFS
Triggered by build
Test Settings from MTM
138. 1
Configure additional environments in Test Plan properties.
Win 7 IE9 configuration
Win 7 IE8 configuration
TC MTLM Client
Win 7 IE8 configuration
Physical
Test Client
TFS 2010
Win 7 IE9 configuration
Physical
Test Client
139. 1
Get Test Plan ID
Get Test Suite
Get Test Configurations
with TCM.exe
140. 2
Create command line for Test Run for the different Test Configurations
"run /create /title:""Run on Host for specific Test Point"" /planid:16
/querytext:""SELECT * FROM TestPoint WHERE ConfigurationId=13""
/settingsname:""Automated Test on Windows 7 Environment IE9""
/testenvironment:""Win 7 IE9"" /collection:http://clemenes-
pc:8080/tfs/defaultcollection /teamproject:EmployeeApplication"
"run /create /title:""Run on test env for specific Test Point"" /planid:16
/querytext:""SELECT * FROM TestPoint WHERE ConfigurationId=12""
/settingsname:""Automated Test on Windows 7 Environment IE8""
/testenvironment:""Win 7 IE8"" /collection:http://clemenes-
pc:8080/tfs/defaultcollection /teamproject:EmployeeApplication"
142. 6
Queue a new Build
Watch the Test Agent and
Test Environment
143. Build
application
Provision
Run tests
‘clean’ env
Deploy
application
144. VS2010 Lab Management
• Reproduce the exact conditions of a bug or other development
issue.
• Build, deploy, and test applications automatically in a clean
environment.
• Reduce the time required to create and configure machines for
testing an application.
• Run multiple copies of a test or development at the same time.
• Enable members of a team to create and manage virtual
environments without requiring system administrator privileges.
145. MTLM Client
TFS 2010 System Center Virtual Machine
Manager (SCVMM)
Hyper-V Library
Host Shares
VM share
VM share