var blog = new ThoughtStream(me); RSS 2.0
 Monday, July 21, 2008

Test Driven Development Is To Unit Testing As Interaction Design (IxD) Is To Accidental Design

One of the major problems with writing unit tests after the code is that it is very natural to write tests that prove the code works the way it was written, instead of the way it should work. Writing code test-first (via whatever flavor of Test Driven Development) flips that scenario right side up. TDD helps to ensure that code is written to work according to specifications and not the other way around.

Similarly, designing and/or implementing a UI after a behavior or process has been coded is a likely to result in a UI that fits the code model and not a model that fits the needed interaction and workflow. This situation must also be flipped right side up - interaction design should be done before, or at least in parallel, with coding. It cannot be left to accidental or incidental happenstance - interaction design must occur with proper interaction patterns and practices in mind.

Overlapping IxD and TDD

To overlap interaction design and test driven development, there are a few key words that need to be borrowed from interaction design. Fortunately, they easily fit within TDD development techniques and philosophies.

Epistemic work is exploratory in nature, or a process of trial and error through research. TDD and interaction design sketching are both epistemic. TDD explores API possibilities and allows easy trial and error to find the simplest implementation for what you need at the time. UI design sketches also allow you to quickly explore interaction designs - whether it's a white board, pencil and paper, graphics design software, or even quick-hack forms layout in IDEs. You can quickly and easily throw away a bad API in TDD and you can quickly and easily throw away a bad UI/Interaction design when you have nothing more than pencil sketches or white board drawings.

Pragmatic work is very structured and step-by-step in it's nature, implementing patterns and practices to fulfill what is needed at the moment. Implementing Code after writing unit test and implementing UI after designing around constraints are both pragmatic. TDD is pragmatic in that you only implement what is needed to properly pass the tests that have already been written. Similarly, with previously designed interactions and UI elements, implementation can be easily limited to what is needed for the UI.

With epistemic and pragmatic work covering both interaction design and test driven development, it seems that they are a natural pair. An analysis of a user story and it's acceptance criteria will create the unit tests that we need. At the same time, the same analysis can be applied to interaction designs. Additionally, a strong understanding of how a UI will look can have a profound impact on the code that is written, and vice-versa. Therefore, it is natural that interaction design and test driven development are done at just-in-time intervals - before the real work is implemented in the real code and UI platform.

IxD As Part of "Done"

Despite interaction design being a required part of UI development, not all user stories require a UI. Interaction design may not fit into a swim lane board or be part of every story's "done" criteria. However, interaction design will always be done for any story that does have a UI - it may simply be an accidental or incidental part of the software development process for a team, though. If it's safe to assume that the work will be done, then it is the team's responsibility to ensure that it is done correctly. Don't let interaction design happen accidentally or incidentally in the development process. Set a standard of always including interaction design in the development process, the same way Model View Presenter/Controller is a part of development.

Monday, July 21, 2008 8:47:04 AM (Central Standard Time, UTC-06:00)  #    Comments [3]. Trackback 
Tags: Agile | Analysis and Design | Behavior Driven Development | Interaction Design | Management | Model-View-Presenter | Principles and Patterns | Test Driven Development | Unit Testing | User Stories

Tuesday, July 22, 2008 10:52:04 AM (Central Standard Time, UTC-06:00)
Good stuff, one comment though...


"Similarly, designing and/or implementing a UI after a behavior or process has been coded is a likely to result in a UI that fits the code model and not a model that fits the needed interaction and workflow."

I've more often seen people start UI first and create a model that suits that UI, which is often a poor approach. Think your right about getting them going in parallel, assuming both are important on the particular piece of work.
Tuesday, July 22, 2008 11:37:14 AM (Central Standard Time, UTC-06:00)
@Colin

"I've more often seen people start UI first and create a model that suits that UI, which is often a poor approach."

Very true - I've seen it backfire from both directions. My personal experieince has seen a poor UI when implementing to a code model, though. Your mileage (or kilometers) may vary.

To quote the IxD team lead at my company, "The UI *is* the application, to the user". I think this holds true in most situations where a UI is involved (there are certainly exceptions, though). The UI and the model should join nicely - if they don't, you may have one of them overly coupled somewhere. From that perspective, I agree that parallel is probably the way to go so you don't end up with a mess on either side.



Tangent - I think there's a few assumptions or key aspects in what I was trying to say, that got lost in the editing. One of which is that the UI is not the same thing as interaction design - not directly anyway. I like to think of interaction design (pencil sketches, whiteboard pictures, etc) as the specification to my UI implementation, the same way I use context/specifications to drive TDD.

Tuesday, July 22, 2008 11:50:50 AM (Central Standard Time, UTC-06:00)
Another nit-picky note about my own post, and what got lost in translation. :)

i was not trying to advocate 'big IxD up-front' ala Alan Cooper. i was assuming that IxD done 'before' code meant that it happened during an iteration and was a discussion with the entire team (coders, ui experts, ba's, customers) that happened 'before' coding actually began.

the more i think about it, though, the more it makes sense for parallel IxD and TDD to occur during an iteration.
Comments are closed.
Navigation
About Me
View Derick Bailey's profile on LinkedIn

Send mail to the author(s) Contact Me
Archive
<December 2008>
SunMonTueWedThuFriSat
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2008
Derick Bailey
Sign In
Statistics
Total Posts: 91
This Year: 91
This Month: 0
This Week: 0
Comments: 40
Themes
Pick a theme:
All Content © 2008, Derick Bailey
DasBlog theme 'Business' created by Christoph De Baene (delarou)