Continuous Integration in .NET
eBook - ePub

Continuous Integration in .NET

  1. 328 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Continuous Integration in .NET

About this book

Continuous integration is a software engineering process designed to minimize "integration hell." It's a coordinated development approach that blends the best practices in software delivery. For.NET developers, especially, adopting these new approaches and the tools that support them can require rethinking the development process altogether. Continuous Integration in.NET is a tutorial for developers and team leads that teaches readers how to re-imagine their development strategy by creating a consistent continuous integration process. This book shows how to build on the tools they already know -.NET Framework and Visual Studio - and to use powerful software like MSBuild, Subversion, TFS 2010, Team City, CruiseControl.NET, NUnit, and Selenium. Purchase of the print book comes with an offer of a free PDF, ePub, and Kindle eBook from Manning. Also available is all code from the book.

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Continuous Integration in .NET by Craig Berntson,Marcin Kawalerowicz in PDF and/or ePUB format, as well as other popular books in Computer Science & Microsoft Programming. We have over one million books available in our catalogue for you to explore.

Information

Part 1. Make it happen

A technically savvy programmer and project manager once asked how we’d describe continuous integration (CI) to someone who had never heard of it. We said there are two types of answers, and which one to give depends on how much time the listener has. The longer answer starts with part 1 of the book. The shorter one is not really an answer—it’s another question that can give you an idea about what CI is. Do you remember the last time you released software? That’s the time in the project when you gather all the bits and pieces required to deliver the software to the customer. Was it painful? Yes? Well, that’s where CI can come to the rescue.
In the first part of this book (chapters 1 through 6), we’ll lay the groundwork for a well-designed CI process in .NET. You’ll learn the basics required for any CI system. We’ll start by looking at CI in general. We’ll define the term and talk a little about how to do CI in .NET. After that, we’ll introduce the source control system as part of the CI tool chain that can’t be omitted. We’ll help you choose the right one and introduce it into your day-to-day work.
As a second ingredient that’s required for CI, we’ll describe build automation. We’ll show why you need a single command-build process and how modern XML-based build systems are perfect for the .NET CI process. You’ll also find out how to choose the right CI server to bind all the ingredients into one.
We’ll then look at unit testing—what it is and how to use it in CI. You’ll learn to write unit tests and automate their execution. We’ll discuss CI servers and their ability to give immediate feedback about the state of the build process. It’s a core concept of the CI process that every degradation in code quality should be immediately visible, so the team can react as swiftly as possible to make obstacles disappear. This is the purpose of controlling and reporting mechanisms in modern CI servers. We’ll look at how you can extend these reporting capabilities with your software.
After reading this part of the book, you’ll be able to set up your own CI process using free or inexpensive software. You’ll understand what the CI process is and how to use it to your team’s benefit. And you’ll be ready to extend CI to better suit your needs.

Chapter 1. Understanding continuous integration

This chapter covers
  • Continuous integration theory
  • A Hello World CI example
  • A preliminary list of CI tools
As developers, we’re interested in creating the best possible applications for our customers with the least amount of work. But with applications becoming more complex and having more moving parts, creating great applications is getting harder, even with advances in tools such as Visual Studio and the .NET Framework.
One of the keys to improving applications and productivity is to automate some of the work. Continuous integration (CI) is one of the best ways to do this.
Have you ever written code that did its small task perfectly, but then discovered unexpected side effects when you integrated that piece of code with the rest of the application? Do you always have success integrating your code with code from other developers? Have you ever shipped an application, only to find that it didn’t work for the customer but you couldn’t duplicate the error? Can you always predictably measure the state of the code for your current project? CI helps alleviate these problems and more.
In this chapter, you’ll learn what CI is all about, why should you use it, and how to overcome objections to its adoption from your team. We’ll briefly introduce you to several free or low-cost tools such as CruiseControl.NET, Subversion, MSBuild, Team Foundation Server, and TeamCity that are part of a complete CI process. Throughout the rest of the book, we’ll explain in detail how to use these tools.
This chapter also demonstrates a simple CI process through an example using batch files. We’ll also get started on a more complex Visual Studio Solution that we’ll use to demonstrate various CI tools and techniques. But before we do any of that, you need to understand exactly what CI is.

1.1. What does it mean to integrate continuously?

When you adopt CI, it’s likely that you’ll make major changes in your development processes because you’ll move from a manual system to an almost completely automated system. Along the way, you may meet resistance from your team members. This section provides you with reasons to use CI and how to overcome objections. But before we take you there, we need to define CI.

1.1.1. Defining continuous integration

One of the best definitions of continuous integration comes from Martin Fowler (www.martinfowler.com/articles/continuousIntegration.html):
Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily—leading to multiple integrations per day. Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible. Many teams find that this approach leads to significantly reduced integration problems and allows a team to develop cohesive software more rapidly.
This definition contains an important phrase: “multiple integrations per day.” This means that several times each day, the CI system should build and test the application. But multiple integrations per day isn’t where you begin your journey into CI; we recommend against this because many shops not using CI will meet enough resistance just automating the build, let alone doing multiple builds per day. (We’ll talk more about overcoming team resistance later in this chapter.) Ideally, you should set up your CI process just as you create software: by taking small steps, one at a time.
Here is another definition:
CI is the embodiment of tactics that gives us, as software developers, the ability to make changes in our code, knowing that if we break software, we’ll receive immediate feedback ... [It is] the centerpiece of software development, as it ensures the health of software through running a build with every change.
Paul Duval, Continuous Integration
(Addison-Wesley, 2007)
The key phrase here is “the centerpiece of software development.” This means whatever development process and methodology you use, CI is a key part of it.
Our definition is similar to those we’ve mentioned. Here’s how we define continuous integration:
An automated process that builds, tests, analyzes, and deploys an application to help ensure that it functions correctly, follows best practices, and is deployable. This process runs with each source-code change and provides immediate feedback to the development team.
As we were discussing this definition, we wondered what a build is. Is it the same as clicking Build on the Visual Studio menu, or something more? We finally decided that the definition varies depending on what you’re doing. Early in the development process, a build can be as simple as compiling and unit testing the code. As you get closer to release, a build includes additional and more complete testing and running code metrics and analysis. You can also go as far as combining all the different files into an install set and making sure it works correctly.
Fin...

Table of contents

  1. Copyright
  2. Dedication
  3. Brief Table of Contents
  4. Table of Contents
  5. Preface
  6. Acknowledgments
  7. About this Book
  8. About the Authors
  9. About the Cover Illustration
  10. Part 1. Make it happen
  11. Chapter 1. Understanding continuous integration
  12. Chapter 2. Setting up a source control system
  13. Chapter 3. Automating the build process
  14. Chapter 4. Choosing the right CI server
  15. Chapter 5. Continuous feedback
  16. Chapter 6. Unit testing continuously integrated code
  17. Part 2. Extend it
  18. Chapter 7. Performing integration, system, and acceptance testing
  19. Chapter 8. Analyzing the code
  20. Part 3. Smooth and polish it
  21. Chapter 9. Generating documentation
  22. Chapter 10. Deployment and delivery
  23. Chapter 11. Continuous database integration
  24. Chapter 12. Extending continuous integration
  25. Index
  26. List of Figures
  27. List of Tables
  28. List of Listings