![Page 1: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/1.jpg)
Richard ErwinDeveloper Tools SpecialistMicrosoft UK
27th June 2011
Driving Quality Throughout the Application Lifecycle
![Page 2: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/2.jpg)
Define
Design
Develop
Test
Release
Maintain
Phases of the Application Lifecycle
Test
Develop
![Page 3: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/3.jpg)
Cost of BugsCo
st /
£
Lifecycle stageDevelopment Testing UAT Released
![Page 4: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/4.jpg)
Team Foundation Server
Application Lifecycle ToolingBusiness Analyst Eclipse Developer
Tech Writer on Mac OS X
Visual Studio Developer
Tester
C++ developer on Linux
• Dev Process Support• Version Control • Automated Build• Test Case
Management• Reporting
![Page 5: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/5.jpg)
Code Quality ToolingUnit
Testing& TDD
Code Coverag
e
Test Impact
AnalysisPex
Static Code
AnalysisCode
Metrics
Code Profiling
Style Cop
Check-In Policies
Automated Build
Reporting Shelving
Test Tools Security Tools
Database Tools
Architecture Tools
Unit Testing Code Analysis
Other ToolsProcess
Free Pro Premium Ultimate TFS
![Page 6: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/6.jpg)
Unit Testing
![Page 7: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/7.jpg)
Unit Testing
− What is it?− Ensuring individual units of source code work
− A developer, not tester, activity− Unit test ≠ functional test
− Why do it?
Quality Flexibility Delivery Time
![Page 8: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/8.jpg)
Test Driven Development
− Grown out of eXtreme Programming− Write Test before Implementation− Improve Code Coverage− Can help With Implementation Design− Catch Defects Early
Make it Fail• No code without a failing test
Make it Work• As simply as possible
Make it Better• Refactor
![Page 9: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/9.jpg)
PEX
− Automatically generate test suites with high code coverage.
− Visual Studio add-in for testing .NET Framework applications
− Moles - Isolation framework for .NET
![Page 10: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/10.jpg)
Code Coverage
− How much unit testing should you do?− How much of the code is being tested?
![Page 11: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/11.jpg)
Unit TestingDEMO
![Page 12: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/12.jpg)
Code Analysis
![Page 13: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/13.jpg)
Code Metrics
− Is the Code Maintainable?− Where are Defects Likely to be Found?− Where Should I Concentrate my Efforts?
![Page 14: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/14.jpg)
Code Metrics
Maintainability Index
Cyclomatic Complexity
Depth of Inheritance
Class Coupling
Lines of Executable
Code
![Page 15: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/15.jpg)
Maintainability Index
0 – 9 Low Maintainability
10 – 19 Moderately Maintainable
20-100 Good Maintainability
MAX(0,(171 - 5.2 * ln(Halstead Volume) 0.23 * (Cyclomatic Complexity) – 16.2 * ln(Lines of Code))*100 / 171)
![Page 16: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/16.jpg)
Code Analysis
− My code:− Compiles− Passes Unit Testing− Isn’t Too Complex
− It must be OK then, right?
![Page 17: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/17.jpg)
Code Analysis
![Page 18: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/18.jpg)
Code Profiler
![Page 19: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/19.jpg)
StyleCop
− Ensure Uniform Code Formatting− Improve Code Readbility− Aid Code Readability− Removes Debate Among Team Members− Apply At Check-In− Examples
− Braces {} on a New Line− Use Tabs instead of Spaces− Empty Line Separation Between Methods
![Page 20: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/20.jpg)
Code AnalysisDEMO
![Page 21: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/21.jpg)
Additional Tools & Processes
![Page 22: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/22.jpg)
Check In Policies− Add quality gates to Version Control
− Create your own
![Page 23: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/23.jpg)
Branch Visualizations
View Timeline
Track Changes
against WIs
Visualize Branch
Hierarchy
Branches are a first
class artefact
![Page 24: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/24.jpg)
Automated Builds
• Automate a manual task• Eliminate dependencies on key personnel
Repeatability
• Find errors earlier• Minimise “bad builds”• Improve integration
Quality
• Quickly understand the impact of changes• Understand the “pulse” of the project• Scheduled -> Continuous Integration
Confidence
![Page 25: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/25.jpg)
Did it Build?Did my Tests
Pass?Code Coverage?Code Analysis?
What Code Changed?
Which Features Were Impacted
Which Tests Were
Impacted?
What about Previous Builds?
![Page 26: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/26.jpg)
Testing & Debugging Tools
• Microsoft Test Manager & Team Foundation Server
Test Case Management
• Automatic Data Collection• Fast Forward for Manual Testing
Manual Testing
• Automated Functional Testing
Coded UI Testing
Web Performance Testing
Load Testing
• Post Mortem Debugging
IntelliTrace
![Page 27: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/27.jpg)
Dedicated tool for Testers. Integrated with TFS
![Page 28: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/28.jpg)
Test Cases & Shared Steps are TFS Work
Items
![Page 29: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/29.jpg)
Link Test Cases to other
Work Items (e.g.
requirements)
![Page 30: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/30.jpg)
Define Test Settings - What data we want to
automatically collect when tests are executed
![Page 31: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/31.jpg)
31
Generate TFS Bug Work
Items from Microsoft Test
Runner
![Page 32: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/32.jpg)
32
Give the bug a title – the hard work has been automatically
done
![Page 33: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/33.jpg)
Intellitrace
Every interesting
event is logged
Post mortem debug
![Page 34: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/34.jpg)
34
Walk up and down the call
stack
Debug code executed by
someone else
![Page 35: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/35.jpg)
Prototype with SketchFlow
![Page 36: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/36.jpg)
Understand Existing
Code Assets
![Page 37: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/37.jpg)
Drill in and follow
relationships
![Page 38: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/38.jpg)
Enforce application architectur
e
![Page 39: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/39.jpg)
Database Tools in Visual Studio*
Schema Comparison
Data Comparison
Refactoring
Data Generation
Database Unit Testing
Static Code Analysis
*Visual Studio 2010 Premium/Ultimate
![Page 40: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/40.jpg)
Database Development Schema Comparison & SQL Unit Tests
![Page 41: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/41.jpg)
Database DevelopmentGenerate
Realistic Test Data
![Page 42: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/42.jpg)
Security ToolsMSF Agile + Secure Development Lifecycle Process Template
SDL Threat Modelling Tool
Anti-Cross Site Scripting (Anti-XSS) Libraray
Microsoft Code Analysis Tool .NET (CAT.NET)
BinScope Binary Analyzer
MiniFuzz File Fuzzer
SDL RegEx Fuzzer
Attack Surface Analyzer Beta
http://www.microsoft.com/security/sdl/adopt/tools.aspx
![Page 43: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/43.jpg)
Define
Design
Develop
Test
Release
Maintain
Phases of the Application Lifecycle
![Page 44: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/44.jpg)
Keep in touch
• UK Visual Studio events list:• http://www.microsoft.com/visualstudio/en-gb/visual-studio-even
ts
Future Events
• @ukvs• Feedback and suggestions• Competitions
• [email protected] • Questions and queries including licensing
• http://blogs.msdn.com/ukvsts
Blog
![Page 45: Driving Quality Throughout the Application Lifecycle](https://reader036.vdocuments.mx/reader036/viewer/2022081604/568165dd550346895dd8f76e/html5/thumbnails/45.jpg)