driving quality throughout the application lifecycle

45
Richard Erwin Developer Tools Specialist Microsoft UK 27 th June 2011 Driving Quality Throughout the Application Lifecycle

Upload: gerard

Post on 24-Feb-2016

36 views

Category:

Documents


2 download

DESCRIPTION

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. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Driving Quality Throughout the Application Lifecycle

Richard ErwinDeveloper Tools SpecialistMicrosoft UK

27th June 2011

Driving Quality Throughout the Application Lifecycle

Page 2: Driving Quality Throughout the Application Lifecycle

Define

Design

Develop

Test

Release

Maintain

Phases of the Application Lifecycle

Test

Develop

Page 3: Driving Quality Throughout the Application Lifecycle

Cost of BugsCo

st /

£

Lifecycle stageDevelopment Testing UAT Released

Page 4: Driving Quality Throughout the Application Lifecycle

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

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

Unit Testing

Page 7: Driving Quality Throughout the Application Lifecycle

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

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

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

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

Unit TestingDEMO

Page 12: Driving Quality Throughout the Application Lifecycle

Code Analysis

Page 13: Driving Quality Throughout the Application Lifecycle

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

Code Metrics

Maintainability Index

Cyclomatic Complexity

Depth of Inheritance

Class Coupling

Lines of Executable

Code

Page 15: Driving Quality Throughout the Application Lifecycle

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

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

Code Analysis

Page 18: Driving Quality Throughout the Application Lifecycle

Code Profiler

Page 19: Driving Quality Throughout the Application Lifecycle

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

Code AnalysisDEMO

Page 21: Driving Quality Throughout the Application Lifecycle

Additional Tools & Processes

Page 22: Driving Quality Throughout the Application Lifecycle

Check In Policies− Add quality gates to Version Control

− Create your own

Page 23: Driving Quality Throughout the Application Lifecycle

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

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

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

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

Dedicated tool for Testers. Integrated with TFS

Page 28: Driving Quality Throughout the Application Lifecycle

Test Cases & Shared Steps are TFS Work

Items

Page 29: Driving Quality Throughout the Application Lifecycle

Link Test Cases to other

Work Items (e.g.

requirements)

Page 30: Driving Quality Throughout the Application Lifecycle

Define Test Settings - What data we want to

automatically collect when tests are executed

Page 31: Driving Quality Throughout the Application Lifecycle

31

Generate TFS Bug Work

Items from Microsoft Test

Runner

Page 32: Driving Quality Throughout the Application Lifecycle

32

Give the bug a title – the hard work has been automatically

done

Page 33: Driving Quality Throughout the Application Lifecycle

Intellitrace

Every interesting

event is logged

Post mortem debug

Page 34: Driving Quality Throughout the Application Lifecycle

34

Walk up and down the call

stack

Debug code executed by

someone else

Page 35: Driving Quality Throughout the Application Lifecycle

Prototype with SketchFlow

Page 36: Driving Quality Throughout the Application Lifecycle

Understand Existing

Code Assets

Page 37: Driving Quality Throughout the Application Lifecycle

Drill in and follow

relationships

Page 38: Driving Quality Throughout the Application Lifecycle

Enforce application architectur

e

Page 39: Driving Quality Throughout the Application Lifecycle

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

Database Development Schema Comparison & SQL Unit Tests

Page 41: Driving Quality Throughout the Application Lifecycle

Database DevelopmentGenerate

Realistic Test Data

Page 42: Driving Quality Throughout the Application Lifecycle

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

Define

Design

Develop

Test

Release

Maintain

Phases of the Application Lifecycle

Page 44: Driving Quality Throughout the Application Lifecycle

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

Twitter

[email protected] • Questions and queries including licensing

Email

• http://blogs.msdn.com/ukvsts

Blog

Page 45: Driving Quality Throughout the Application Lifecycle