Continuous Inspection with Team Foundation Server

Continuous is a word often heard in Agile and DevOps teams: continuous integration, continuous deployment, continuous delivery, …

All of them are techniques where teams produce software (products) in short cycles, ensuring that they can be reliably put on production at any time.

Kiuwan puts their two cents to facilitate your success, enabling continuous inspection of your code, integrating with the tools already used by your teams.

Team Foundation Server is the Microsoft product that covers the entire application lifecycle management (ALM).

In this article we are going to see, step by step, how to integrate Kiuwan inspections in your software development cycle using Team Foundation Server.

Team Foundation Server Architecture.

TFS has a distributed architecture. Kiuwan Local Analyzer must be installed on each machine where you have a TFS Build Agent.

tfs-kiuwan-integration

Once Kiuwan Local Analyzer is installed, you should try to login with it to check that there are no connectivity issues.

local-analyzer-login

 

Your credentials will be saved in a cipher form for subsequent analysis when they are run from the command line interface as well.
Assuming kiuwan has been installed in c:\, we need to create a small script that will be invoked from the TFS build agent.

Sample Application

The following steps assume that you are using Visual Studio 2013 and Team Foundation Server 2013. Both with ‘on premise’ installations.
From Visual Studio, Help – Samples, you can download the sample application to use.

download-application-sample

Add the application to Source Control

In the Solution Explorer, right clicking on the ‘SimpleCalculator’ solution, you have the option to add this solution to the Source Control System.

add-solution-to-source-control

 

A new dialog appears to choose the Source Control backend. In this case, choose the Team Foundation Version Control.

tfvs-as-source-control

 

Finally, select a TeamProject to place this project and create the solution folder.

choose-an-team-project-and-create-solution-folder

Build definition

Once you have created the solution in TFS, now you can define a new build process for the solution.

Open the ‘Team Explorer’ tab:

team-explorer

 

Double click on ‘Builds’ and select ‘New build definition’:

choose-new-build-definition

 

Here you have captures of the dialog boxes to configure the build definition:

build-definition-general

build-definition-trigger

build-definition-build-defaults

build-definition-build-process

Commit the changes and get the analysis results in Kiuwan

Finally, commit the changes to the repository, and a new build will be automatically triggered.

team-explorer-commit

 

Login to kiuwan.com, and you can see the results for your application analysis.

dashboard

 

For each commit in the repository, a new build and analysis will be run automatically:

team-explorer-build-2

Compare each commit against the previous

Each analysis will generate a new version in Kiuwan. You can see all builds on the ‘Analysis’ combobox:

defects-1

 

And clicking in the ‘Compare’ option, you can get a defects comparison between both analyses:

defects-2

 

Now you have continuous analysis of all your builds in Kiuwan. As you can see the flexibility of Kiuwan to run analysis from the command line is very handy in the case of integrating with countinous integration systems, TFS in this case, and doesn’t require rocket science.

With all your builds analyzed in Kiuwan you can have a continuously improvement process as well. For example creating automatic action plans to solve critical issues found by Kiuwan for your next release and track their progress of execution.

In this world of continuous everything, how could we leave software analysis and improvement behind? Kiuwan is there for you.