AgileRoots 2010 Videos

Videos of the presentations at AgileRoots 2010 are up for free viewing on confreaks. If you missed my presentation “You Can Test Anything!” with Zhon Johansen at the recent Utah Code Camp, you can catch an earlier slightly less polished version at confreaks.

Utah Code Camp Fall 2010 Schedule

The preliminary schedule has been posted for the Fall 2010 Utah Code Camp on September 25th. I’ll be presenting two sessions: an updated version of my presentation on making internet-enabled applications for Windows Phone 7 and updated version of “You Can Test Anything!” with Zhon Johansen. I’ll have some Windows Phone 7 swag to give out and an MSDN Universal subscription to give away as well. Code Camps are always free and are for the developer community and by the developer community.

There will also be an agile roundtable at Code Camp facilitated by Zhon Johansen. Zhon recently presented on the highly successful agile roundtable we have here in Salt Lake City at the Agile 2010 conference. The local roundtable has been going steady for 10 years and is a great resource to any developer looking to improve their team skills in an agile environment.

Utah Fall Code Camp on Sept. 25th, 2010

Utah Fall Code Camp on September 25th, 2010. I’ve submitted several sessions to the organizers: one on using DirectWrite in C# with SlimDX, an enhanced version of my talk on internet enabled applications for Windows Phone 7 and an updated version of the “You Can Test Anything!” session that Zhon Johansens and I delivered at AgileRoots 2010.

Test-Driven PHP Development

phpOK, so I have a little open source project where we agreed to use PHP as the implementation language. I wanted to practice test-driven development with PHP, so I got out PHPUnit and started coding.

Read the rest of this entry »

Pearson Publishing Sponsors “You Can Test Anything”

I’m pleased to announce that Pearson Publishing will be supporting the Agile Roots 2010 session “You Can Test Anything”, presented by myself and Zhon Johansen. The publisher will be giving us some books to give away to attendees of our session. They are also a sponsor of the conference in general. Thanks, Pearson Publishing!

Today, May 14th, is your last day to register for Agile Roots at the early bird discount and save $100 or more.

“You Can Test Anything” Accepted for Agile Roots 2010

Agile Roots 2010 will be held June 14th and 15th in Salt Lake City, Utah. Zhon Johansen and I will be presenting a 60 minute session titled “You Can Test Anything”. We will give you a whirlwind tour of techniques that show you how to introduce tests into legacy code, i.e. code without existing tests. See you there! Last year’s Agile Roots conference was a great bargain for the price. This year’s conference has been expanded to two days and includes a mix of speakers and hands-on tutorials.

Utah Code Camp on March 27th, 2010

At this Spring’s Utah Code Camp on March 27th, 2010 I will be presenting the following sessions:

  • What’s New in XNA Game Studio 4.0
  • Developing for Windows Phone 7 Series
  • Red, Green, Refactor: Learn Test-Driven Development in Two Hours (with Zhon Johansen)

Check the Utah Code Camp website for more information.

Code Camps are always free.

C++ Mock Object Workshop on January 13th

Zhon Johansen and I will be covering C++ mock object frameworks at the January, 2010 meeting of XP Utah. Zhon will cover googlemock, the Google C++ Mocking Framework, and I will cover mockpp, Mock Objects for C++. XP Utah meets from 7pm to 10pm on the second Wednesday of every month at the Borders bookstore in Murray, UT.

During this workshop, we will practice test-driven development in C++ using mock objects. We will be using Boost.Test as the underlying unit testing framework. The workshop will be organized as a programming kata, first with mockpp and then repeated with googlemock. By repeating the same exercise with the same unit test framework but two different mocking frameworks, participants will be able to compare and contrast the two mock frameworks for C++.

The workshop is free and open to all.

To participate, bring a laptop with a C++ programming environment. There is free wireless at the Borders bookstore. You will want to have downloaded and installed Boost.Test before the workshop. We will start promptly at 7pm in order to work through the kata with both mock object frameworks. If you are unfamiliar with writing unit tests in C++, consult my tutorial on unit testing with Boost.Test.

Direct3D Test Doubles, Part 1

When developing Direct3D code using test-driven development, you need test doubles to stand in for interfaces used by your code. This way you can control the interaction of your system under test with its environment. This post is the first in a series of posts that discuss several ways you can create test doubles for the COM interfaces used by a Direct3D application.

Read the rest of this entry »

Unit Testing Concurrency

Jonathan House passed along a link to Testing Race Conditions in Java, a post from google’s open source blog. It describes ThreadWeaver, a tool for unit testing concurrency in java.

This reminded me of a recent article in MSDN magazine Code Coverage for Concurrency. It describes SyncCover a tool for measuring code coverage in unit tests involving concurrency.

Java and C# both provide language level primitives for synchronization. This makes it difficult to write unit tests that force the code down different paths relating to concurrency and synchronization. The nature of the language level primitives doesn’t lend itself well to faking them out by encapsulation through interfaces or virtual methods.

C++ takes a library approach to concurrency and synchronization. While I haven’t tried this yet myself, I have a feeling that the library approach would make it easier to control the playout of various synchronization and concurrency scenarios when writing unit tests.

Agile Code Reviews, Part 2

In my post on agile code reviews, I described how we were attacking our code through automated refactorings that we trusted to apply without tests. Mostly we applied a series of Extract Method refactorings to long methods in the process of performing a Compose Method refactoring on the long method. Eventually, your team will run out of situations where you can apply automated refactorings to improve the design of your code and you’ll have to start applying actual code changes. Several of the commenters on my previous post remarked that making changes without unit tests implies risk that can only be averted with sufficient manual testing and that such risk is better mitigated by automated tests. In this followup post, I’ll describe the results from our team at applying the decoupling techniques described by Michael Feathers to our legacy code so that we could backfill unit tests onto the legacy code in preparation for a design change we want to make.

Read the rest of this entry »

Unit Test Videos

ElMohanned Ahmed shared these links on unit testing videos with the sl-agile mailing list and I’m sharing them with you.

Read the rest of this entry »

Unit Testing JavaScript on Windows

JavaScript is playing an increasing role in modern applications. While it is commonly used in Web applications to implement client-side scripting, JavaScript is finding its way into more applications every day as it becomes a defacto standard for application scripting. If you practice test-driven development, you need a way to write unit tests around your JavaScript just as much as you need a way to write unit tests against your C++, C# or Java code. In this post I’ll describe a simple mechanism for writing unit tests against JavaScript on Windows via Windows Script Host.

Read the rest of this entry »

Test-Driven Development and Refactoring At Agile Roots 2009

I was a guest instructor at Zhon Johansen’s Test-Driven Development and Refactoring course at the recent Agile Roots Conference in Salt Lake City. Zhon and I did a dry-run rehearsal of this course for the Utah .NET User Group meeting in June. The streaming video for this tutorial is now available.

Read the rest of this entry »

C++ Unit Tests With Boost.Test, Part 5

In Part 4 of this series, we completed some UI functionality using a test-driven development style. In this final part of the series, I will cover the facilities in Boost.Test for sharing common setup and teardown actions between tests and organizing tests into suites.

Read the rest of this entry »

C++ Unit Tests With Boost.Test, Part 4

In Part 3 of this series, we completed Bob Martin’s Prime Factors Kata using test-driven development and unit tests written in C++ with Boost.Test. In this part, I will discuss test-driven UI development.

Read the rest of this entry »

C++ Unit Tests With Boost.Test, Part 3

In Part 2 of this series, I discussed the assertion facilities of Boost.Test and how to get the first passing test on Bob Martin’s Prime Factors Kata. In this part, I will continue with test-driven development to complete the functionality of the PrimeFactors::Generate method.

Read the rest of this entry »

C++ Unit Tests With Boost.Test, Part 2

In Part 1 of this series, I discussed how to setup a basic C++ unit test project that executed the unit tests when you built your code. In this part, I will discuss the assertion framework provided by Boost.Test in the context of a simple programming exercise that demonstrates test-driven development.

Read the rest of this entry »

C++ Unit Tests With Boost.Test, Part 1

In this post, I will describe how to start making unit tests in C++ with Boost.Test.

Read the rest of this entry »

How Do I Unit Test Something That Writes To A File?

This is a question that comes up periodically. Remember that a good unit test is one that is fast (< 100ms/test). A test that accesses files, databases or the network is not going to be this fast. But, we still have code that writes data to files or reads data from files and we want to unit test that code. So how can we do that?

Read the rest of this entry »