| By Donald King | Article Rating: |
|
| November 12, 2005 05:15 PM EST | Reads: |
42,699 |
What Is a Successful Build?
It is worth noting again that a successful build is not just compilation and linkage of the source code without errors; it is also the successful execution, without failure, of unit tests. Let's try an exercise with the BaseRobot class where we make a modification to the source that while successfully compiles, actually breaks the build (source code for this article is available by viewing source.html). Our BaseRobot has the ability to turn left and right and to move forward, and nothing more. Let's provide it with the ability to move backwards as well.
Following the tenets of Test Driven Development (TDD), we need to write our test first. It will go in the BaseRobotTest class and look something like this:
When we compile the solution it fails because we have not yet implemented the MoveBackward() method. Our next step is to write code that will pass compilation:
[Test]
public void TestMoveBackward()
{
Robot.MoveBackward();
Assert.AreEqual(Robot.XCoordinate, 0);
Assert.AreEqual(Robot.YCoordinate, -1);
Robot.TurnLeft();
Robot.MoveBackward();
Assert.AreEqual(Robot.XCoordinate, 1);
Assert.AreEqual(Robot.YCoordinate, -1);
Robot.TurnLeft();
Robot.MoveBackward();
Assert.AreEqual(Robot.XCoordinate, 1);
Assert.AreEqual(Robot.YCoordinate, 0);
Robot.TurnLeft();
Robot.MoveBackward();
Assert.AreEqual(Robot.XCoordinate, 0);
Assert.AreEqual(Robot.YCoordinate, 0);
}
The last step is to write the code that will make the test pass:
public void MoveBackward()
{
}
public void MoveBackward()
{
switch(_Direction)
{
case DIRECTION.North:
_YCoordinate++;
break;
case DIRECTION.East:
_XCoordinate++;
break;
case DIRECTION.South:
_YCoordinate--;
break;
default:
_XCoordinate--;
break;
}
}
The continuous integration server has done its job! Since I received instant feedback I not only know I was the developer who broke the build, but I also know what changed and can more easily find the issue in order to correct it. Here is the new implementation that compiles and passes the unit testing:
This time I ran the tests to ensure they passed before checking in my source files. Now when I check in the source, CruiseControl.NET reports a successful build! (Note: TDD is a very in-depth subject and this article cannot possibly do it justice. A great resource on the subject is the book Test Driven Development in Microsoft.NET by James W. Newkirk and Alexei A. Vorontsov, available from Microsoft Press.)
public void MoveBackward()
{
switch(_Direction)
{
case DIRECTION.North:
_YCoordinate--;
break;
case DIRECTION.East:
_XCoordinate--;
break;
case DIRECTION.South:
_YCoordinate++;
break;
default:
_XCoordinate++;
break;
}
}
Summary
One last thing to mention is the CruiseControl.NET monitor that runs on the desktop as a Windows tray icon. It can be pointed to the build server and provides instant feedback to team members about the result of a build or the state of the server itself. Hopefully this article has given you the basics for getting started with your own continuous integration process quickly and easily. Once you start and maintain a continuous integration development environment, you will wonder how you used to develop without one.
Published November 12, 2005 Reads 42,699
Copyright © 2005 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Donald King
Donald King is the founder of Webforge Software, a Web-applications development and consulting firm located in Topeka, Kansas. Don has extensive experience in object-oriented technologies and Web-based application development.
![]() |
Rick 12/12/05 05:25:42 PM EST | |||
Too topical... where's the beef? |
||||
![]() |
.NET News Desk 11/12/05 06:19:27 PM EST | |||
Automatic Integration with CruiseControl.NET, NAnt, and NUnit. One of the most important and yet overlooked aspects of a software development project is the concept of regression testing during implementation. Regression testing is the practice of running tests for previously tested code following modification to ensure that faults have not been introduced or uncovered as a result of the changes made. In this article I will outline the need for continuous integration, automated builds, and testing, which support the tenets of regression testing and provide automation for the process. I will also introduce some of the free open source tools that can be used to effectively employ a continuous integration process, and we'll take a look at a scenario that demonstrates their use. |
||||
![]() |
.NET News Desk 11/12/05 06:19:13 PM EST | |||
Automatic Integration with CruiseControl.NET, NAnt, and NUnit. One of the most important and yet overlooked aspects of a software development project is the concept of regression testing during implementation. Regression testing is the practice of running tests for previously tested code following modification to ensure that faults have not been introduced or uncovered as a result of the changes made. In this article I will outline the need for continuous integration, automated builds, and testing, which support the tenets of regression testing and provide automation for the process. I will also introduce some of the free open source tools that can be used to effectively employ a continuous integration process, and we'll take a look at a scenario that demonstrates their use. |
||||
![]() |
SYS-CON Australia News Desk 11/12/05 06:05:16 PM EST | |||
Automatic Integration with CruiseControl.NET, NAnt, and NUnit. One of the most important and yet overlooked aspects of a software development project is the concept of regression testing during implementation. Regression testing is the practice of running tests for previously tested code following modification to ensure that faults have not been introduced or uncovered as a result of the changes made. In this article I will outline the need for continuous integration, automated builds, and testing, which support the tenets of regression testing and provide automation for the process. I will also introduce some of the free open source tools that can be used to effectively employ a continuous integration process, and we'll take a look at a scenario that demonstrates their use. |
||||
![]() |
.NET News Desk 11/12/05 05:51:11 PM EST | |||
Automatic Integration with CruiseControl.NET, NAnt, and NUnit. One of the most important and yet overlooked aspects of a software development project is the concept of regression testing during implementation. Regression testing is the practice of running tests for previously tested code following modification to ensure that faults have not been introduced or uncovered as a result of the changes made. In this article I will outline the need for continuous integration, automated builds, and testing, which support the tenets of regression testing and provide automation for the process. I will also introduce some of the free open source tools that can be used to effectively employ a continuous integration process, and we'll take a look at a scenario that demonstrates their use. |
||||
- Kindle 2 vs Nook
- Confessions of a Ulitzer Addict
- IBM Hardware Chief, Intel VC Exec Arrested in Insider Trading Scam
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Infrastructure-as-a-Service Will Mature in 2010: Microsoft's David Chou
- Windows 7 – Microsoft’s First Step to the Cloud
- Cloud Expo and the End of Tech Recession
- Jill Tummler Singer, Deputy CIO of CIA, Keynotes at GovIT Expo
- Reality Check at the Cloud Computing Expo
- Visual Studio 2010 Is Cloud Friendly
- Fired SCO CEO Fires Back
- Kindle 2 vs Nook
- The Difference Between Web Hosting and Cloud Computing
- Ajax in RichFaces 3.3, JSF 2 and RichFaces 4
- Confessions of a Ulitzer Addict
- Wave on Ulitzer: Confessions of a Google Wave Fanboy
- IBM Hardware Chief, Intel VC Exec Arrested in Insider Trading Scam
- Cloud Computing Best Practices
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Infrastructure-as-a-Service Will Mature in 2010: Microsoft's David Chou
- Eval JavaScript in a Global Context
- Windows 7 – Microsoft’s First Step to the Cloud
- Google Maps and ASP.NET
- Crystal Reports XI & How It Has Changed
- Converting VB6 to VB.NET, Part I
- Creating Controls for.NET Compact Framework in Visual Studio 2005
- Where Are RIA Technologies Headed in 2008?
- How to Write High-Performance C# Code
- AJAX World RIA Conference & Expo Kicks Off in New York City
- Implementing Tab Navigation with ASP.NET 2.0
- i-Technology Photo Exclusive: Bill Gates & Steve Jobs In "Nerds"
- .NET Archives: Getting Reacquainted with the Father of C#
- i-Technology Viewpoint: "SOA Sucks"
- Programmatically Posting Data to ASP .NET Web Applications




























