I got kicked out of the cool kid’s club this morning

I actually suggested using Xml today as a solution for expressing automated tests for the new StoryTeller engine as a short to intermediate term solution.  I was immediately jumped on by my ALT.NET-loving cohorts (and if the shoes had been on the other foot I would have felt the same).  The kicker was when I got the (joking) remark that “why don’t you just go for the gusto and use VB (classic VB6, not VB.Net.  No hate mail, please.)?”

I spent a week pondering how to store this test data in JSON, or YAML, or natural language, or in code generated C#, or in JavaScript.  This morning I spent 10 minutes explaining why all of those choices are more mechanical work than is justified.  Last night I finally gave in in my own mind and realized that the Xml approach, with a dynamically generated XSD file and VS2008 Intellisense, would be the easiest and best choice in the short term both in terms of my mechanical work and the usage of the tooling. 

I’m one of the most vocal detractors of Spring-style XmHell (like the kind of XmHell promoted by StructureMap circa 2004) and I’ve mocked the Xaml team for claiming that Xml is a good choice for authoring DSL’s.  Yet I’m still going to use Xml to structure some data, just because it seems to make sense in this one particular case.  Is there a lesson for me in all of this?  Yeah, there is.  Don’t throw away a solution just because it’s uncool.  Maybe it even means that you should even reconsider techniques that were stupidly abused and misused before.

 

And if you think that this whole post reeks of self-justification, then you’re…  Oh, nevermind, I’ve got some code to go write.

About Jeremy Miller

Jeremy is the Chief Software Architect at Dovetail Software, the coolest ISV in Austin. Jeremy began his IT career writing "Shadow IT" applications to automate his engineering documentation, then wandered into software development because it looked like more fun. Jeremy is the author of the open source StructureMap tool for Dependency Injection with .Net, StoryTeller for supercharged acceptance testing in .Net, and one of the principal developers behind FubuMVC. Jeremy's thoughts on all things software can be found at The Shade Tree Developer at http://codebetter.com/jeremymiller.
This entry was posted in Uncategorized. Bookmark the permalink. Follow any comments here with the RSS feed for this post.
  • http://www.adronbhall.name Adron

    Sometimes, ya just gotta write out the ideas. Even when they’re bad. VB & XML might be a great idea…

    or not.

  • tom

    xml is not a bad solution given some of the nice things that you can do with linq, xml and objects. if you are looking for storage alternative you could also look at http://www.db4o.com. I am sure that you are familiar with them. easy object storage and retrieval

  • http://www.cornetdesign.com Cory Foy

    DTSTTCPW. Then Refactor. So what if it is XML? Once that works, then you can write a wrapper.

  • http://blowmage.com/ Mike Moore

    XML itself is not uncool. The misplaced use of it is.

    So I’m a little confused, are you using XML to simply store some structured data? Or are you using XML to represent the stories?

  • http://www.mkoby.com Michael Koby

    This is the problem I have with trends, people ignore good solution ideas because it’s a technology that is not “trendy” and that can cause all kinds of issues.

    XML is not a horrendous technology. It serves a purpose. So to completely throw it out because it’s not “Alt.NET” is just ridiculous. Isn’t Alt.NET about find the best solution and practice for the job at hand? Who’s to say that it couldn’t be XML?

  • Brad Mead

    Does this mean the “all clear” has been issued for the Session object in web apps?

    ;-)

    As an admitted DDD slacker I support your choice in the spirit of the same notion of pragmatism that I took away from the Austin Alt.net AHA gathering a little over a year ago.

    Rock on.

  • http://codebetter.com/blogs/jeremy.miller Jeremy D. Miller

    @Mike,

    All I’m doing is storing the test data parameters, and that’s it. It’s not really representing a story ala RSpec. The data in the Xml does specify the test steps. There is both an Html representation for the test and the test results that IS meant to be human readable as an executable spec kind of thing.

    @Michael,

    Relax a little bit. Xml has gotten a deservedly bad reputation the past 3-4 years because we’ve used it in horrendous ways.

    @Cory,

    Indeed.

  • http://codebetter.com/blogs/jeremy.miller Jeremy D. Miller

    @All,

    Actually, the “Xml is uncool” issue is a real problem. I want to build something that other people would want to use, and Xml is definitely falling out of favor with the people most likely to use StoryTeller outside of my team.

  • Brian

    Despite what many in ALT.NET think – they don’t know everything, they aren’t always right, and just because they think it’s a good idea doesn’t make it so and vice versa.

  • http://www.lucasgoodwin.com Lucas Goodwin

    The XML story really only falls apart when people start using it as a programming language, such as NHibernate mappings or StructureMap’s old .config stuff. This same problem would occur if you used JSON, etc. Data formats do not a language make.

    The scenario you’re describing sounds like an example of programming in XML, but not knowing your intended usage of these XML files I can’t make a judgement call. A DSL may be a better solution in terms of representing your tests and the steps that need to occur, but you do give up good tooling too… Not a simple choice was it.

  • Ray

    If it makes sense to do it in Xml then do it. If anyone complains, tell them to send you a patch, isn’t that how it works? =)

  • lynn

    Good point. Every tool has it’s merit and can be abused – even the ‘cool’ ones.

  • Stephen

    xml might be overused, but the xml hate is even worse.. xml is overused.. that doesn’t mean never use xml, and especially doesn’t mean you should be desperately trying to find a alterate solution for something xml can do just fine..