ArticleS. TimOttinger.
MotherMayI [add child]

Mother May I?


The way the game goes, you are told what to do, but you first must ask "Mother, May I".

This is the feel for design-driven testing (DDT), as opposed to TDD. You work through the user story, then picture the code you want to write, then you try to come up with a test that mandates that you write that code. It's "mother may I" in a pathological sense. It's a lot like solution-problemming, rather than problem-solving.

Perhaps it would be better to use TDD, where you write the requirements, and then figure out how to "trick" the code into doing what you want cleanly. As one is closing in on tdd it is a very easy trap to fall into.

The good news is that you can learn to recognize the Mother-May-I game and try to reform it quickly.

!commentForm
 Wed, 8 Feb 2006 11:04:31, Tim Ottinger, Clarifying
There is a hiring practice that follows similar lines. A company wants to hire a specific person in order to fill a position, but is required by law to post the job advertisement publically and consider all applicants. Instead of posting the qualifications of the job, they post the unique attributes of the person they want to hire. So you end up with a job advertisement for an accountant who speaks three specific obscure languages, has published grad school papers on the use of the flatted fifth in South African folk music, waterskis, and has six fingers on one hand. Of course, only one qualified individual applies, and the job is filled.

Mother may I is about testing that the components of your design exist and are hooked up in a certain way, rather than checking that some requirement of the system is fullfilled. You presuppose a given design, and test for structure instead of behavior.
 Sun, 6 Aug 2006 11:18:35, leoyang, haha
i found this article from <a href="http://www.howtd.com>how to do</a>,thanks
 Sun, 6 Aug 2006 11:23:15, leoyang, aha!
i found this article from <a href="http://www.howtd.com">how to do</a>,thanks