Published May 12, 2017
WRITTEN BY MARCOS CACABELOS
Senior Software Developer and Product Manager. Functional & technical design, development and product management for Kiuwan.
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.
Once Kiuwan Local Analyzer is installed, you should try to login with it to check that there are no connectivity issues.
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.
:: script to launch kiuwan analysis from team foundation server build.
%KIUWAN% -c -n "%TF_BUILD_BUILDDEFINITIONNAME%" -l "%TF_BUILD_BUILDNUMBER%" -s "%TF_BUILD_SOURCESDIRECTORY%"
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.
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.
A new dialog appears to choose the Source Control backend. In this case, choose the Team Foundation Version Control.
Finally, select a TeamProject to place this project and create the solution folder.
Once you have created the solution in TFS, now you can define a new build process for the solution.
Open the ‘Team Explorer’ tab:
Double click on ‘Builds’ and select ‘New build definition’:
Here you have captures of the dialog boxes to configure the build definition:
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.
Login to kiuwan.com, and you can see the results for your application analysis.
For each commit in the repository, a new build and analysis will be run automatically:
Compare each commit against the previous
Each analysis will generate a new version in Kiuwan. You can see all builds on the ‘Analysis’ combobox:
And clicking in the ‘Compare’ option, you can get a defects comparison between both analyses:
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.