Latest Tweet:
  • Loading...

This week I have been attending the 11th international conference on Agile Software Development, XP2010, in Trondheim. It has been an amazing week, filled with learning, excellent food and awesome social events, making new friends and catching up with old. I gave two lightning talks during the conference, one on UI prototyping in agile projects (the same I gave at Smidig 2009), and one on Generating Characterization Tests for Legacy Code. The talk on characterization tests was based on some work I did back in October – December 2009. I was involved in a partial rewrite of some pretty bad legacy code. One of the techniques we discovered was that we could use the slow running integration tests to code generate fast and more targeted characterization tests for the code we were rewriting.

For the last three-four months I’ve been working on an open source testing tool that streamlines the technique of generating characterization tests for your legacy code. The project is called BlackBoxRecorder and is available on Github.

BBR_logo_white

BlackBoxRecorder is a tool that uses AOP-techniques to automatically record and generate characterization tests for legacy .NET code (code without tests). You apply a [Recording]-attribute on the method you want to generate tests for, and a [Dependency]-attribute on any class accessing external resources such as the file system, web services or databases.

Each method invocation of a method marked with the recording-attribute will be stored in an XML file. The XML file contains information about the method, copies of input parameters, output parameters and return values. If the method being recorded invokes any methods on a class marked with the Dependency-attribute, the return values of the dependency will also be recorded in the same XML file. This enables automatic mocking of external dependencies when playing back the characterization test.

For each method recording BlackBoxRecorder will generate a unit test that will play back the recorded XML file against the method. The return values from the method will be compared against the recorded return values using reflection. If any change is detected the test will fail. The test will serve as a change detector (which in essence is what characterization test is), notifying you of any changed behavior in the method being tested. If the change was intentional you can configure the generated test to ignore that property on next run.

The generated tests supports automatic stubbing/mocking of the types marked with the Dependency-attribute. When the test is played back, the dependency will load return values from the XML recording and return these instead of actually calling the external resource. You do not have to change your code for this to work and even static methods are supported.

I got some really good feedback on the session, and it was pretty cool that Michael Feathers attended the session. I referenced his book and quoted him a few times in the presentation, so I was really glad he enjoyed the talk.

MichaelFeathersCommentOnTalk

I also got questions from several people who where interested in what it would take to port BlackBoxRecorder to Java. So on Thursday evening I organized an open space session where we walked through the code and discussed how to implement a Java version. We continued the talk over lunch Friday, and soon enough Ole Christian Rynning, Johannes Brodwall, Geir Amdal, Marius Kotsbak and myself where hacking away on a spike implementing BalackBox for Java.

Hacking away on a Java implementation of BlackBoxRecorder

We called the implementation JackBox, and the code is up on Github if you want to jump in and contribute.

JackBoxFirstCommit

 

I will definitely blog more about BlackBoxRecorder as soon as I’m done with my NDC2010 presentations. Thanks to organizers, speakers and attendees for making XP2010 a memorable experience!

Earlier this month I was lucky enough to both attend and speak at the Norwegian Developer Conference 2009. What a blast! The NDC09 featured a perfect mix of content – everything from the latest in technology, to the core principles of software craftsmanship and agile development. The speaker lineup this year was AMAZING, and I feel humble to be invited among such a group of incredibly talented people. Hopefully I was able to keep up with the level of the rest the speakers.

JonasAndHaack

I gave two presentations at NDC09; one on the MVVM design pattern (more easily referred to as View Model) and one on .NET RIA Services. I think both talks went well – with the View Model talk being the strongest one, as this is something I’ve been presenting on many times before.

I’ve uploaded both the slides and the demos from my talks. The MVVM demo is basically a the Dive Log example application taken further, with multiple View Models communicating through an Event Aggregator and a touch of navigation using the Silverlight 3 navigation framework. The .NET RIA Services demo is a “plain” data centric application, as well as a second demo app which uses nHibernate and the XML Metadata Provider (something I have to revisit in a later blog post).

In addition to the technical content delivered at NDC09 it was great fun to hang out with old and new friends. Here are some of the highlights: Had some great conversations with Glenn Block about different aspects and approaches to the View Model pattern. Got to catch up with Andrew Browne, a good friend from the Melbourne developer community. Had dinner with Carl and Richard from .NET Rocks, Udi Dahan and Capgemini colleagues. Had tons of good conversations with fellow Norwegian developers. Went fishing with Tim Huckaby.

Thanks to all the speakers, organizers and attendees for making NDC2009 such an awesome event. Hope to see you all back there next year!

MVVM Design Pattern for Silverlight Applications

DiveLogMVVMScreenshot

Download slides:

Download demo

For a collection of more resources check out my MVVM tagged links on Delicious.

.NET RIA Services

Download slides

Download Fishbook Demo

Download Fishbook nHibernate Demo


For more resources check out my .NET RIA Services tagged links on Delicious, as well as the talk “.NET RIA Services - Building Data-Driven Applications with Microsoft Silverlight and Microsoft ASP.NET” and “Building Amazing Business Centric Applications with Microsoft Silverlight 3” from MIX09.

Adobe Kuler is a great example of a Rich Internet Application that provide great value directly in the browser. Kuler is a tool that helps you create color themes by applying different rules to find matching colors. You start by selecting a base color, and Kuler will help you find four matching colors. You can even use Flickr photos as a basis for your color theme. Adobe Kuler has a social aspect to it as well. You can create an account and save your colors online and share them with the community. People can rate and commend on your themes, or create new color themes based on an excising one. Kuler is being a good Web 2.0 citizen and offers a REST-full API that lets you build your own applications using the colors of the community.

Screenshot of Adobe Kuler

Whenever I find a service I like with an open API I just can’t leave it alone. So today I’m announcing the Colorful Expression add-In.

Colorful Expression is an add-in for Expression Blend and Expression Design that brings you the Adobe Kuler community directly into your toolbox. It adds a new palette to your design environment, making it easy to leverage the community to find the perfect color theme for your application or design. The add-in also available as a standalone application, making it useful for web developers working in Visual Studio or Expression Web to select colors for your CSS style sheets.

Expression Design

Last week Jose Fajardo blogged and complained that Expression Design doesn’t get enough love. I totally agree, and am going to give it some love by making it more colorful.

Expression Design AddIn 

The key feature of the add-in is to select colors. The eyedropper tool in Design lets you click anywhere on the screen to select a color. Simply click the eyedropper in your color panel, and click on one of the colors in the Colorful Expression panel.

You can also copy colors to the clipboard by clicking the copy-button. When you paste the color theme onto the design surface you’ll get five rectangles and the name of the color. This lets you collect interesting themes directly in your design file by copying them onto the document.

Expression Blend supports exporting and importing color swatch libraries through a simple XML file format. Colorful Expression allows you to save a theme as a swatch library you can import into Design. The screenshot shows the “Buddah in Rain” theme imported to the swatch library.

Expression Design AddIn Screenshot

Expression Blend

The add-in works almost the same way in Blend as in Design but with some minor differences. In Blend you can use the Ctrl+C key combination to invoke the copy command, making it a lot easier to copy/paste themes onto the design surface. When you paste a theme onto the surface you will get a grid containing five rectangles and a text block. The rectangles are painted with a solid color brush resource, and each of the colors gets added to the resource collection of the page. If you go into XAML-view and paste the theme you will get five solid color brush resource elements you can add to any resource collection. The Blend add-in also supports drag and drop, letting you drag color themes onto the design surface.

Blend add-in screenshot

Standalone application

The standalone application gives you most of the same features as the Blend and Design add-in. You can copy or drag themes into Blend, and you can save Design swatch libraries. The stand alone application is useful if you don’t want to run the add-in all the time or if you don’t use Expression Studio. You can also hold down control and click a single color to copy it to the clipboard as a RGB HEX color. That way you can use the standalone application as a color picker for any application using HEX colors, such as CSS style sheets.

Standalone application screenshot

Ideas for next version

I want to keep the add-in simple and focused, but I do have some ideas for new features. The first thing I’m planning to implement is a color provider for the COLORLovers site. I also want deeper integration with Blend and Design, especially around managing resources in Blend.

It would also be nice to support Expression Web and Visual Studio 2008 so that web developers can use it to get CSS colors for their web projects.

Another feature missing is support for the light Expression Studio color theme. The current look and feel is based on Hadi Eskandari’s Expression Clone theme and only supports the dark theme. It should be fairly simple to create a new theme matching the light colors.

You can suggest new features in the discussion board or report bugs in the issue tracker.

Download and installation

The project is released on http://www.codeplex.com/colorful, and the initial release contains the compiled version of the add-in for Design 2.0, Blend 2.0, Blend 2.5 June CTP, Blend 2.0 SP1 Preview and as a standalone WPF application. To install the add-in simply copy the files into your Blend or Design director, and launch the EXE file with an extra parameter.

I.e: “Blend.exe –addin:Colorful.Blend.AddIn.dll” or “Design.exe –addin:Colorful.Design.AddIn.dll”.

You can also right click your application shortcut and select properties to change the target of the shortcut. Add the above parameters to the target to launch Blend or Design with the add-in every time you click the shortcut.

ShortcutProperties

Getting involved

If you would like to get involved in the project drop me an e-mail at jonas@follesoe.no. You can also suggest features or report bugs in the discussion forum and the issue tracker.

To build the project you need to have Expression Blend or/and Expression Design installed. The add-in has a dependency on Microsoft.Expression.Framework.dll, which in turn has a dependency on Microsoft.Expression.Diagnostics.dll, Microsoft.Expression.Interop.dll and Microsoft.Expression.Licensing.dll. For licensing reasons these assemblies are not checked into the source control three.

If you want to run the add-in from Visual Studio I recommend running Visual Studio 2008 as administrator and then change the output directory of your debug build to the installation folder of Blend/Design. Then change the startup application to the Blend.exe/Design.exe with the correct startup arguments. That way you can hit F5 inside Visual Studio to launch Blend/Design in debug mode. You can set breakpoints in your code and test/debug the add-in this way.

Happy coloring!

Paul Stovell, a great guy I meet at CodeCampOz in Wagga Wagga, blogged about his circle of interest, and encouraged fellow bloggers to define their own.  Paul defines the three areas like this:

Core
These are things I enjoy, care about, and follow as much as I can. When news breaks in these areas, I try to stay on top. I like to think I’m an expert in some of them, and have strong opinions on the rest.

Non-core
I find myself working with these things, or have a minor interest in them, but tend to follow announcements occasionally. I have opinions and will probably complain if I don’t like certain aspects of them, but I’m not about to start evangelizing them.

I don’t care
The only time I spend in these things is to decide whether I care or not. I don’t really use the

I decided to try to map out the things I care about at the moment, and this is how it turned out:

My Circle of Interest

I would encourage any reader to create their own circle of interest, and in particular the following  bloggers:

  • Gøran Hansen: Good friend and long time colleague. Into .NET, switched to Mac as his home computer, flirting with alternative languages like Boo.
  • Martin Bekkelund: Active and highly visible Norwegian blogger with strong opinions on OOXML/ODF and Open Source. Just started in a new job at the Norwegian centre for free software.
  • Anders Norås: Dual-minded developer with strong presence both  the Norwegian .NET and Java community. Blogs about agile, software design, DSL and more. Great read!
  • Sondre Bjellås: Geek of the year, .NET enthusiast, Capgemini and Microsoft RD colleague and good friend. Bought the "love and sex with robots"-book when we where in Seattle for the MVP Summit, so his Circle of Interest should be interesting.
  • Andrew Browne: Great guy I drove up to Wagga Wagga with a couple weeks back. Just curious about what he's into at the moment.
  • Håvard Sørbø: Good friend from uni, into open source, C#, VOIP and everything with an Apple.

I spent the weekend in Perth surfing (not the web, but real waves), so I haven't gotten around to blog about this until now. Instead of a traditional product launch for Visual Studio 2008, Windows Server 2008 and SQL Server 2008 Microsoft Norway created a big "Heroes Happen Here" award show. Almost like "geek Oscars". In total 13 awards where given out, and I won the "MSDN Honor award" for my contributions to the Norwegian developer community in 2007! I obviously couldn't receive the price personally since I'm in Melbourne, but I recorded a short video that was shown at the party.

My good friend, fellow RD and Capgemini Colleague Sondre Bjellås won the main award, "Geek of the year", and got some good press, including an appearance on the NRK-TV news! Sondre got a good summary of the event and links to press clips on his blog.

Congratulations to all the winners!

  • Geek of the Year: Sondre Bjellås, Capgemini
  • Custom Built PC: Einar Roland, DataGuard
  • Best Server Room: Daniel Estefanos, Statens innkrevingssentral
  • MSDN Honor Price: Jonas Follesø, Capgemini
  • Best DBA: Jørn Aakre, Crayon
  • Best IT-tech: Ragnar Harper, Crayon
  • Best Trainer: Kristine Kjenes, Crayon
  • Cutting Edge Company: StatoilHydro
  • Problem Solver: Stein Morten Rustad, Lindbak Retail Systems AS
  • MSDN Guru: Anders Nordås, Storebrand
  • TechNet Honor Price: Olav Tvedt, Tvedt Consulting
  • Best Home Network: Holger Sommer, Visma retail
  • Colleague of the Year: Ole Jørgen Jacobsen, Vivento AS

One of the things I really like about being a software developer is the sense of community between fellow developers. In Trondheim I've been involved with both the Norwegian .NET User Group and the Microsoft Student Community at NTNU. There are a bunch of other communities and user groups in the Trondheim area, such as Trondheim Linux User Group (TLUG), Dataforeningen, PVV and many more.

Tore Vestues, a colleague of mine at Capgemini Trondheim, introduced me to Trondheim XP and Agile Meetup some time back, and last night I attended my first meeting. Tom Gilb, the creator of the EVO-process, was in Trondheim to give a presentation at the university (NTNU), and had some time to share in the evening before catching his flight. The guys behind Trondheim XP and agile Meetup managed to pull together a quick meeting  and 13 people showed up on a very short notice. Tom Gilb joined IBM in 1958, and became a freelance consultant in 1960. That's 47 years of consulting! It was great fun to hear Tom share some of his ideas on agile development, his own EVO-process and how it fits nicely as an envelope around Scrum/XP or some other programming-focused agile process.

Being involved in communities and user groups is great fun and something I strongly encourage everyone to do. Find a user group/community that looks interesting and go to the next meeting!

Tom Gilb @ Trondheim XP and Agile Meetup
<September 2010>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789