Posts

Showing posts from October, 2008

Paired Programming - Who? What? When? Where? Why? and How? . . .

Cheese Pairing for this Post: blue stilton [ugh. much like the meeting, this cheese leaves me irritated and with a slight taste of vomit in my mouth that I can't seem to shake for the rest of the day] So the other day at work, we had a meeting to discuss Paired Programming. The Outlook invite said something about "Improving Paired Programming," but from the time we started, it felt a lot more like "Bitching about Paired Programming." At one point, while we were listing a few things we like about it, one of our managers actually said, "Let's stop giving text book answers and talk about the real world." As I am a huge fan of the technique, I have to vent/rant a little and get my opinions out there. What (is Paired Programming) ? Just so we are on the same page, allow me to assert some preconditions for the follow discussion. When I say paired programming, I am talking about 2 developers, 1 computer, 1 story/bug/issue to work on. I prefer to h

Live Templates . . .

Cheese Pairing for this Post: Beecher's One-Year Aged Flagship Cheddar [mmm. that's tasty] Live templates in ReSharper are an excellent time saving tool. They allow you to put code that you use over and over into a shortcut that you don't have to retype it all the time or maintain it in files external to Visual Studio. I have a few that I've created to make my life easier. test [Test] public void $TESTNAME$() { $END$ } rhino [Test] public void $TESTNAME$() { $END$ using (mocks.Record()) { } using (mocks.Playback()) { } } tostring public override string ToString() { MemoryStream memoryStream = new MemoryStream(); XmlSerializer xmlSerializer = new XmlSerializer(GetType()); XmlTextWriter xmlTextWriter = new XmlTextWriter(memoryStream, Encoding.UTF7) { Formatting = Formatting.Indented, Indentation = 1,

ReSharper Code Cleanup . . .

Cheese Pairing for this Post: Jarlsberg [my favorite emmentaler; jarlsberg is excellent for snacking or sandwiches] ReSharper will automatically clean and organize your code for you according to your specifications. The default specs are great; however, I find that I like to put my methods, field, etc in a slightly different order. Here is the config that I use. The only enhancement I still want to add is sorting auto properties before properties that have a backing member rather than intermixed. I haven't figured out how to accomplish that yet, so if anyone knows, please post the answer in the comments, thanks. Without further ado: <? xml version ="1.0" encoding ="utf-8" ? > < Patterns xmlns ="urn:shemas-jetbrains-com:member-reordering-patterns" > <!--Do not reorder COM interfaces--> < Pattern >< Match >< And Weight ="100" >< Kind Is ="interface" />< HasAttribute CLRName =&quo

Qualities of a Good Unit Test . . .

Cheese Pairing for this Post: sm oked gouda [this is something great for every day consumption; try some on toast] So I was looking through some of the documents I have used for presentations in the office and I thought this was an interesting one: Atomic A unit test should only test a small piece of functionality. A litmus test is to ask if any part of the unit test could stand alone in a separate unit test. Another feedback loop for your unit testing quality is the amount of time you spend with the debugger. If your unit tests are coarse, a test failure is more difficult to find. If the unit test exercises a small amount of code, the test failure cause can usually be spotted very quickly. Order Independent & Isolated There should never be an order dependency, intentional or not, between unit tests. Problems arise when one unit test leaves some kind of dirty data lying around. Testing against a database or some sort of static cache is a common culprit. Put evil, stateful things be