Blog posts tagged - "112"

Test driving a WPF App – Part 2: Adding some data

This is part two of the blog series about creating a WPF application using TDD to drive the functionality and MVVM to split that functionality away from the view into something more testable. You may want to read part one if you haven’t already. In this part, we’ll see what it takes to display data on the front page about each player on the softball team. We’re not going to display all their stats, since we don’t need to for the example, but it would be very easy to extend this to do so.
Continue reading -->

Test Driving a WPF application using MVVM and TDD

This is a preview of the material I’m going to be presenting at the St. Louis Day of Dot Net in a couple weeks. Introduction For those of you who are reading this blog for the first time, I’m pretty much the St. Louis Agile Zealot. Long hair, flowing robes… you get the picture 🙂 I’ve been advocating Agile and XP in St. Louis since around 2000, through speaking at various user groups and local conferences, teaching at local companies, giving talks in the park, dropping leaflets from airplanes, and so on.
Continue reading -->

What do you think of this code?

I recently finished 6 weeks of coding for a client, and it was heaven! I actually got a chance to code every day, for 6 solid weeks. It was a chance for me to learn C# 3.0, and a chance to work on testing things that are hard to test. It was great! Out of the work, came several interesting observations and coding techniques, all rooted in C# 3.0. Since no one at work has any experience with these new idioms I “invented”, “discovered”, or just “copied”, I’d love to get some reader feedback.
Continue reading -->

Slides from my powershell talk

I gave an introduction to Powershell talk at the St. Louis .Net UG meeting on Monday, October 29th to about 70-80 people or so. I introduced basic concepts of powershell, talked about a few problems I had solved with it, and showed some simple scripts. At the end of the presentation, I promised to post the slides by the end of this week, and I’m making it Wednesday night. Believe me when I say that me getting something finished early is a minor miracle 🙂
Continue reading -->

Episode 2 – The InputReader and the start of the Processor

OK, so this stuff is different. Really different. So different that i feel like a TDD rookie all over again. I find myself questioning everything that I do, and wondering if I’m going in the right direction. But it’s fun learning something new… When I last left you… When we finished episode 1, we had created a couple of customer tests and had used Interaction Based Testing to drive out the basics of our architecture.
Continue reading -->

Interesting difference using nested test suites in JUnit versus NUnit

My friend, Jim Newkirk, introduced me to a very nice way of partitioning programmer tests for a class as you write them. Most developers write a single test class for a single application class, and just dump all tests for that class in the same place. This is not as correct as it could be (that’s Consultant-Speak for “that’s just plain wrong”). The accepted best practice is to group together tests that have the same setup/teardown logic into the same test fixtures, which can lead to having multiple fixtures for a single class.
Continue reading -->

Another powershell quickie – removing all bin and obj directories beneath VS.Net projects

gci -recurse -include bin,obj . | ri -recurse I was playing around with how to get this to work, and I couldn’t seem to figure out why these commands didn’t find the same locations to delete: gci -recurse -include bin,obj . ri -recurse -force -include bin,obj -whatif . I finally got so baffled that I RTFMed remove-item, and there was my answer. In the fine print, nestled away in an example that did what I was looking for, and in the documentation for the recurse parameter was my answer…
Continue reading -->

Asynchrony Solutions is hiring!

Asynchrony Solutions is looking for several developers to join our company. Our immediate requirements are: C/C++/Unix/realtime/embedded developer — This is for an exciting, very long-term project where you would have the opportunity to write code in C, Java, and C++ Java or C#/.Net/ASP.Net developer for any one of a number of projects Agile mentors and trainers In addition to technical skills, agile experience is a definite plus. Even if you haven’t ever worked in an agile environment, you should be very opening to learning agile skills and working in such an environment.
Continue reading -->

A Real World Example of Refactoring

I’m leading an agile team through developing a web site. This means that I spend most of my time managing, but on this one occasion I had the opportunity to write some code. The problem We had an image stored in a database that was always either 800×600 (portrait) or 600×800 (landscape). We had a need to render that image on the site either as-is or reduced to one of two other sizes.
Continue reading -->

Brian’s Handy Dandy Rules of Framework Development

The whole basis of my talk at TechEd is that there are some non-technical rules around which creating good frameworks should revolve. Since I mined those rules from my earlier poll on this blog, I thought I should share my results with you. I give you Brian’s Handy Dandy Rules for Framework Development Clients come before frameworks Ease of use trumps ease of implementation Quality, Quality, Quality Be an enabler It’s a people problem Clients come before frameworks
Continue reading -->

I’ll be speaking at Tech Ed!

I’ve been meaning to post this for a while, but I’m finally making myself do it now… I’ll be giving a presentation on “Creating Your Own Enterprise Application Framework” at Tech Ed in Boston, on Friday, June 16 at 9:00 AM in Grand Ballroom A. My talk is based on experiences in my 2–1⁄2 years in patterns & practices and how I believe we most successfully build our libraries and frameworks.
Continue reading -->

Chock full of bloglets

Hi, All, This entry should have something in it for everybody, since I have a bunch of little things to say. Friday is my last day at patterns & practices. I want to thank everyone there who has put up with me for 2–1⁄2 years. The experiences I’ve had there and the friends I’ve made there will last me the rest of my life. And hopefully I’ve left something of myself behind that will help them in their future endeavors.
Continue reading -->

Visual Studio 2005 ACE Winner!

Imagine my surprise when I woke up yesterday, checked my MSN email, and found a note from Soma  It seems that someone out there nominated me for an ACE (Award for Customer Excellence) for helping get VS.Net 2005 out the door, and Soma was writing to tell me that I had won. I have to admit, I was not expecting this at all (in fact, I had never heard of this until Sam Gentile mentioned that he got one), so I was really pleased when I saw it.
Continue reading -->

Real Test Driven Development with Visual Studio Team System

There has been a lot of controversy lately, both in the blogosphere and on the Yahoo TestDrivenDevelopment group, about whether or not it is possible to due true Test Driven Development (TDD) using VSTS. I’m here to tell you that it is absolutely, completely, totally possible. But it ain’t easy. The point of the rest of this post is to explain why, and to show you another, easier, way. My definition of TDD
Continue reading -->

Enterprise Library Caching Block and Exception Safety

Someone recently sent me some email after looking through my old Enterprise Library January, 2005 Caching block code, and asked to say a few words about the design of the exception safety of that block. This was one of the flaws in the original implementation of the Caching block that this newer implementation replaced. It had some thread safety issues, and it did not function well in the face of exceptions.
Continue reading -->

This isn’t how I learned TDD… — Updated!

**Updated – 11/23/2005 The content on this page has been taken down. I want to thank those of you who voted on this topic to send the correct message to Microsoft, and those of you inside of Microsoft who took the complaints seriously and acted on them. </> – bab **Original Post This link has been making its way through the blogosphere over the past couple of days. Please take a minute and visit that link, and then come back here.
Continue reading -->

What do you find hard to test?

OK, folks. I’m asking you — What kinds of problems do you find hard to conquer through TDD? I’m interested in writing a continuing series on my blog about things that are difficult to create TDD. I plan on taking the suggestions that I get, both through email and as comments on this blog post, and begin solving them using C# and .Net. The intent of this series is twofold: the first result I hope to get from this is the obvious one — a set of lessons about how to TDD hard problems.
Continue reading -->

EAP for ReSharper 2.0 starts!

After many weeks and months of waiting, the Early Access Program for ReSharper 2.0 has begun. Grab it here!! For those of you who don’t know, ReSharper is a plug in for Visual Studio .Net that adds in a bunch of refactorings, navigation helpers, and other stuff that just makes you more productive. There are separate downloads for VS2003 and VS2005. Grab it, use it, and tell ‘em about it!
Continue reading -->

Looking for ideas for TDD webcast next week

I’m currently scheduled to take part in a TDD webcast next Wednesday, and I’m looking for advice about what to cover. We’ve already done a basic, “This is TDD” webcast in May or so, so I’m looking for what Chapter 2 should be. Ideas I’ve had include TDD Around the Edges — how to TDD code that touches APIs, servers, databases, etc TDD and its affect on Architecture — how TDD affects the architecture of a system Whatever we do, it has to be coverable in roughly 50 minutes of talking plus demos.
Continue reading -->

More VSTS Unit Testing learnings

I was having problems getting a very simple test to work this morning using VSTT, and I distilled my problem down to its most simple form: using System; using Microsoft.VisualStudio.QualityTools.UnitTesting.Framework; using System.IO; namespace FileCopyingBug { [TestClass] public class FileCopyFixture { [TestMethod] public void WillCopyFileWhenRun() { Assert.IsTrue(File.Exists("TestFile.txt")); } } } And I created the external TestFile.txt in my project directory and set its properties to have it copied to the output directory always.
Continue reading -->

Slides from Enterprise Library presentation at St. Louis .Net User Group, June 26th

On Monday, June 26th, I had the pleasure of addressing the St. Louis .Net User Group. I had been invited to speak about Enterprise Library, as several people had been asking questions in the group about how to get started using it and were looking for an overview. I had already given a talk on Enterprise Library to the C# and VB.Net SIGs of this group, so it was only natural that they might call on me to give the talk at the main meeting at well.
Continue reading -->

WMI, LUA, and a surprise for me!

Note to self: WMI and LUA don’t play together nicely. I’ve been researching a bug that many of you Enterprise Library users may have encountered. According to our instructions, you have to run installutil against all EL assemblies, to allow them to load up their performance counters, event log sources, and WMI schema. If you do this as an admin, things work beautifully. If you run your EL-based app with less than admin privileges, interesting things happen with WMI, but that has been covered on other blogs.
Continue reading -->

Whidbey System.Configuration, the Principle of Least Surprise, and a dash of TDD

What in the world do these three topics have in common??? I would have thought nothing until yesterday. But then I learned better… The Principle of Least Surprise Do me a favor, really quickly. Google “Principle of Least Surprise”. Back already? Good. It sure seems like there are a lot of folks out there who are pretty hot on using software that does what they expect it to do. And doing something unexpected, like making Ctrl-Q quit your program instead of ending macro recording, makes some folks pretty angry.
Continue reading -->

Recovering from corrupted perf counters

Don’t know if any of you have ever had this happen to you or not, but it paniced me a bit when it happened to me. I opened up perfmon, and instead of nice names of counters and categories, I had nothing but numbers in their place. The last thing I wanted to do was to have to rebuild my VPC, so I really wanted a way to fix this.
Continue reading -->

My first day using VSTS

My group at MS is considering changing over to using the new unit testing stuff built into the newest version of Visual Studio, so I decided to give it a try. I’ll be keeping a diary of how things go today, and hopefully I’ll learn something interesting. The first thing I’ve learned is that I can’t wait for the ReSharper EAP  I need the navigation and refactoring tools I get with that.
Continue reading -->

The Dispose pattern, Finalizers, and Debug.Assert?

Peter Provost, Scott Densmore, and I were talking about some additions to our project coding guidelines, and I proposed a new one that we wanted to get some feedback on from the community. According to the Dispose pattern, you’re supposed to create classes that look like this: public class BuildProcess : IDisposable { ~BuildProcess() { Dispose(false); } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } protected virtual void Dispose(bool disposing) { if (disposing) { } } } Now the issue here is what should happen if your class is disposable and the finalizer gets called?
Continue reading -->

Simple Solution To Hashtables and Thread Safety

Shortly after I posted the original entry on this, I figured out a much more simple way than using version numbers, etc. Item item = null; bool lockWasSuccessful = false; while(true) {     lock(hashtable) {         item = hashtable[key];         lockWasSuccessful = Monitor.TryEntry(item);     }     if(lockWasSuccessful == false) {         Thread.Sleep(0);         continue;     } // If we reach here, the item was successfully locked     try { // Application code goes here
Continue reading -->

Thread-safety and hash tables

I’m storing information in a hashtable. The information is keyed off a string, and the key is volatile — items can be removed, added, replaced, etc., from the hash table. The problem that I’m studying is how to manipulate this information in a thread-safe way without locking the entire hash table all the time and killing performance. Solution number 1 was to lock the entire hash table during each operation on the data in the hash table.
Continue reading -->

Microsoft Enterprise Library

One thing I haven’t mentioned about myself yet is that I’m part of the Microsoft Enterprise Library team. I’ve been working on this project since its first day, back in February, and MS has finally taken the wraps off the project. This has freed us up to start talking about it, and talking I intend to do! You can see the blogs of the other Enterprise Library team members at the far left of my blogs.
Continue reading -->

The Present I Promised

As promised in the previous blog entry, here is the code I used to implement the Active Object pattern on a .Net project I’ve been working on. Here’s the setup for the pattern again. I was working on rewriting some caching functionality on this project, and I had some housekeeping operations that had to happen in the background. This meant that I had to have multiple threads operating at the same time, but I had several choices as to how to do this.
Continue reading -->