Diagnosing Production Problems: First Law June 11, 2010
Stephen's first law of diagnosing problems in production: try to replicate in test. (Assumptions: you have a test environment, you use it regularly, and it is reasonably close to production). Sometimes you just can't replicate the problem – for instance, it might be due to an oddity in a customer data file that you're not allowed to run outside of production. In those cases, see if you can use a proxy. For instance, try copying the file and masking the sensitive data, then running it in the test environment (of course, the masking process might cover up the error that is causing all the problems).
Production needs to stay clean, and as developers we need to keep our hands out of it as much as possible. This is particularly true in a highly secure environment with strong separation of duties, wherein you might have to drag a sys admin into the picture just to get to obscure log files, for instance. Replicate the issue, solve it, document it, and make sure everyone else in the company is able to share in the lessons learned.
Posted by Stephen at 3:32 PM | Comments (0)
Moles Free Download Without Pex May 19, 2010
Posted by Stephen at 11:10 AM | Comments (0)
Change HostType["Pex"] to HostType["Moles"] May 19, 2010
Once again I've learned the hard way that it pays to read the release notes. After installing Pex v0.91.x, suddenly I was having trouble running my tests in a particular solution. It has been driving me nuts - Visual Studio was throwing "object reference not set to an instance of an object" errors every time I tried to run tests, and the Test View was refusing to load any test names.
Finally, I noticed that I had a few tests that were still instrumented with HostType "pex" instead of "moles". I changed these around, and still got the error. Closed Visual Studio, restarted, and voìla, the tests can run, and Test View is populated again.
Pex and Moles - Release Notes
Posted by Stephen at 10:48 AM | Comments (0)
Why did they remove Promote Local Variable refactor? May 8, 2010
Can someone please tell me why Visual Studio 2010 no longer has the "Promote Local Variable to Parameter" refactoring? I use this every day. Thankfully CodeRushXpress has it, but the current version is a bit unstable, causing VS2010 to crash periodically.
Posted by Stephen at 8:15 PM
AccuRev - Review and Practices May 7, 2010
I've been using AccuRev, including AccuBridge integration in Visual Studio, for close on two years now. And I like it. I don't know anything about the licensing fees, but for the enterprise that is interested in spending some money, it is certainly a good option. So, for anyone considering using AccuRev for source code control, and who happens to stumble across this site, here are a few points to consider:
Continue reading "AccuRev - Review and Practices"
Posted by Stephen at 8:27 PM | Comments (0)
How to assign namespace and action to FaultContract in ServiceContract Interface (Web Service Software Factory)? April 2, 2010
I am using the latest edition of Service Factory - Modeling Edition (VS2008). I've created a number of FaultContracts in my DataContract model, and utilized them in my ServiceContract model. The generated code for the ServiceContract does not include the namespace or action for the FaultContract, i.e.
Continue reading "How to assign namespace and action to FaultContract in ServiceContract Interface (Web Service Software Factory)?"
Posted by Stephen at 9:39 AM | Comments (0)
T-SQL Cursor Performance Optimization March 7, 2010
One should work hard to avoid Cursors in T-SQL – for instance, by using recursive common table expressions &ndsh; but when you need to call a separate stored procedure in a loop, you're stuck with them. I recently came across an excellent guide to the subject, Performance Tuning SQL Server Cursors, which includes the following enlightening piece of advice:
If you have no choice but to use a server-side cursor in your application, try to use a FORWARD-ONLY or FAST-FORWARD, READ-ONLY cursor. When working with unidirectional, read-only data, use the FAST_FORWARD option instead of the FORWARD_ONLY option, as it has some internal performance optimizations to speed performance. This type of cursor produces the least amount of overhead on SQL Server.
If you are unable to use a fast-forward cursor, then try the following cursors in this order, until you find one that meets your needs. They are listed in the order of their performance characteristics, from fastest to slowest: dynamic, static, and keyset.
Every cursor I’ve ever written would have benefited from this.
Posted by Stephen at 8:33 PM | Comments (0)
Exploring .Net Code with Pex February 9, 2010
A few weeks ago I stumbled upon a tool called Pex
from the Microsoft Research Labs: "Pex finds interesting input-output values of your methods, which you can save
as a small test suite with high code coverage." Not having much time to spend exploring it, I was fortunate
to have time to attend a Twin Cities Developers Guild meeting
tonight and hear a talk on on how to use the tool, which now has me jump started. First a few highlights
of what I learned (without cribbing too much from Jason Bock's presentation),
and then sample results from the method
in my last post.
Continue reading "Exploring .Net Code with Pex"
Posted by Stephen at 9:36 PM