Now that I have the Build failing because of a genuine bug and not just because of a test framework failure, lets see if we can trace through to finding why the first test in our new application failed. Lets look at the build and see if we can see why there is a red cross on it.
First, lets open that build list. On Team Explorer Expand your Team Project Collection | Team Project and then Builds. Double click the offending build.

Figure: Opening the Build list is a key way to see what the current state of your software is.

Figure: A test is failing, but we can now view the Test Results to find the problem
Figure: You can quite clearly see that the test has failed with “The device is not ready”.
To me the “The Device is not ready” smacks of a System.IO exception, but it passed on my local computer, so why not on the build server?
Its a FaultException so it is most likely coming from the Service and not the client, so lets take a look at the client method that the test is calling:
bool IProfileService.SaveDefaultProjectFile(string strComputerName)
{
ProjectFile file = new ProjectFile()
{
ProjectFileName = strComputerName + "_" + System.DateTime.Now.ToString("yyyyMMddhhmmsss") + ".xml",
ConnectionString = "persist security info=False; pooling=False; data source=(local); application name=SSW.SQLDeploy.vshost.exe; integrated security=SSPI; initial catalog=SSWSQLDeployNorthwindSample",
DateCreated = System.DateTime.Now,
DateUpdated = System.DateTime.Now,
FolderPath = @"C:Program FilesSSW SQL DeploySampleData",
IsComplete=false,
Version = "1.3",
NewDatabase = true,
TimeOut = 5,
TurnOnMSDE = false,
Mode="AutomaticMode"
};
string strFolderPath = "D:"; //LocalSettings.ProjectFileBasePath;
string strFileName = strFolderPath + file.ProjectFileName;
try
{
using (FileStream fs = new FileStream(strFileName, FileMode.Create))
{
DataContractSerializer serializer = new DataContractSerializer(typeof(ProjectFile));
using (XmlDictionaryWriter writer = XmlDictionaryWriter.CreateTextWriter(fs))
{
serializer.WriteObject(writer, file);
}
}
}
catch (Exception ex)
{
//TODO: Log the exception
throw ex;
return false;
}
return true;
}
Figure: You can see on lines 9 and 18 that there are calls being made to specific folders and disks.
What is wrong with this code? What assumptions mistakes could the developer have made to make this look OK:
- That every install would be to “C:Program FilesSSW SQL Deploy”
- That every computer would have a “D:”
- That checking in code at 6pm because the had to go home was a good idea.
lets solve each of these problems:
- We are in a web service… lets store data within the web root. So we can call “Server.MapPath(“~/App_Data/SSW SQL DeploySampleData”) instead.
- Never reference an explicit path. If you need some storage for your application use IsolatedStorage.
- Shelve your code instead.
What else could have been done?
- Code review before check-in – The developer should have shelved their code and asked another dev to look at it.
- Use Defensive programming – Make sure that any code that has the possibility of failing has checks.
Any more options?
Let me know and I will add them.
What do we do?
The correct things to do is to add a Bug to the backlog, but as this is probably going to be fixed in sprint, I will add it directly to the sprint backlog.
-
Right click on the failing test Select “Create Work Item | Bug”

Figure: Create an associated bug to add to the backlog.
-
Set the values for the Bug making sure that it goes into the right sprint and Area. Make your steps to reproduce as explicit as possible, but “See test” is valid under these circumstances.

Figure: Add it to the correct Area and set the Iteration to the Area name or the Sprint if you think it will be fixed in Sprint and make sure you bring it up at the next Scrum Meeting.
Note: make sure you leave the “Assigned To” field blank as in Scrum team members sign up for work, you do not give it to them. The developer who broke the test will most likely either sign up for the bug, or say that they are stuck and need help.
Note: Visual Studio has taken care of associating the failing test with the Bug. -
Save…
Need Help?

SSW was the first company in the world outside of Microsoft to deploy Visual Studio 2010 Team Foundation Server to production, not once , but twice .
Team Foundation Server
SSW provides expert Visual Studio ALM guidance including installation, configuration and customisation through our four Microsoft Visual Studio ALM MVP’s in three countries; Australia, Beijing and the UK. They have experience deploying to small development shops all the way through to large blue chips.
Professional Scrum Developer Training
SSW has six Professional Scrum Developer Trainers who specialise in training your developers in implementing Scrum with Microsoft’s Visual Studio ALM tools.
Technorati Tags: TFBS Design Developing Testing .NET WCF SSW Scrum VS 2010 TFS
Smart Classifications
Each classification [Concepts, Categories, & Tags] was assigned using AI-powered semantic analysis and scored across relevance, depth, and alignment. Final decisions? Still human. Always traceable. Hover to see how it applies.
What to read next
Solution: Testing Web Services with MSTest on Team Foundation Build Services 2010
Explains how to configure MSTest for automated testing of web services on Team Foundation Build Services 2010, including handling dynamic …
Solution: Getting Silverlight to build on Team Foundation Build Services 2010
Step-by-step guide to resolving build failures when compiling Silverlight 3 projects with Team Foundation Build Services 2010, including …
Who broke the build?
Explains the importance of passing builds, common causes of build failures, how to identify issues and responsible users, and best practices …
Unit Testing against the Team Foundation Server 2012 API
Explains how to unit test applications against the Team Foundation Server 2012 API, focusing on handling authentication for automated and …
How to deal with a stuck or infinitely queued build
Learn how to identify, troubleshoot, and resolve stuck or infinitely queued builds in Team Foundation Build, including tips for monitoring …
Detecting agile theatre with real delivery signals
Why Most Companies Operating Models Fail in Dynamic Markets
A concise comparison of Predictive and Adaptive Operating Models, explaining why traditional structures fail in dynamic markets and how …
Don’t Manage Dependencies, Remove Them
Explains why dependencies are a sign of poor system design and outlines steps to eliminate them by aligning teams, clarifying ownership, and …
The Estimation Trap: How Tracking Accuracy Undermines Trust, Flow, and Value in Software Delivery
Tracking estimation accuracy in software delivery leads to mistrust, fear, and distorted behaviours. Focus on customer value, flow, and …
Flow of Value vs Flow of Work – Misnomer or Useful Shorthand?
Compares “flow of value” and “flow of work” in Kanban, explaining why only validated outcomes count as value and stressing the need for …
Why Outsourcing DevOps Fails, and How Real Engineering Excellence Starts With Your Team
Avoid DevOps vendor lock-in, discover how true engineering excellence starts with partnership, not outsourcing. Ready to transform your …
The Definition of Done is a Commitment to Quality
Defines the Definition of Done in Scrum as a clear, shared standard for quality, ensuring increments are releasable, transparent, and …
Why Your Definition of “Done” Is Holding Back Quality, Agility, and Trust, And How to Raise the Bar
Is your team’s “done” really done? Discover how a clear, objective definition of done boosts quality, agility, and trust in product …
Acceptance Criteria vs Definition of Done: Why Getting This Right Builds Trust and Delivers Quality Faster
Stop confusing acceptance criteria with definition of done, learn the crucial difference to boost quality, speed, and trust in your agile …
How to Evolve Your Definition of Done: Start Small, Grow Smarter, and Build Lasting Momentum
Unlock a smarter Definition of Done, start small, evolve standards, and build team momentum without overwhelm. Discover how progress drives …
Why Most Transformations Fail Without Honest Conversations
Most transformations fail without open, honest conversations that address real issues, making transparency and tough dialogue essential for …
Why Your Definition of Done Is the Secret Weapon for Real Business Impact and Agile Growth
Transform your definition of done into a strategic advantage, deliver real value, reduce risk, and drive business impact with every sprint.