2. Testing Practices with ALM tools
GOAL general course:
Know the value of MTLM and know how to use its capabilities …
GOAL deep dive:
Tune the value of MTLM, its capabilities and the processes it supports…
3. Lot of discussions
Agenda Day 1 and hands-on lab’s
Start Topics
9:00 Introduction, environments setup
9:15 introduction by the students
9:45 Application Lifecycle Management and Visual Studio General
9:55 Test Planning
10:15 Managing, controlling the testing effort, test plans, test suites and test
configuration
10:45
11:00 Specify test cases and corresponding capabilities of MTM
11:45 Test execution, fast forward, reporting, olap cub
12:00
12:45 Bug workflow, infrastructure configuration for data diagnostic adapters
13:30 Test impact and recommended tests
14:15
14:30 Exploratory testing and create test from bug
14:45 Test Controllers and Agents
15:45 Test Environments in MTLM
4. Environments setup
TFS supported operating system
Installed:
• Team Foundation Server with Basic configuration
• Visual Studio 2010 with SP1
• Microsoft Test Manager 2010 (comes with VS10 Ultimate)
You get an USB with:
• Demo applications (we create a Team Project for them, see lab 1)
• Microsoft Test Agents.msi (we install this together)
• Hands-on lab documents
• This deck, talk through and useful information
5. Lab 1
Create one team projects for the demo applications
Timebox: 15 minuts
8. Start Topics
9:00 Introduction, environments setup
9:15 introduction by the students
9:45 Application Lifecycle Management and Visual Studio General
9:55 Test Planning
10:15 Managing, controlling the testing effort, test plans, test suites and test
configuration
10:45
11:00 Specify test cases and corresponding capabilities of MTM
11:45 Test execution, fast forward, reporting, olap cub
12:00
12:45 Bug workflow, infrastructure configuration for data diagnostic adapters
13:30 Test impact and recommended tests
14:15
14:30 Exploratory testing and create test from bug
14:45 Test Controllers and Agents
15:45 Test Environments in MTLM
15. Start Topics
9:00 Introduction, environments setup
9:15 introduction by the students
9:45 Application Lifecycle Management and Visual Studio General
9:55 Test Planning
10:15 Managing, controlling the testing effort, test plans, test suites and test
configuration
10:45
11:00 Specify test cases and corresponding capabilities of MTM
11:45 Test execution, fast forward, reporting, olap cub
12:00
12:45 Bug workflow, infrastructure configuration for data diagnostic adapters
13:30 Test impact and recommended tests
14:15
14:30 Exploratory testing and create test from bug
14:45 Test Controllers and Agents
15:45 Test Environments in MTLM
40. Start Topics
9:00 Introduction, environments setup
9:15 introduction by the students
9:45 Application Lifecycle Management and Visual Studio General
9:55 Test Planning
10:15 Managing, controlling the testing effort, test plans, test suites and test
configuration
10:45
11:00 Specify test cases and corresponding capabilities of MTM
11:45 Test execution, fast forward, reporting, olap cub
12:00
12:45 Bug workflow, infrastructure configuration for data diagnostic adapters
13:30 Test impact and recommended tests
14:15
14:30 Exploratory testing and create test from bug
14:45 Test Controllers and Agents
15:45 Test Environments in MTLM
42. 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
49. 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)
51. Iteration 1
Create test plan for iteration and a ‘end to end’
test plan.
Create requirement based test suites which
hold test cases for that suite.
52. Iteration 1
Create two additional suites, one for
regression sets, which will be taken along
during the project and one specific for
automation.
53. Copy Test Cases
Copy a Test Case Copy the reference
to a Test Case
ID 21 ID 21
ID 22 ID 21
54. End iteration 1, some important test case are
promoted to the ‘end to end ’ test plan.
55. Iteration 2, test suites are created for the
requirements and the regression test suit is
copied (link or hard?)
56. During the execution of iteration 2 the
regression test suit grows and an automation
suit is added.
63. 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
64. Start Topics
9:00 Introduction, environments setup
9:15 introduction by the students
9:45 Application Lifecycle Management and Visual Studio General
9:55 Test Planning
10:15 Managing, controlling the testing effort, test plans, test suites and test
configuration
10:45 BREAK
11:00 Specify test cases and corresponding capabilities of MTM
11:45 Test execution, fast forward, reporting, olap cub
12:00
12:45 BREAK TILL:
Bug workflow, infrastructure configuration for data diagnostic adapters
13:30
14:15
Test impact and recommended tests 11:00
14:30 Exploratory testing and create test from bug
14:45 Test Controllers and Agents (extra time to finish the labs :)
15:45 Test Environments in MTLM
65. Start Topics
9:00 Introduction, environments setup
9:15 introduction by the students
9:45 Application Lifecycle Management and Visual Studio General
9:55 Test Planning
10:15 Managing, controlling the testing effort, test plans, test suites and test
configuration
10:45 BREAK
11:00 Specify test cases and corresponding capabilities of MTM
11:45 Test execution, fast forward, reporting, olap cub
12:00
12:45 Bug workflow, infrastructure configuration for data diagnostic adapters
13:30 Test impact and recommended tests
14:15
14:30 Exploratory testing and create test from bug
14:45 Test Controllers and Agents
15:45 Test Environments in MTLM
67. 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
69. Test Case
Naming of test case:
Purpose:
• Finding the right test case
• Common understanding
• Intention from the title
• Scan test plans more effectively and efficiently
Proposed solution
#1 make use of linked work items
#2 maximal length of the title 20 characters
#3 format <functionality identifier> <action> <additional information>
#4 make useful queries
77. Shared Steps
Refactor common shared steps in test cases
Reduce test maintenance by sharing test steps across test cases
78. 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.
79. Shared Steps
what about parameters
and expected result in
shared steps?
80. Lab 4
1. Specify multiple test cases.
2. Add some test data iterations.
3. Create shared step and reuse it.
Optional:
play with the parameters and expected result
steps in the shared steps…
Timebox: 15 minuts
81. Start Topics
9:00 Introduction, environments setup
9:15 introduction by the students
9:45 Application Lifecycle Management and Visual Studio General
9:55 Test Planning
10:15 Managing, controlling the testing effort, test plans, test suites and test
configuration
10:45 BREAK
11:00 Specify test cases and corresponding capabilities of MTM
11:45 Test execution, fast forward, reporting, olap cub
12:00
12:45 Bug workflow, infrastructure configuration for data diagnostic adapters
13:30 Test impact and recommended tests
14:15
14:30 Exploratory testing and create test from bug
14:45 Test Controllers and Agents
15:45 Test Environments in MTLM
82. 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.
103. • POINT COUNT TREND - I want to see the results for test in a particular test run
• RESULT COUNT - I want to see trend report for my tests regardless of build or plan
• RESULT COUNT TREND - I want to see trend report for my tests regardless of build or plan
• TEST CASE COUNT - I want to see the number of test cases that have been planned for automation
105. Test Plans and TFS items
MTLM Client
Server
TCM Server TFS
Plan “Iter Plan “Iteration 2” User Story 2
1” Suite US1
Suite US2
Test Case A
Test Case B Test Case A Task X
Plan “Iter Test Case C
3” Test Case D Test Case B
Task Y
Test Case C
Task Z
Test Case C
106. Lab 6
Create excel pivot table to list test points per
Tester.
Timebox: 10 minuts
107. Start Topics
9:00 Introduction, environments setup
9:15 introduction by the students
9:45 Application Lifecycle Management and Visual Studio General
9:55 Test Planning
10:15 Managing, controlling the testing effort, test plans, test suites and test
configuration
10:45 BREAK
11:00 Specify test cases and corresponding capabilities of MTM
11:45 Test execution, fast forward, reporting, olap cub
12:00 Lunch
12:45 LUNCH TILL:
Bug workflow, infrastructure configuration for data diagnostic adapters
13:30
14:15
Test impact and recommended tests
Break
12:45
14:30 Exploratory testing and create test from bug
14:45 Test Controllers and Agents (extra time to finish the labs :)
15:45 Test Environments in MTLM
108. Start Topics
9:00 Introduction, environments setup
9:15 introduction by the students
9:45 Application Lifecycle Management and Visual Studio General
9:55 Test Planning
10:15 Managing, controlling the testing effort, test plans, test suites and test
configuration
10:45 BREAK
11:00 Specify test cases and corresponding capabilities of MTM
11:45 Test execution, fast forward, reporting, olap cub
12:00 Lunch
12:45 Bug workflow, infrastructure configuration for data diagnostic adapters
13:30 Test impact and recommended tests
14:15 Break
14:30 Exploratory testing and create test from bug
14:45 Test Controllers and Agents
15:45 Test Environments in MTLM
116. 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
117. Lab 7
Create a build
File a bug
Resolve a bug
Verify a bug
Timebox: 15 minuts
122. Start Topics
9:00 Introduction, environments setup
9:15 introduction by the students
9:45 Application Lifecycle Management and Visual Studio General
9:55 Test Planning
10:15 Managing, controlling the testing effort, test plans, test suites and test
configuration
10:45 BREAK
11:00 Specify test cases and corresponding capabilities of MTM
11:45 Test execution, fast forward, reporting, olap cub
12:00 Lunch
12:45 Bug workflow, infrastructure configuration for data diagnostic adapters
13:30 Test impact and recommended tests
14:15 Break
14:30 Exploratory testing and create test from bug
14:45 Test Controllers and Agents
15:45 Test Environments in MTLM
124. 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
125. Lab 8
Attach build to test plan
Execute tests
Make code change
Kickoff build
Attach new build to test plan
Evaluate impacted tests
Timebox: 15 minuts
127. Iteration N
Implement
D US2
Sprint
E plan Implement Fix bugs
V User Story ‘1’
Fix bugs
(US1)
Build 1 Build 2 Build 3 Build 4 Build 5 Build 6 Build 7
Regress
Write tests Test US1 &
T Verify fixes impacted
for US1 file bugs
E Sprint tests
S plan
Write tests Test US2 &
T for US2 Verify fixes
file bugs
128. User Stories
Key Value: Requirements Planning
and corresponding
Implement
D
E
Sprint
plan Implement
US2
done dev tasks.
Fix bugs
V User Story ‘1’
Fix bugs
(US1)
Create test tasks
Build 1 Build 2 Build 3 Build 4 and 5
Build assign to 7
Build 6 Build
someone else.
Regress
Write tests Test US1 &
T Verify fixes impacted
for US1 file bugs
E Sprint tests
S plan
Write tests Test US2 &
T for US2 Verify fixes
file bugs
129. Execute the Test
Key Value: Requirements Planning
Specification Tasks
Implement
D
Sprint US2 and other test
E plan Implement Fix bugs
V User Story ‘1’
(US1)
tasks
Fix bugs
Build 1 Build 2 Build 3 Build 4 Build 5 Build 6 Build 7
Regress
Write tests Test US1 &
T Verify fixes impacted
for US1 file bugs
E Sprint tests
S plan
Write tests Test US2 &
T for US2 Verify fixes
file bugs
130. Execute the Test
Key Value: Requirements Planning
Implement
Execution Tasks
D
E
Sprint
Implement
US2 and file bugs (if
Fix bugs
plan
V User Story ‘1’
(US1) any)
Fix bugs
Build 1 Build 2 Build 3 Build 4 Build 5 Build 6 Build 7
Regress
Write tests Test US1 &
T Verify fixes impacted
for US1 file bugs
E Sprint tests
S plan
Write tests Test US2 &
T for US2 Verify fixes
file bugs
131. Key Value: Virtuous Bug Cycle
Dev Implement
D US2
solves
Sprint
E plan Implement Fix bugs
V User Story ‘1’
the (US1)
Fix bugs
bugs.
Build 1 Build 2 Build 3 Build 4 Build 5 Build 6 Build 7
Test
Regress
Verifies WriteUS1
T
for
tests Test US1 &
file bugs
Verify fixes impacted
E Sprint tests
tests
S plan
Write tests Test US2 &
T for US2 Verify fixes
file bugs
132. Key Value: Virtuous Bug Cycle
Check Implement
D US2
Results
Sprint
E plan Implement Fix bugs
V User Story ‘1’
Fix bugs
(US1)
Build 1 Build 2 Build 3 Build 4 Build 5 Build 6 Build 7
Regress
Write tests Test US1 &
T Verify fixes impacted
for US1 file bugs
E Sprint tests
S plan
Write tests Test US2 &
T for US2 Verify fixes
file bugs
133. Start Topics
9:00 Introduction, environments setup
9:15 introduction by the students
9:45 Application Lifecycle Management and Visual Studio General
9:55 Test Planning
10:15 Managing, controlling the testing effort, test plans, test suites and test
configuration
10:45 BREAK
11:00 Specify test cases and corresponding capabilities of MTM
11:45 Test execution, fast forward, reporting, olap cub
12:00 Lunch
12:45 BREAK TILL:
Bug workflow, infrastructure configuration for data diagnostic adapters
13:30
14:15
Test impact and recommended tests
Break
14:30
14:30 Exploratory testing and create test from bug
14:45 Test Controllers and Agents (extra time to finish the labs :)
15:45 Test Environments in MTLM
134. Start Topics
9:00 Introduction, environments setup
9:15 introduction by the students
9:45 Application Lifecycle Management and Visual Studio General
9:55 Test Planning
10:15 Managing, controlling the testing effort, test plans, test suites and test
configuration
10:45 BREAK
11:00 Specify test cases and corresponding capabilities of MTM
11:45 Test execution, fast forward, reporting, olap cub
12:00 Lunch
12:45 Bug workflow, infrastructure configuration for data diagnostic adapters
13:30 Test impact and recommended tests
14:15 Break
14:30 Exploratory testing and create test from bug
14:45 Test Controllers and Agents
15:45 Test Environments in MTLM
138. 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).
139. Lab 9
Create an exploratory bug and create a test case from it
Timebox: 10 minuts
140. Start Topics
9:00 Introduction, environments setup
9:15 introduction by the students
9:45 Application Lifecycle Management and Visual Studio General
9:55 Test Planning
10:15 Managing, controlling the testing effort, test plans, test suites and test
configuration
10:45 BREAK
11:00 Specify test cases and corresponding capabilities of MTM
11:45 Test execution, fast forward, reporting, olap cub
12:00 Lunch
12:45 Bug workflow, infrastructure configuration for data diagnostic adapters
13:30 Test impact and recommended tests
14:15 Break
14:30 Exploratory testing and create test from bug
14:45 Test Controllers and Agents
15:45 Test Environments in MTLM
144. Where and how to run the automated test?
physical test environments
virtualized test environments
145. 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
146. Build
application
physical test environments
versus
virtualized test environments
Provision
Run tests
‘clean’ env
Deploy
application
147. Start Topics
9:00 Introduction, environments setup
9:15 introduction by the students
9:45 Application Lifecycle Management and Visual Studio General
9:55 Test Planning
10:15 Managing, controlling the testing effort, test plans, test suites and test
configuration
10:45 BREAK
11:00 Specify test cases and corresponding capabilities of MTM
11:45 Test execution, fast forward, reporting, olap cub
12:00 Lunch
12:45 Bug workflow, infrastructure configuration for data diagnostic adapters
13:30 Test impact and recommended tests
14:15 Break
14:30 Exploratory testing and create test from bug
14:45 Test Controllers and Agents
15:45 Test Environments in MTLM
148. Lab for Physical
Environments, the
different flavors…
Visual Studio Team
Foundation
Server
Test Manager
Build Server Test Agent
Test Agent
Test Agent
149. 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
150. 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
151. 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
152. 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
153. 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
156. Lab 10
Install and configure the test controller and test agent
http://msdn.microsoft.com/en-us/library/dd648127.aspx
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=a3216d2a-0530-4f6c-a7c9-0df37c54a902
Timebox: 20 minuts
157. Start Topics
9:00 Introduction, environments setup
9:15 introduction by the students
9:45 Application Lifecycle Management and Visual Studio General
9:55 Test Planning
10:15 Managing, controlling the testing effort, test plans, test suites and test
configuration
10:45 BREAK
11:00 Specify test cases and corresponding capabilities of MTM
11:45 Test execution, fast forward, reporting, olap cub
12:00 Lunch
12:45 Bug workflow, infrastructure configuration for data diagnostic adapters
13:30 Test impact and recommended tests
14:15 Break
14:30 Exploratory testing and create test from bug
14:45 Test Controllers and Agents
15:45 Test Environments in MTLM
169. Start Topics
DAY 2
9:00 Recap
9:15 Create Basic CodedUI, from Test Case and Manual
9:45 UIMap and customize the code for optimization
10:15 Data driven Tests and assertions
10:45 break
11:00 Troubleshoot CodedUI, Common Practices and questions
11:30 Configure the build to execute the CodedUI tests, test settings from VS2010, Execute from VS2010 with test agents and analyze
the results
11:30 Associate test automation with test case, execute automated test case from MTM, configure the build to run from the build within
MTM and analyze the results
12:30 break
13:15 MTLM, Scrum and other project Methodologies
13:45 Lab Management - Virtualized Test Environment and execution Demo
14:15 Test info in the OLAP Cube
14:30 Extensibility - test Scribe, TCMIMport
14:45 Create your own Data Diagnostic Adapter
15:15 MTLM usages with Azure projects
16:00 Closing