Wednesday 1 August 2012

Book Review: Continuous Integration in .Net

Searching on Amazon for the phrase continuous integration (CI) you’ll get over 2000 results but looking at them you’ll find very few books actually on the subject.

This book has a unique slant in that it focus’ on the the .Net world and how you can introduce CI into your development practices and once implemented build upon that foundation to extend the functionality of your build server.

The authors have structured the book to take a CI novice from installing a CI server through to automating deployment or as Paul Stack describes in his talks how to climb the CI ladder.

Part 1: Getting started

In the first part of the book the authors introduce you to the concepts behind continuous integration explaining why you would want to introduce this practice.

Before getting to CI servers the authors spend a couple of chapters discussing the idea behind CI, the importance of source control in relation to the whole process and how you automate the build process using MS Build.

The next chapter goes on to talk about CI servers and introduces the 3 CI servers that are discussed throughout the book: Cruise Control.Net, Team City and Team Foundation Server. At each stage of CI described in the book the authors show how to implement the various techniques discussed in all 3 of the servers.

Next the importance of feedback that the CI server gives you is discussed, including the various forms of feedback - build notifications via email/RSS, external devices, etc.

The final chapter in this part introduces you to unit testing, firstly explaining what unit testing is and a brief introduction on how to do it before then talking about how you can integrate it into your build process.

Part 2: Extend it

The second part of the book is all about extending your build process.

This part has 2 chapters the first provides details on how to perform integration, system and acceptance testing by configuring the various CI servers to be able to utilise tools to run the various tests from NUnit for unit tests through to FitNesse for acceptance testing.

The second chapter of this part discusses analysing your codebase using FxCop and StyleCop to help you improve the code including storing reports generated by both tools to allow you to monitor how the codebase is improving over time and not deteriorating. There are also details on using NDepend (which I’ve blogged about before) which provides a report that you can store including a lot of key metrics that will show you where to focus any improvements you may wish to make.

Part 3: Smooth and polish it

The third part of the book is devoted to truly extend the functionality of the CI server beyond simply building and testing your code.

Generating documentation from xml comments using Sandcastle is the first chapter of this part enabling development documentation to be updated as part of the build process ensuring that they are always up to date.

Deployment and deliver of the applications are covered next showing you how add a visual studio deployment project and creating a Wix installer for windows based applications.  If you are creating web applications details are provided on how to use MS Deploy to enable automatic deployment of the site upon successful build.

Database deployment is then covered, firstly the authors cover generation of SQL scripts through Sql Server Management Studio and how to run these from the command line but then going on to show how you can use RoundHousE to automate this as part of the process when you aren’t using TFS as your build server.  For people using TFS the authors also cover Visual Studio Database projects as a way to be able to work with your database as well as deploying using this type of project.

The final chapter is all about your CI process and provides advice on dealing with slow builds, how to scale your CI and measuring the maturity of your CI process.

Summary

At the beginning of the book it clearly states that the book is intended for a reader that wants to “dive into” CI and that it is not really for experienced CI practitioners or build masters and I would have to agree with this, if you have been practicing CI and already have automated builds (or even better building and testing) it is only the last few chapters of the book that may contain anything new to you.

Also there are some oddities in the book, such as explaining how to use source control and what unit testing is and how to do it, which I think would have been better covered by being included as an appendix rather than an actual chapter.  To my mind it would have been better to keep the main part of the book focussed on CI rather than attempt to give the reader a very brief introduction to the other subjects.

For a newcomer to CI in the .Net world I would recommend you read this book as it will provide you with information and guidance to help you get your CI process in place.


No comments:

Post a Comment