Unit test success using Ports, Adapters, & Simulators–kata walkthrough

You will probably want to read my conceptual post on this topic before this one. The kata that I’m using can be found at github here. My walkthrough is in the EricGuSolution branch, and I checked in whenever I hit a good stopping point. When you see something like: Commit: Added RecipeManager class you can…

0

Unit Test Success using Ports, Adapters, and Simulators

There is a very cool pattern called Port/Adapter/Simulator that has changed my perspective about unit testing classes with external dependencies significantly and improved the code that I’ve written quite a bit. I’ve talked obliquely about it and even wrote a kata about it, but I’ve never sat down and written something that better defines the…

2

Tricks you can play on yourself #789–Linq

I was profile some code this morning, and came across some interesting behavior. Basically, we had some low level code that looked something like this: IEnumerable<Guid> GetSpecialQuestionIds() {     return       GetAllSpecialItems()         .Select(specialItemXml => specialItemXml .CreateFromXml(questionXml))         .SelectMany(specialItem => specialItem.Questions.Select(question => question.UniqueIdentifier)).Distinct();         .Distinct(); } So, it’s taking special item xml, deserializing each special…

2

Simulators or not?

I’ve been spending some time playing with Cockburn’s hexagonal architecture  (aka “ports and adapters”), and the extension I learned from Arlo, simulators. I’ve found it to be quite useful. I was writing some code, and I ended up at a place I didn’t expect. Here’s the situation. I have the following external class (ie “port”)….

0

Identifying your vertical story skeleton

I’ve been leading an agile team for a while now, and I thought I would share some of the things we’ve learned. This one is about vertical slices, and learning how to do this has made the team more efficient and happier. To make this work you need a team that is cross-functional and has…

0

Rational behavior and the Gilded Rose kata…

The following is based on a reply to an internal post that I almost wrote this morning, before I decided that it might be of more general interest. It will take a little time to get to my point so perhaps this would be a good time to grab whatever beverage is at the top…

2

7 Hills 2014

The forecast did not look good. In fact, it looked pretty bad. It was Sunday of Memorial day weekend, and I was forecast-shopping. That’s what I do when I want to ride and the weather is marginal; I look at the different weather forecasts (Accuweather, wunderground, weather.com, national weather service) to see if I can…

3