TDD, I love you

Discussion of testing theory and practice, including methodologies (such as TDD, BDD, DDD, Agile, XP) and software - anything to do with testing goes here. (Formerly "The Testing Side of Development")

Moderator: General Moderators

User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: TDD, I love you

Post by Chris Corbyn »

matthijs wrote:Not sure if I would find form validation that interesting, as I think it's already pretty well-covered, with lots of examples using strategy patterns etc.
Agreed. Tackling something which is too obvious just makes the TDD seem pointless too. You're always thinking too far ahead.
matthijs wrote:Some other ideas might be:
- A model class. Not the traditional model class with a limited set of methods and data fields, but more flexible. Think Flickr-like tag data, gmail-like label data or the gallery tag idea from Onion2k (see here). I had some ideas and started writing them down but it got too long to post here so I'll keep it short for now.
I'm not sure if there may be a bit too much involved in this in order to run a live session in the forum. Sounds like there may need to be a lot known about the external environment (i.e. domain-level stuff). I'll have to read that thread to get a better idea of what you mean though :)
matthijs wrote:- Import/export classes. In many webapps nowadays with user generated data it's important to be able to exchange data. It's also important that users can easily export their data in different formats (.cvs, .txt, etc). So you could start simple with a limited set of datafields and one format and then expand that and see what happens.
Sounds like a reasonable task. Being able to transform data between XML, CSV, YAML etc you mean? Could be a nice well-partitioned task. It would also be very useful for something like configuration which can be in various formats too.

I'm relatively keen to avoid anything which needs to access a DB if this is to be an introduction.
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Re: TDD, I love you

Post by matthijs »

Chris Corbyn wrote:
matthijs wrote:Some other ideas might be:
- A model class. Not the traditional model class with a limited set of methods and data fields, but more flexible. Think Flickr-like tag data, gmail-like label data or the gallery tag idea from Onion2k (see here). I had some ideas and started writing them down but it got too long to post here so I'll keep it short for now.
I'm not sure if there may be a bit too much involved in this in order to run a live session in the forum. Sounds like there may need to be a lot known about the external environment (i.e. domain-level stuff). I'll have to read that thread to get a better idea of what you mean though :)
Yeah, I understand it's a bit too vague and big a subject. I started another thread about this in Theory and Design.
Chris Corbyn wrote:Sounds like a reasonable task. Being able to transform data between XML, CSV, YAML etc you mean? Could be a nice well-partitioned task. It would also be very useful for something like configuration which can be in various formats too.

I'm relatively keen to avoid anything which needs to access a DB if this is to be an introduction.
I didn't think so much about transformation between data formats, more like export data from one source (database maybe) to different other formats. But thinking about your remark some more makes me think it isn't a bad idea to do a more general transformation class(es). If you start with an array of data (could come from anywhere) and write something to transform that to other formats. The second step would be to be able take more formats as input. So you end up with a bunch of general transformation classes.

Indeed not dealing with a db would be a good idea.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: TDD, I love you

Post by Chris Corbyn »

Okie doke, so how about that last idea? An abstraction layer for a simple data store (configuration). CSV and XML/Yaml aren't very interchangeable when you've got more than one level of nesting, but XML/YAML/INI and arrays can deal with nesting pretty well I think.

Something which can read and write configuration files in various formats; even transforming from one format to another? Obviously we start with the very basics and work towards our more complex goals (transformations).

This isn't something I've ever tackled before (anybody else has?) so it would be a genuinely test-driven experience on my side too.

EDIT | Dammit... missed your post :P
georgeoc
Forum Contributor
Posts: 166
Joined: Wed Aug 09, 2006 4:21 pm
Location: London, UK

Re: TDD, I love you

Post by georgeoc »

I'd be interested in contributing to this kind of exercise. I like the suggestion of an XML/YAML/INI abstraction.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: TDD, I love you

Post by Chris Corbyn »

Ok, let's do it :) I'll start a new thread.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: TDD, I love you

Post by Chris Corbyn »

Post Reply