about this book

Continuous integration is what it is, regardless of whether it’s done in .NET or some other technology. It’s a set of best practices aimed at easing the integration pains that arise during the course of a software project. .NET has its own set of tools to make CI happen, but the basic rules stay the same: use a source-control system, build by issuing one command, test, analyze, and deploy. Be ready.

Who should read this book?

This book is for developers who want to dive into state-of-the-art CI techniques. It provides simple guidance on how to create a full CI process with minimal effort and cost. The book wasn’t written for experienced build masters and old-time CI practitioners, but we hope they will find some gems of knowledge as well.

Roadmap

The book is divided into three parts:

Marcin wrote chapters 2 through 10. Craig contributed chapters 1, 11, and 12.

Chapter 1 lays the foundation. It describes the CI process and gives you advice about how to introduce it to your company. We’ll show a simple way to set up a CI process using a CMD file.

Chapter 2 describes the sine qua non for CI: a source-control system. You’ll learn what the code repository is and how to use it. We’ll help you choose the right tool for your needs. We’ll describe Subversion and TFS source control as examples of source-control systems that are ready to be used in CI.

Chapter 3 goes deep into build automation. We’ll describe how to set up a system that lets you build an entire project using one command. We’ll present MSBuild as our tool of choice.

In chapter 4, we’ll help you choose a CI server. We’ll describe how to install and set up CruiseControl.NET, TFS in its basic configuration, and JetBrains TeamCity.

In chapter 5, we’ll examine the responsiveness of CI servers. We’ll look at the feedback mechanisms available in these systems, including web-based reports, system tray notifications, email, and SMS notifications. At the end, you’ll use a USB LED toy to get immediate feedback from your system.

Chapter 6 describes unit testing and how it’s a characteristic of the CI process. You’ll use NUnit and MSTest to build a simple test suite, and you’ll integrate the test results with the CI server. We’ll examine test coverage and sending reports as feedback to developers. You’ll learn how to mock some of the tests and how doing so affects the CI process.

In chapter 7, we’ll extend your test repertoire with integration, system, functional, and acceptance tests. You’ll use various frameworks to test various technologies: White to test Windows Forms and Silverlight, Selenium to test Web Forms, and FitNesse to establish user-acceptance testing. You’ll learn if and when it’s OK to introduce these kinds of tests to the CI process.

Chapter 8 describes how to perform static code analysis. You’ll analyze precompiled .NET intermediate language using FxCop. We’ll show how to use StyleCop to analyze C# code even before it’s precompiled. And we’ll explain how to use NDepend to do additional analysis. We’ll provide information about how to extend and integrate this analysis with CI.

Chapter 9 describes XML comment notation and how to generate MSDN-style documentation from it. We’ll show you how to generate documentation continuously.

Chapter 10 deals with deployment and delivery, including using Visual Studio to create setup files, and using WiX and MS Deploy. We’ll show you how to use these techniques on the CI server.

Chapter 11 deals with continuous database integration. We’ll show you how to maintain a database using Visual Studio and how to perform tests at the database level.

Chapter 12 is about extending CI. We’ll explain how to deal with slow builds, how to scale the CI process, and how to check the maturity of the CI process you’re using.

Code conventions and downloads

All source code in listings or in text is in a fixed-width font like this to separate it from ordinary text. Code annotations accompany many of the listings, highlighting important concepts. In some cases, numbered bullets link to explanations that follow the listing.

This book includes a fair amount of source code that is available for download. The source code illustrates the techniques described in the book. It is not production code. We provide many configuration files, especially for CruiseControl.NET. You can access the source code from the publisher’s website at www.manning.com/ContinuousIntegrationin.NET.

Author Online

Purchase of Continuous Integration in .NET includes free access to a private web forum run by Manning Publications where you can make comments about the book, ask technical questions, and receive help from the authors and from other users. To access the forum and subscribe to it, point your web browser to www.manning.com/ContinuousIntegrationin.NET. This page provides information on how to get on the forum once you are registered, what kind of help is available, and the rules of conduct on the forum.

Manning’s commitment to our readers is to provide a venue where a meaningful dialog between individual readers and between readers and the authors can take place. It is not a commitment to any specific amount of participation on the part of the authors, whose contribution to the book’s forum remains voluntary (and unpaid). We suggest you try asking them some challenging questions lest their interest stray!

The Author Online forum and the archives of previous discussions will be accessible from the publisher’s website as long as the book is in print.