Search the web
Sign In
New User? Sign Up
testdrivendevelopment · Test-driven Development
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Is "Good" apply TDD on the GUI layout?   Message List  
Reply | Forward Message #799 of 32013 |
Re: [TDD] Emergent Design

This discussion has been about what design is; if refactoring can
be considered to be design; if emergent design is still design; and
lately has touched the subject of metaphor vs architecture. My ADSL
line is down so I haven't read the postings from the last eight
hours, so forgive me if I repeat things that have been said.
Anyway, here are some early morning thoughts:


STARTING OFF

You always start programming based upon some initial decision. In
some cases, you're unsure about the design, or just don't want to
ignore your preconceptions for a while, so you start coding
everything in one class, or maybe even keep the code within the
test class to begin with.

Or, you feel more sure about the concepts and therefore start off
with a few classes in mind when you start writing the tests. The
point is, you can't start with an entirely blank canvas. If you
could, you would do the equivalent of closing your eyes, whisking
your brush on the palette to pick up some random paint and start
beating the brush on the canvas for a while, then opening your eyes
to see what you've accomplished. Then you'd study the painting to
see where the it wants to go and continue in that direction.

I listened to a taped Alan Watts talk once where he mentioned an
art competition in Chicago, where each of the contestants got a
block of plaster of Paris to make a sculpture out of. I don't
believe you can say that sculptors NEVER sketch in advance; I have
seen documentaries where the sculptors indeed made sketches and
small prototypes before starting on the real sculpture.

Anyway, the winner of this competition didn't make sketches.
Instead, she said to herself that the sculpture didn't want to be
anything, that it had no ambitions. So she started to demolish it
with by whacking it with a hammer, or something, until see could
see a direction it was heading. Then she continued from there.

In the same talk, Watts also spoke about sculptors "making rocks"
for Japanese gardens, where they try to make the rocks "more
natural" by following their grain.

My point is that you always start with something even though your
ambition is to try to get rid of your preconceptions. Sometimes you
start really simple, and at other times you start with a set of
classes just to see if it works and what ideas you get from writing
the code. Sometimes you get the ideas as soon as you start writing
the tests; sometimes it takes a little longer.


THE BEST WAY TO GET GOOD DESIGN

Whatever you do you're going to end up with a design. If you think
very little about the design, you most likely won't have as good a
design as if you think more about it. I feel that this attitude of
getting started by writing some code to see where it's heading is
very powerful, but there are people who want to spend some time
with a sheet of paper or at the whiteboard before coding. Which way
you choose should be determined by which you find to be the most
efficient for yourself.

Several years ago I saw a documentary about a photographer, and I
think it was Helmut Newton. Anyway, his style of working was to
arrange for the shot, set up the lights, and so on - and then just
taking one photograph (or a few) and he was done. My feeling is
that most photographers fire off ten rolls of film and then hope to
find something good when they study the negatives afterwards.

You could say that Helmut Newton is better at getting good results,
but that wouldn't be true. Another photographer might be excellent
in selecting the best negative to print. They're just different
styles.

So, you might do a little "design" in advance or you might just sit
down at the keyboard with your partner and start typing. Whatever
you call what you do, you'll end up with a design. The point is to
get it good and to find out the best way for you to make it good.

I myself really liked to draw diagrams and discuss the design along
with a few others by a whiteboard, but now I feel that I can
accomplish better things by thinking less in advance and by
"distributing" my thinking evenly over the time it takes to
implement something. I really like to be able to ignore parts of
the problem until later, when I know more about the possible
solution.


ARCHITECTURE

And since architecture and metaphor was mentioned, I'm of the
opinion that architecture is metaphorical; that architecture is
"metadesign"; that no matter what you do, just as you end up with a
design without thinking much about the design, you end up with an
architecture without thinking much about the architecture. I also
think that architecture exists at all levels, not just at "10,000
feet".

Architecture, in my opinion, is something that is "about" the
design. It isn't just the really high-level design. That's what is
meant by "metadesign". When you evolve your design you do that
according to your architecture - even if you aren't that aware of
what your architecture is. And if you're unsure about which of two
possible design solutions is better, your architecture can guide
you.

Let's say you're an architect about to design a house. You just
know that your task is to design a house at this time - not what
KIND of house. Then you're told that you're going to design a
skyscraper. BANG! You have a LOT of information in just that one
word. A skyscraper IS an architecture. It conveys a lot of
assumptions, such as that it is a very tall building, with lots of
elevators and a lobby downstairs. If you felt at a loss about the
design at first, knowing that the architecture chosen is
"skyscraper" really gets you going!

Now let's say you're a programmer about to develop an online store.
This is something very common in our time and the "shopping cart"
architecture immediately comes to mind. Knowing this, you probably
think of having classes like ShoppingCart, Item, Purchase,
Customer, etc.

And let's say that you were about to develop the software for
Amazon back in 1995, so you started off with ShoppingCart and Book,
instead. Then after a couple of months the Amazon people tells you
that they are about to start selling CD:s, and that they by 2002
are going to sell stuff like patio furniture and the diaper genie
(one of this decade's most talked-about baby items).

So, you sit down and think for a while and decide to extract change
the Book class for an Item class. This is evolving your design
according to your architecture (which is "shopping cart" in this
case). If extending the store involves creating a lot of classes,
and you also have chosen the architecture "three tier", that helps
you to break down the solution into classes. For example, you
wouldn't let ShoppingCart deal with HTML stuff, since the
ShoppingCart belongs to the middle tier and the HTML to the top
tier.

Also, the architecture conveys the bigger picture instead of just
individual parts with collaborations (the design). If you know that
the architecture is "three tier", you know more about where you can
expect to find things. Design patterns are also architecture, if
you allow architecture to exist at all levels. Knowing that the
pattern is MVC tells you a lot - as does knowing that Façade and
Observer are used a lot.


CONCLUSION

You can't have no design. You can't have no architecture. You can
either view it as you "do" design or as you "let it emerge" - and
the same goes for architecture. Design is "in your face" while
architecture more easily "stays in your unconcious" - as you make
decisions about the design, you automatically follow some
architecture or "metadesign". I think that you benefit from paying
attention to the architecture as well as to the design, and the
style that I find to work best is to think about it little by
little all the time, instead of in large portions mainly at the
beginning.

/P.

--
Peter Lindberg
Computer Programmer, Sweden
mailto:peter@...
http://tesugen.com




Thu Apr 4, 2002 5:40 am

tesugen
Offline Offline
Send Email Send Email

Forward
Message #799 of 32013 |
Expand Messages Author Sort by Date

... Amen, brother... Dan ;-)...
Dan Rawsthorne
drawstho
Offline Send Email
Apr 3, 2002
7:36 pm

This discussion has been about what design is; if refactoring can be considered to be design; if emergent design is still design; and lately has touched the...
peter@...
tesugen
Offline Send Email
Apr 4, 2002
5:40 am

... Nice report! Ron Jeffries www.XProgramming.com I can't get no satisfaction. --Mick Jagger...
Ron Jeffries
ronaldejeffries
Offline Send Email
Apr 4, 2002
12:38 pm

... My current favorite metaphor for it is, design is teaching. Designing is the act of imparting knowledge to things. You do design when any kind of knowledge...
Laurent Bossavit
morendilfoo
Offline Send Email
Apr 3, 2002
8:36 pm

... I have been heard to mutter the following similar phrase at times: "Analysis is the process of discovery. Design is the process of invention." It could be...
John Goodsen
jgoodsen
Offline Send Email
Apr 5, 2002
7:12 am

Re: doghouses and design first scenario you are designing (lower case d) a doghouse. second scenario you are designing (lower case d) a model of a doghouse. ...
West, David
nmdaveus
Offline Send Email
Apr 3, 2002
4:49 pm

Dave, How does design or Design differ from XP's metaphor? Does Design == BUFD? If I model a few classes, some statecharts, and interaction diagrams so that I...
Mark van Hamersveld
mvanhamersve...
Offline Send Email
Apr 3, 2002
5:02 pm

"How does design or Design differ from XP's metaphor? Does Design == BUFD? If I model a few classes, some statecharts, and interaction diagrams so that I can...
Kent Beck
kentlbeck
Offline Send Email
Apr 4, 2002
7:20 pm

... You can understand what a system is meant to do before coding. In XP you use stories to determine what the system should be. Whether you need to understand...
Rob Diana
rob_diana
Offline Send Email
Apr 4, 2002
8:05 pm

<Peter> ... </Peter> According to my understanding of TDD, you aren't thinking about those other classes and methods until you have a piece of test code which...
Mark van Hamersveld
mvanhamersve...
Offline Send Email
Apr 3, 2002
4:52 pm

I would never insinuate that anyone on this list is a closet RUPer. design (lower case d) IS creation. artists are able to sell sketches (or dealers are able...
West, David
nmdaveus
Offline Send Email
Apr 3, 2002
4:57 pm

... Consider Kent's thinking before implementing multiple-currency arithmetic, TDD18Mar2002, p. 53 and following. (Yes, I know I'm a draft or two behind... :)...
schroeder@...
benschroeder2
Offline Send Email
Apr 3, 2002
5:29 pm

Funny you should ask about metaphor - I am presenting a paper on metaphor, architecture and XP and XP2002 in Italy next month. So, I have to give you two...
West, David
nmdaveus
Offline Send Email
Apr 3, 2002
6:16 pm

Dave, Unfortunately I will not be attending XP2002, however, I would be very interested in reading your paper. Have you posted it for public consumption? Mark...
Mark van Hamersveld
mvanhamersve...
Offline Send Email
Apr 3, 2002
6:27 pm

I'm starting my fifth XP project in a little over 2 years now. The 'Metaphor as Architecture' has always been one of the fuzzier concepts to master for me....
John Goodsen
jgoodsen
Offline Send Email
Apr 5, 2002
7:18 am

... If a thousand monkeys typed for ten thousand years and produced the works of Shakespeare in chronological order? What if the first day, they typed the...
Ron Jeffries
ronaldejeffries
Offline Send Email
Apr 3, 2002
6:42 pm

original draft of paper attached - copyright has been assigned to XP2002, so this is for your own personal use, no further distribution please. (The ...
West, David
nmdaveus
Offline Send Email
Apr 3, 2002
8:54 pm

From: "dhemeryy" <dale@...> ... What if the designer intended to create a tangled mess of code? What if they set out to make everything depend on...
Kyle Cordes
kylejcordes
Offline Send Email
Apr 4, 2002
4:59 am

Hi Kyle, ... I've never seen people do that. ... I've seen plenty of that. Those people never satisfactorily solved the problems *I* wanted them to solve. So...
dhemeryy
Offline Send Email
Apr 4, 2002
7:24 am

... I see two meanings of "good" here. Ron uses the phrase "good design" to mean some abstract notion of goodness. A good design is one that permits freedom of...
J. B. Rainsberger
nails762
Offline Send Email
Apr 5, 2002
2:33 pm

... Yes. In my discussion I'm assuming suitability to task. Dale is entirely right to broaden the considerations ... ... All programs need to be Dale-good, or...
Ron Jeffries
ronaldejeffries
Offline Send Email
Apr 5, 2002
2:45 pm

Hi JB, ... It would surprise me if that were true. Ron seems to greatly prefer notions grounded in tangible experience. ... I see that as very practical, and...
dhemeryy
Offline Send Email
Apr 5, 2002
5:42 pm

I just found this and decided to send it, even though it is dated. ... What if a thousand monkeys typed for ten thousand years and produced the works of...
Ron Jeffries
ronaldejeffries
Offline Send Email
Apr 12, 2002
1:55 am

... But was that really the *right* thing for the job? What if that English feller messed up, and the actual Absolutely Perfect Play goes: A glooming peace...
Bill Tozier
Vaguery
Offline Send Email
Apr 12, 2002
5:08 am

Perhaps Design (in the software sense) is a response to fear? You're afraid that you won't be able to deliver this software you've promised, or worried that...
darren.hobbs@...
darrenwhobbs
Offline Send Email
Apr 12, 2002
8:49 am

... Ahh, but see: it's enabling for me when *I'm* wrong and can learn from it. But when other people are wrong, well I already know it, so what can I learn?...
Bill Tozier
Vaguery
Offline Send Email
Apr 12, 2002
6:58 pm

... You can learn to improve your team's process so that the others on the team know what you know (and you learn what they know). -- Vennlig hilsen Syver...
Syver Enstad
syvere
Offline Send Email
Apr 13, 2002
6:38 pm

At the end of the money example, I'd REALLY side to see the full sources to the test-class and production-classes... To visualize that chart of changes... You...
C. Keith Ray
attkeithray
Offline Send Email
Apr 14, 2002
8:37 pm

Page 85 "..., probably six hours in all, ..." I worry that a manager would look at this forbid his programmers from doing this TDD stuff, because it...
C. Keith Ray
attkeithray
Offline Send Email
Apr 14, 2002
8:49 pm

... I sometimes worry about this as well. Mostly I don't, because unless he's actually pairing with you, to stop you doing TDD, a manager would have to stop...
Darren Hobbs
spinyfishcom
Offline Send Email
Apr 14, 2002
9:27 pm
 First  |  |  Next > Last 
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help