450 likes | 640 Views
27 th June 2011. Driving Quality Throughout the Application Lifecycle . Richard Erwin Developer Tools Specialist Microsoft UK. Phases of the Application Lifecycle. Test. Develop. Cost of Bugs. Cost / £. Development. Testing. UAT. Released. Lifecycle stage.
E N D
27th June 2011 Driving Quality Throughout the Application Lifecycle Richard Erwin Developer Tools Specialist Microsoft UK
Phases of the Application Lifecycle • Test • Develop
Cost of Bugs Cost / £ Development Testing UAT Released Lifecycle stage
Application Lifecycle Tooling Eclipse Developer Visual Studio Developer Business Analyst Tech Writer on Mac OS X Tester • DevProcess Support • Version Control • Automated Build • Test Case Management • Reporting C++ developer on Linux Team Foundation Server
Code Quality Tooling Unit Testing Code Analysis Code Coverage Code Metrics Unit Testing & TDD Static Code Analysis Test Impact Analysis Pex Code Profiling Style Cop Process Other Tools Automated Build Check-In Policies Security Tools Test Tools Reporting Shelving Database Tools Architecture Tools Free Pro Premium Ultimate TFS
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
Test Driven Development • Grown out of eXtremeProgramming • Write Test before Implementation • Improve Code Coverage • Can help With Implementation Design • Catch Defects Early
PEX • Automatically generate test suites with high code coverage. • Visual Studio add-in for testing .NET Framework applications • Moles - Isolation framework for .NET
Code Coverage • How much unit testing should you do? • How much of the code is being tested?
DEMO Unit Testing
Code Metrics • Is the Code Maintainable? • Where are Defects Likely to be Found? • Where Should I Concentrate my Efforts?
Maintainability Index MAX(0,(171 - 5.2 * ln(Halstead Volume) 0.23 * (Cyclomatic Complexity) – 16.2 * ln(Lines of Code))*100 / 171) 0 – 9 Low Maintainability 10 – 19 Moderately Maintainable 20-100 Good Maintainability
Code Analysis • My code: • Compiles • Passes Unit Testing • Isn’t Too Complex • It must be OK then, right?
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
DEMO Code Analysis
Check In Policies • Add quality gates to Version Control • Create your own
Branch Visualizations Branches are a first class artefact Visualize Branch Hierarchy Track Changes against WIs View Timeline
What about Previous Builds? Did it Build? Did my Tests Pass? Code Coverage? Code Analysis? What Code Changed? Which Features Were Impacted Which Tests Were Impacted?
Define Test Settings - What data we want to automatically collect when tests are executed
Give the bug a title – the hard work has been automatically done
Intellitrace Post mortem debug Every interesting event is logged
Walk up and down the call stack Debug code executed by someone else
Database Tools in Visual Studio* *Visual Studio 2010 Premium/Ultimate
Schema Comparison & SQL Unit Tests Database Development
Database Development Generate Realistic Test Data
Security Tools http://www.microsoft.com/security/sdl/adopt/tools.aspx