Marcel de Vries Microsoft MVP and CTO Xpirit SonarQube Community Very important is to support...

26

Transcript of Marcel de Vries Microsoft MVP and CTO Xpirit SonarQube Community Very important is to support...

Olivier Gaudin, CEO, SonarSourceStuart Kent, Group Program Manager, Microsoft

Using Visual Studio, Team Foundation Server, Visual Studio Online, and SonarQube to Understand and Prevent Technical Debt

3-696

Olivier Gaudin, CEO, SonarSourceStuart Kent, Group Program Manager, Microsoft

Using Visual Studio, Team Foundation Server, Visual Studio Online, and SonarQube to Understand and Prevent Technical Debt

3-696

Problem of Technical DebtSonarQubeIntegration with TFS and .NetWhat’s NextResourcesQuestions

Agenda

S1 S2 S3 S4 S5 S6 S7 S8 S9 S10 S11 S12

-50

-40

-30

-20

-10

0

10

20

Debt = effort required to cleanup or refactor code Interest/repayment = extra time spent on implementing feature or payment of debt

Productive time spent on implementing features

Technical Debt

• Duplications• Bad distribution of complexity• Spaghetti Design• Lack of unit tests• No coding standards• Potential bugs• Not enough or too many comments

The deadly sins of the developer

• Too late• Pushback from teams• Lack of ownership• Heterogeneous requirements• Quality gate

This is hard!

• Development team owns quality• Shorter feedback loop• Unified quality gate• Cost is non-significant• This is fun!

Changing the Game

• 50K+ live instances• 56% of Java developers use it daily*• 110K+ downloads per year• 20+ languages covered• 60+ plugins in the open source forge

In Numbers

*According to 2014 survey by RebelLabs

SonarQube hasn’t worked well with .Net…

Marcel de VriesMicrosoft MVP and CTO Xpirit

Both Microsoft and SonarSource have received similar messages from many customers

SonarQube Community

Very important is to support SonarQube tooling for .NET. SonarQube has become the defacto standard of providing code quality stats for your product and this is heavily used in the Java space. In enterprises this is also used for .NET projects, but the metrics don't match the VS tooling metrics.

You guys do not get it because you think Java. You definitely need to hire C# developers!

Stilloverwhelmingoverwhelming

Be actionable in controlling and remediating technical debt

Code Quality Data

Code Analysis Issues

Code Metrics, Clones, Coverage

Architectural insights

ALM insightsApplication insights

Quality Profile

Filtered Code

Quality Data

Define the quality lensChoose rules and data relevant to your team

Remediation

Policy

Baseline

DefineRemediation policy- Don’t make it worse- Clean-up as you go

Issues to focus on

Define a baseline- Last commit- Specific version

Quality Gates

Define acceptablethresholds

Prevent &Remediate

Understand

Control

ALM Workflow

Measure

IDE

Web based experience

TFSVSO

VSBuild

Source ControlWork Items

/ TFS

Technical Debt Dashboard

Technical Debt DataMart

TFS/.Net Integration – IssuesFragile - Duplicates MSBuild configuration in

manually edited files- Tries to externally replicate complex

MSBuild processingNot Integrated

- No integration with build in TFS/VSO- Results from new Roslyn-based

analysers not uploaded- SonarQube analysers don’t run in Visual

StudioInconsistent

- Metrics calculated in Visual Studio are different to the ones calculated by SonarQube

Fixed

todo

todo

Demo – Integration of SonarQube with Microsoft ALM and .Net

TFS/.Net Integration – Approach

SonarQube

Build Agent

File Store

Pre-Build+ Fetch configuration

from SonarQube server

MSBuild+ Collect project info

Test

Post-Test+ Detect code clones+ Perform additional

code analysis (e.g. Javascript)

+ Calculate metrics

Quality ProfileQuality Gates

Tech Debt Data

Code Coverage

Data

Analysis DataSolution & Project

Data

Prevent &Remediate

Understand

Control

What’s Next?

Measure

IDE

Web based experience

TFSVSO

VSBuild

Source ControlWork Items

/ TFS

Technical Debt Dashboard

Technical Debt DataMart

• Tasks for new TFS/VSO build• Cloud build pre-configured with SonarQube analysis• Send data from new Roslyn-based code analysers• Sending data from Java builds• Integration of SQ runner for msbuild with other CI

systems

• Continuous update of .Net code analyzers

• Baseline support in IDE• Align SonarQube metrics

with those calculated in VS

SonarQube post-testSend analysis data to SonarQube

Lan C.Contoso / Contoso Web.

https://contoso-w3.visualstudio.com/DefaultCol

SonarQube pre-buildPrep build for SonarQube analysis

Problem of Technical DebtSonarQubeIntegration with TFS and .NetWhat’s NextResourcesQuestions

Summary

Prevent &Remediate

Understand

Control Measure

IDE

Web based experience

TFSVSO

VSBuild

Source ControlWork Items

/ TFS

Technical Debt Dashboard

Technical Debt DataMart

This is ready to use nowhttp://aka.ms/sonarqubeintegration has all the details

Resources

© 2015 SonarSource SA. All rights reserved.

© 2015 Microsoft Corporation. All rights reserved.