Slashdot Mirror


Test-Driven Development by Example

PinglePongle writes "Kent Beck is well known as one of the main drivers behind eXtreme Programming -- a style of development which favours a very disciplined but low-formality approach to coding. Writing applications 'test-first' is one of the practices of XP, and this book explores the subject of test-driven development in detail." Read on for the complete review. Test-Driven Development by Example author Kent Beck pages 220 publisher Addison Wesley rating Superb reviewer PinglePongle ISBN 0321146530 summary Kent Beck -- author of the original Extreme Programming book -- explains in detail how to turn your development world upside down by starting with the test, then writing the code.

What it's all about: Test-driven development is about being able to take tiny little steps forward, test that the step took you in the right direction, and repeat. The "TDD Mantra" is red/green/refactor:
  • Red: write a test which will exercise a feature, but which will fail (because you haven't yet written the code)
  • Green: make the test succeed, doing whatever you need to do to get to "green" as quickly as possible -- don't worry about prettiness
  • Refactor: now that you have code which passes the test, eliminate all the duplication

The book then shows 2 fairly detailed examples of a development project (or snippet of a project) which progress using this style of coding. The first example deals with the creation of multi-currency capabilities for an existing project. In the space of 17 chapters, the author walks you through the creation of 6 classes (1 test class, 5 functional classes), complete with the thought-processes behind them. The code is written in java, and is trivially easy to follow, because it gets introduced in tiny little chunks; most chapters are less than 6 pages in length.

The second example is the creation of a unit testing framework in Python. It is significantly more complex and real-world than the first example, but again proceeds in very small steps, and in small chapters.

The final part of the book contains patterns for test-driven development -- practical real-world advice on how to do this stuff for real. Nearly all the "patterns" are phrased as question/answer pairs, and they range from deeply technical design patterns to advice on the best way to arrange the furniture.

What's good about the book? Kent Beck is a very good writer -- his writing is clear, he is not afraid to leave out stuff he assumes you can guess for yourself, but when he does go into detail you feel it is necessary to get the big picture, rather than mere geek bravado. Even if you don't adopt Test-Driven Development, many of the ideas are well worth considering for your day-to-day coding situations.

What could have been better? The book stresses the importance of taking 'little steps,' and sometimes you feel impatient to move to more challenging tests before properly finishing the current chapter. I was also hoping for more of a discussion on the practicalities of unit testing database-driven systems, where you frequently have to test business entities which are closely coupled to the database.

Summary If you code for a living, or manage people who do, you should read this book -- it's a quick enough read -- and consider some of the assertions it makes. If you feel you're introducing more bugs than you expected, if you feel uneasy about how close your work matches the requirements, this book gives you some powerful ideas. You can purchase Test-Driven Development by Example from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

189 comments

  1. I always test drive my apps by Amsterdam+Vallon · · Score: 5, Funny

    Although it sucks to lose 20% of your code when you drive it off the lot.

    --

    Reply or e-mail; don't vaguely moderate. Ex-O'Reilly/MIT employee, now a full-time Google employee.
    1. Re:I always test drive my apps by josh+crawley · · Score: 1

      Yeah, and if your code's GPL'ed, It doesnt depreciate any.

    2. Re:I always test drive my apps by Anonymous Coward · · Score: 0

      I always test before I write my code. Not finding any bugs, I can then proceed safely to implementation and delivery. I can safely say I have never found a bug yet!

  2. XP by Anonymous Coward · · Score: 0, Funny

    I don't like ESPN's eXtreme Programming, but now that the NFL is over, I don't have much of a choice.

  3. hopefully... by EnderWiggnz · · Score: 2, Redundant

    hopefully, this will last as long and have as big an impact as extreme programming did.

    for the sarcasm impaired : this is sarcasm.

    --
    ... hi bingo ...
  4. sounds great but... by John_Renne · · Score: 1, Insightful

    Once my manager came in with the buzzword eXtreme Programming. I read a couple of articles, I tried it but what a disaster. I just can't stand other people nozing around in my half completed code, the extreme attention to testing and the team-spirit you ought to have. Needless to say the experiment failed and things went back to normal :-)

    --
    /(bb|[^b]{2})/
    1. Re:sounds great but... by Anonymous Coward · · Score: 0
      the extreme attention to testing

      Which, of course, is perhaps the most important part of any software project.

    2. Re:sounds great but... by Peyna · · Score: 2, Interesting

      XP has worked in some small scale applications pretty well. It isn't for every project or every person, but in some cases it can be very effective, and in others (as you stated) it can be a disaster.

      I think it's great that there are new ideas for ways to develop software, (although XP is actually fairly 'old' in computer science terms). There is no magic formula for producing quality software in a reasonable amount of time yet, but XP is another step in the right direction.

      Note: While XP's entire methodology wasn't written down until about 1996, many of the ideas that it uses had been in circulation since the 70s.

      --
      What?
    3. Re:sounds great but... by Anonymous Coward · · Score: 1, Funny

      Lucky! Had the buzzword bingo won out, they'd replace you with 12 hard-working yet inexpensive immigrants. Of course, the 12 immigrants wouldn't produce any results faster or better, but they sure look busy! And the respect the boss gets! Those immigrants sure know how to run around and bow to the boss! Run! Run! Or I'll call the INS!

    4. Re:sounds great but... by Lumpish+Scholar · · Score: 4, Insightful
      I just can't stand other people nozing around in my half completed code ...
      Then you ought to (1) try the other XP practices before you try pair programming, and (2) learn how pair programming really works!
      ... the extreme attention to testing ...
      You don't think testing is important???
      ... and the team-spirit you ought to have ...
      Check out the work of James O. Coplien. He's an extremely hard core C++ guy, but when he was doing research at Bell Labs, he descovered that organization effectiveness was far more important for software development productivity than any technological advance.

      I once worked at a start-up where someone started on Monday, and never came back after Wednesday night, leaving a voice mail message that said, "You never told me I was going to have to work with other people!"

      You're going to have to work with other people. The better you work with them, the better you work, the better everyone works. (Hugs not required.)
      --
      Stupid job ads, weird spam, occasional insight at
    5. Re:sounds great but... by Anonymous Coward · · Score: 0
      I don't know about you, but given the two alternatives:

      1) Hire all-American coders who can code well and speak/write (sort of) English, but who are more expensive, more prone to throwing a temper tantrum for not having been given a snarf gun to play with and some of whom behave as if they could run my company just because they can code in their sleep.

      2) Hire immigrant coders who can code well and speak/write English (sort of), don't have the ridiculous expectations regarding the pay as the US coders do, work hard instead of wasting the company time on browsing the net or whining for toys and who give the employer the respect he/she deserves for hiring them.

    6. Re:sounds great but... by October_30th · · Score: 4, Interesting
      You're going to have to work with other people. The better you work with them, the better you work, the better everyone works. (Hugs not required.)

      I couldn't agree more.

      I can't think of many jobs - at least for college/university educated people - that do not require soft skills like ability to work with your coworkers and communication (meetings, presentations, acting as a tour guide for VIPs, etc.).

      I used to hate having to deal with other people any any way. In fact, that was one of the reasons why I decided to embark on a research scientists (Physics) career. As a scientist I wouldn't have to deal with people, give talks, socialize or - most imporant of all - end up in any kind of a manager/boss line of work. I would just sit, think and write papers. That's what I thought and boy how wrong I was.

      Most science, and experimental physics in particular, is done in groups. There's no way around it. You can't run a lab alone so you need to have people around you. Even as a postdoc you have to be able to hire good PhD candidates and supervise them. You have to be able to interview them, understand what makes each of them tick at workplace and how to manage them to get the best out of them.

      Then, unless your lab is established and extremely well funded, staffed and equipped, you often need collaboration from other groups. Making contacts with other scientists and establishing mutually beneficial collaboration requires publicity (talks!), diplomacy (socializing!) and patience.

      A person who cannot work with other people simply does not fit into this environment. No matter how brilliant scientist he is, without the social skills he is very likely to turn out as nothing.

      I still get slightly nervous when I have to a give a talk. I still don't like meetings. However, I have grown fond of managing people, because, as difficult as it sometimes can be, it's a wonderful feeling to see your highly motivated and skilled people working with you in harmony. The older I get the more I appreciate social skills over raw intelligence or mathematical/logical ability. If it all comes in one package, jolly good. However, if I had to choose between a budding physics genius with a highly abrasive personality and a slightly well performing person with good social skills, I'd choose the latter. No question about it.

      --
      The owls are not what they seem
    7. Re:sounds great but... by Anonymous Coward · · Score: 0
      (Hugs not required.)

      Sounds like my marriage. :-)

    8. Re:sounds great but... by jstoner · · Score: 2, Insightful

      Check out the work of James O. Coplien. He's an extremely hard core C++ guy, but when he was doing research at Bell Labs, he descovered that organization effectiveness was far more important for software development productivity than any technological advance.

      This is exactly the point the XP people are missing. All the practices they prescribe require a very sound organizational culture. Unusually sound. If you already have that in place, then XP might enhance your organization's performance. But if you already have that in place, you've already solved a long list of much harder problems.

      And don't get me started on the requirements gathering end of the process: in full XP, you have to collaborate tightly with your business stakeholder folks. You have a problem with the other developers in your own department? Wait till you have to deal face to face with the idiot from marketing or the arrogant ass from finance. A lot.

      --

      'In knowledge is power, in wisdom humility.'
    9. Re:sounds great but... by Anonymous Coward · · Score: 0

      I am perfectly happy dealing with colleagues and customers, in various social and business situations. But that isn't pair programming is it? In pair programming someone is going to be looking over your shoulder *all the fucking time*. Never any time to stare out the window, organizing your thoughts. Never a moment to catch your breath reading slashdot. Always having to apologize for bathroom breaks. Always having to explain every semicolon, every accolade you write.

      I'm not some anti-social unwashed idiot, nor do I have anything to hide wrt. the source that I create. But I do not need or appreciate some individual, any individual, hovering about me all the time while I am working, whether it is deep algorithms or just cranking out a lot of code quickly. There are many excellent times for interacting with other people, but not while doing the mental exercise known as programming.

      I'm sure I'd be extremely productive when doing pair programming for the first three days. But at the end of the third day, either I'd be burned out, or in jail for killing someone.

      After all this ranting I'm still curious: has anyone here ever done it? What did you like/dislike about it?

    10. Re:sounds great but... by chromatic · · Score: 2, Interesting

      On one project, we had a bug that would always cause a segfault at shutdown. No one had ever been able to track it down -- it wasn't hurting anything as far as we could tell, but it was highly annoying. This was a very small shop and we were just starting XP (or any determinable development process, for that matter), so we hadn't been doing much in the way of pair programming anyway.

      Myself and another developer tried pairing to find the bug. We talked it out briefly, and decided to do a binary search of the code with print statements (as the debugger couldn't find it). We'd start the program then exit it, trying to find where in the shutdown process the bug was.

      We went over the logs together, and the first person to narrow down another potential location. I'd suggest a spot and add a print statement there, then he'd suggest one. We'd then run the program again, collect our logs, and start over. If I got stuck, he'd have an idea and vice versa.

      It took us about ten minutes to track it down and figure out exactly what was going on. I'd spent a couple of hours on it alone without making any progress before, and I think he'd done the same. If we'd paired on that before, we'd have saved a bit of time and money.

      I'm not sure where you get the idea that pair programming is having some slob sit behind you and breathe over your shoulder. In my experience, it's like having a conversation about code that produces working code. If you can give up the idea that you have to be right and that your way is the best way and, for goodness' sake, hand over the keyboard about half the time, you'll probably find it's a lot more productive and even more fun than working alone.

    11. Re:sounds great but... by vbweenie · · Score: 1
      The older I get the more I appreciate social skills over raw intelligence or mathematical/logical ability. If it all comes in one package, jolly good. However, if I had to choose between a budding physics genius with a highly abrasive personality and a slightly well performing person with good social skills, I'd choose the latter. No question about it.

      "Good social skills" is a bit broad. I know some fairly brilliant people whose social style is unconventional, and rubs some people up the wrong way. They don't have what you would call good social skills, in the sense of being able to make just anybody feel at ease with them on first acquaintance. They take some getting to know. And once you get to know them, they're great: great to work with, often hilariously funny, and still just as brilliant.

      Think of it this way (for a moment, if you will...). Good teamwork requires trust. People with good social skills build up a superficial level of trust quickly, and deeper levels of trust over time. Good people with less good social skills are not as adept at building up that superficial level of trust, but once a trust-relationship has been established will often tend to be extremely loyal and "other-orientated". It often turns out with very brilliant and somewhat idiosyncratic individuals that they have a few absolutely sustaining relationships with a few very trusted other people.

      In the right circumstances, these people are dynamite: and a lot of them go into the sciences looking for that kind of social dynamic (as well as truth, intellectual adventure and the advancement of human knowledge, of course). If "good social skills" are a prerequisite for advancement everywhere and all the time, then these people are going to find it almost impossibly hard to make an entry. That's actually what a lot of them are afraid of.

      Prima donnas are another matter, and I've met one or two of those as well; but those are people with positively malignant social skills, rather than people who are simply awkward or retiring. You don't want those people anywhere near your team because they will drive everyone else crazy; and in that case, I agree with the above poster, it really doesn't matter how brilliant they are.

      --
      Experience is a hard school, but fools will learn no other.
    12. Re:sounds great but... by Anonymous Coward · · Score: 0

      Pair Programming is a really, really STUPID idea, and is for the really, really STUPID programmers who want an authority figure to tell them exactly what needs to be done, and you have some one else by his side to make sure he dosent screw up. This is exactly the type of person you dont want in your group. If you need some one else to look over your should while you program to catch your errors, you probably should look for another job that is more suited for your skill levels, like maybe developing web pages with HTML.

      Testing is important, thats why you do your own testing before giving it to QA. Writing code to do GUI testing is the dumbest idea I ever heard of. Writing correct code is much better than writing test code to look for your mistakes. After all, when dealing with these stupid XP developers, how do you know that the test code they wrote to test the code dosent have bugs? This, however, dosent mean that you shouldn't write ANY test code, just that you write test code where it makes sense, just as any body working without XP normally would. As you become a better developer you will realize how stupid your remarks are that XP is the xavior... it is infact the devil.

      Working with others is always important, and it has nothing to do with a methodlogy. Whenever a methodology tries to group it as one, you know its a bullshit methodology, and XP tries to do this. When you work with a group of individuals that are skilled in what they do, you work effectively by respecting and communicating with each other. There is no need for one to look over the shoulders of the other to nitpick every charactor typed.

      It all boils down to knowing programming as opposed to thinking you know how to program. Having a good team of people is a must for every project, but dont give credit to XP for that, its always the people that deserves that credit, not a stupid process.

  5. Good by giel · · Score: 2, Insightful

    I think we must try to get rid of wanting to design and plan every little thing in front and then find out stuff doesn't work ending up running out of time and in the end having noone willing to pay for all useless efforts.

    Although many people don't believe in XP it is a way to accomplish development in such a way you do get deliverables. Maybe it does not improve speed but it does improve quality and reduce risk.

    So any book which is able to explain the pro's of XP and open eyes of non-believers is good.

    --
    giel.y contains 2 shift/reduce conflicts
  6. What the XP folks have right (and wrong) by thac0 · · Score: 5, Insightful

    The reason some XP projects are successful is because they actually have testing as part of the game plan. It is *shocking* to me, having been in the industry for better than a decade and pounding code for 20 years, the state of testing in corporate america. Just atrocious.

    There are many labs that don't test at all, and a vast majority test poorly. I've worked in some fortune 500 labs that didn't test at all. Scary stuff. Nothing life threatening, but all of a sudden I wasn't so convinced that the reason my account was misconfigured was because *I* gave wrong data. Simply bug riddled. Those that do test often do so manually. Forgetting for a moment that humans are likely to take short-cuts and not bother to execute tests they perceive to be out of the scope of their recent change, they are failable. Of course they are, that's how the bugs got there in the first place.

    So, the XP folks have the testing thing down. They test before the code is written, and their tests are automated.

    Then they take leave of their senses. The claim that because they've successfully turned one idea on it's head (i.e. testing *first*) that they can turn others is ludicrous. Design first is still valuable guys. I've eliminated thousands of bugs simply by having the right design to begin with. Waiting until you've cobbled something together that passes the test and then hoping that your boss will allow you to refactor is a loser. If it weren't Scott Adams wouldn't be a millionare.

    So, write your tests first. But do your design before you code, not after you've put together a thousand lines of crap.

    --
    poliglut.org: they're still alive and fighting the man
    1. Re:What the XP folks have right (and wrong) by Lumpish+Scholar · · Score: 4, Insightful
      ... some XP projects are successful is because they actually have testing as part of the game plan.... the XP folks have the testing thing down.
      The best thing about XP is that, with the possible exception of test-first (a.k.a. test driven) development, none of the practices are new and original. I mean that in the best possible way! All the practices are tried and true, based on experience long before Kent Beck was using the word "extreme" this way.
      Then they take leave of their senses.... Design first is still valuable ...
      "Design" in the pure waterfall sense -- do 100% of the requirements before doing any of the design, do 100% of the design before doing any of the coding -- doesn't scale up to large projects or rapid development. It's important to use an iterative approach: do a little analysis, do a little design, do a little coding, do a little testing, repeat until done.

      XP breaks the design/coding/testing cycle into very small iterations, each one as big as one automated unit test case. It's a very exploratory style of software development. XP doesn't mandate any high-level design artifacts (though it doesn't forbid them either).

      What none of the XP books say is that developing unit tests is a design activity, and the unit tests are design artifacts! Unit tests outline the responsibilites of classes, in the original responsibily-based style of object oriented design.

      XP programmers do design on whiteboards, and in their heads. Some of these artifacts are lost. Some would have become obsolete in a hurry. (The unit tests are guaranteed not be obsolete, at least as long as they're passing.)

      I'll take that, any day, over a hundred pages of out-of-date UML diagrams.
      --
      Stupid job ads, weird spam, occasional insight at
    2. Re:What the XP folks have right (and wrong) by Anonymous Coward · · Score: 0

      It's about time that you software monkeys are subjected to even 10% of the rigor that hardware types are held to.
      You monkeys just pound away at the keyboard, copy and paste, get a faster processor, and you're a genius.
      Funny how software can crash, no one cares, but if a processor has *one* tiny, little flaw in a feature that's almost never used, there's almost a revolt.
      See the difference? I'm glad you software types will have some sort of accountability.

    3. Re:What the XP folks have right (and wrong) by sohp · · Score: 1

      In a way you are right: don't throw together a thousand or ten thousand lines of test code for testing's sake.

      You missed one thing though: Test-first is design. The tests don't just ensure that the thing works as written, they define how the thing is intended to work, and in order to write a test that exercises that aspect, you have to think about what problem the code is supposed to solve. This results in the test being the thing that validates the features of the code under test, and by definition, the features of the code are its design.

    4. Re:What the XP folks have right (and wrong) by William+Tanksley · · Score: 1

      So, write your tests first. But do your design before you code, not after you've put together a thousand lines of crap.

      The name of the practice is either Test Driven Development or (more commonly) Test Driven Design. I think it's a bad name, because it leads to the sort of confusion you have.

      The tests they're talking about ARE design, so by writing them before you write code, you are, in fact, designing before coding. The difference is twofold: first, instead of stopping the design at an arbitrary level of detail and going to some other part of the program, you continue the detailed design until it produces code for that part of the program; second, instead of writing your design in an ignorable form, you write it in a simple, immediately testable form.

      Because of the first difference, you get to implement your design while it's still fresh in your head; because of the second, your implementation will be forced to match your design.

      I've worked with TDD for about a year now. It's a real winner -- mainly because it makes testing a creative, constructive activity (part of design) instead of destructive gruntwork (intended to tear down parts of your program).

      Waiting until you've cobbled something together that passes the test ... is a loser.

      Waiting? That's exactly the point -- you DON'T wait. You implement the solution needed to pass the test (i.e. the design) immediately, as soon as you've managed to express your design in a testable form. You get to see immediately whether or not your design is workable, before you build some other aspect of your design on it. ...hoping that your boss will allow you to refactor is a loser.

      I've worked TDD both with and without refactoring. It works either way -- without refactoring I have to take a few more risks, code a little slower, and accept slightly lower quality overall code (i.e. it doesn't fit together quite as well; refactoring doesn't slow me down at all. The nice thing is, though, that it's not under the control of my boss, anymore than which shift key I use is under his control. I don't send a unit in to Configuration Management until it's ready to roll; so within that unit, I refactor at will. (We're a CMM level 3 organization.)

      Amusingly enough, the only criticism I get from my boss is that I _may_ be testing too much. Literally. He's not sure, but he's a bit nervous that I might be testing outside of the needed range -- for example, testing for negative numbers when the only allowable input is positive (he hasn't read my tests, and I don't think he can even imagine tests being something he'd want to read). You should see his tests -- but that's a different story.

      -Billy

    5. Re:What the XP folks have right (and wrong) by dubl-u · · Score: 2, Interesting

      So, write your tests first. But do your design before you code, not after you've put together a thousand lines of crap.

      If you've written 1000 lines of code before you refactor, you're waiting way too long. I do little refactorings every few lines, and bigger ones whenever things don't look right.

      Look at it this way: you can do your design before you code, while you're coding, or afterwards. The waterfall advocates about 80:20:0. But that assumes that you learn nothing, think of nothing when coding. That's stupid; instead, what people do is grumble and imagine what they'll do in the next version.

      Now that I'm doing test-driven development, my ratio is about 20/30/50. I still do some design up front, and that's very valuable. But instead of having those raging arguments about what design might work best, we start building and find out, refactoring towards the best design as we go.

      Waiting until you've cobbled something together that passes the test and then hoping that your boss will allow you to refactor is a loser.

      If a boss is such a micromanager that he's telling you which lines of code to work on every 15 minutes, then it's time for a new job. The people I work for recognize that I'm a professional and trust me to tend to my business, especially given how willing I am to explain it to them.

      When bosses ask about refactoring, I explain that we do it so we can go faster. If they think it's a net loss, then I am always glad to prove them wrong: if they want to measure productivity each month, we can see which way works better.

      Think of it this way: not refactoring is like not exercising: you get slower and slower, everything gets creaky and unreliable, and you die sooner because your arteries are clogged. A little regular exercise keeps you healthy, limber, and active.

    6. Re:What the XP folks have right (and wrong) by jmccay · · Score: 1

      I don't have a lot of experience with XP and TDD, but from what I have seen, only a little of it impresses me. I like the idea of writing the tests as you go along, but some of the "small" steps I've seen in examples are stupid. For example, writing the test but not completely filling in the frame work for the code the object being tested.
      In one example I saw, the person wrote the test and the frame work for the function, but didn't write the skellital frame work of the class which contained the function used in the test. They also didn't put in any of the includes/imports that was needed. Instead, they compiled it and added it after the compiler told them these things didn't exist--kind of stupid when you knew it was needed before you compiled.
      To me that's too small a step. I can see the benefit in taking small steps, but not taking microsteps. Also, I can see using the compiler errors as a sort of to-do list, but I can't see wait to put something in like a framework and/or includes when you know they are required. That seems excessive and a waste of time.
      In some ways this is just a rehash of the methodolgy of structured programming. The way I was taught to break thigns down was to write the higher level code first, and this meant writing empty functions (or functions that return a constant). After that was done, you'd go back and fill in the code in increments. This just seems to be a rehash of that idea--which seemed to get lost mess when the OO craze started.

      --
      At the next eco-hypocrisy-meeting, count the private jets used to get to the meeting. Should be interesting to see that
    7. Re:What the XP folks have right (and wrong) by tcopeland · · Score: 1

      You wrote:

      > I've eliminated thousands of bugs simply by having the right design to begin with.

      Have you? How do you know that?

      Yours,

      Tom
      http://pmd.sf.net/

    8. Re:What the XP folks have right (and wrong) by Ed+Avis · · Score: 1

      Yes, do your design before your code, but you will _still_ need to refactor, partly because requirements change, but also because after doing some implementation you may realize the original design was not quite right.

      That much I think is not contentious. Very few people (even those with experience) can pick the ideal design ahead of doing any implementation or predict what the changes in requirements will be.

      More controversial, perhaps, is the XP idea that your initial design should not be any more general than it needs to be to implement the functional requirements of your first code drop. There is some merit in this, since the requirements _will_ change and unused generality is often a waste of coding effort (not to mention creating extra complexity which may not be tested enough), but still I feel you have to use common sense and often design for extensibility at the start, even if you are not 100% certain the extra flexibility will be needed. You might be 50% certain and that is often enough.

      But I do feel that the XP approach fits in with my personality. If there is no bus approaching bus stop, I would rather walk to the next stop than wait for a bus to come along, because at least I am making some small progress and this journey strategy minimizes risk, even if the mean journey time is shorter by waiting around at the bus stop.

      --
      -- Ed Avis ed@membled.com
    9. Re:What the XP folks have right (and wrong) by William+Tanksley · · Score: 1

      I like the idea of writing the tests as you go along, but some of the "small" steps I've seen in examples are stupid. For example, writing the test but not completely filling in the frame work for the code of the object being tested.

      Yes, that's an example of an example trying to make a point: it's very easy to run the tests, so you'll often run the tests before the code's ready to compile. In real life, this happens a lot, no matter how silly it looks in a book: it's way more expensive to put in too much functionality than it is to put in too little, since if you put in too much your tests won't complain.

      BUT, you don't have to do that. The #2 rule in the Pragmatic Programmers book is "THINK!" Good advice -- don't turn your brain off.

      In some ways this is just a rehash of the methodolgy of structured programming. The way I was taught to break thigns down was to write the higher level code first, and this meant writing empty functions (or functions that return a constant). After that was done, you'd go back and fill in the code in increments. This just seems to be a rehash of that idea--which seemed to get lost mess when the OO craze started.

      I see what you mean, but although this provides some wonderful support for top-down programming, it's not what it is or requires. It's just as easy to start in the middle and design outwards.

      -Billy

    10. Re:What the XP folks have right (and wrong) by thac0 · · Score: 1

      All the practices are tried and true, based on experience long before Kent Beck was using the word "extreme" this way. There are two things wrong with this statement. 1) The same script doesn't work in all contexts. 2) It isn't possible to objectively measure 'best' practices for software projects. So, one might claim that testing first and then anarchy works well. One might even claim that it works better than anarchy and test last. But it is difficult to claim that it works best. "Design" in the pure waterfall sense -- do 100% of the requirements before doing any of the design, do 100% of the design before doing any of the coding -- doesn't scale up to large projects or rapid development. Right. This is why it's been ten years since most mainstream development used this model. It doesn't scale well and wasn't what I was suggesting. What I was suggesting was that design through coding isn't as effective as design through explicit design. Or, design then code, don't code then design. XP breaks the design/coding/testing cycle into very small iterations, each one as big as one automated unit test case. Right. And just as waterfall doesn't scale to large projects, neither does XP. The reason that waterfall doesn't scale is because people can't know everything up front and design based on that comprehensive set of knowledge. The reason XP doesn't scale is because it results in code that has no high level design and thus is very difficult to enhance and maintain. Ask the kids on mozilla about that one. It took them better than two years to get the open source project rolling in no small part because of this issue. What none of the XP books say is that developing unit tests is a design activity, and the unit tests are design artifacts! No, the tests are controls that verify a contract. The contract is the design. So, while you are partly correct (i.e. *some* design must take place before the test is written, and that test is derived from that design), it is the fact that this designing of software isn't explicitly called out until code is written that is very troubling for anything but the smallest applications. I'll take that, any day, over a hundred pages of out-of-date UML diagrams. And I'll take a well run project over an anarchistic herd any day. In particular, I'll take the source code and UML bindings that good design tools provide (e.g. Rose) in a heartbeat. You're right, antiquated design artifacts is worse than useless. It can actually cause problems. But that doesn't mean we should throw the baby out with the bathwater.

      --
      poliglut.org: they're still alive and fighting the man
    11. Re:What the XP folks have right (and wrong) by thac0 · · Score: 1

      You missed one thing though: Test-first is design.

      That may be what the XP folks say, but it's a half truth at best.

      Test first, if it tests any design, only tests the interface design.

      That isn't sufficient and it isn't something that 'falls out' of continually peeling the onion and designing interface after interface and test after test. Design is a higher level thing and it isn't considered carefully enough in XP.

      --
      poliglut.org: they're still alive and fighting the man
    12. Re:What the XP folks have right (and wrong) by thac0 · · Score: 1

      If you've written 1000 lines of code before you refactor, you're waiting way too long. I do little refactorings every few lines, and bigger ones whenever things don't look right.

      Then, arguably, this isn't refactoring but something simpler.

      In any case, to leave terminology aside, my point is that design is a higher level thing that helps 100K lines look, feel and behave similarly. XP doesn't address this well.

      If a boss is such a micromanager that he's telling you which lines of code to work on every 15 minutes, then it's time for a new job. The people I work for recognize that I'm a professional and trust me to tend to my business, especially given how willing I am to explain it to them.

      It may well be that changing jobs isn't an option. But this comment is utterly orthogonal to what I was saying anyway.

      See above, I wasn't referring to the small work units. I agree 100% that the XP ideas work really well on the time scale of a day or a week, but they don't scale to a project or a large team.

      --
      poliglut.org: they're still alive and fighting the man
    13. Re:What the XP folks have right (and wrong) by thac0 · · Score: 1

      Have you? How do you know that?

      Likely the same way the XP folks know that they occupy the correct position. I've worked on projects and seen what happens.

      To a first approximation software development is a lore that is passed and not some kind of a hard core science. Look carefully at all these things and pick what works best.

      I have found tons of problems by using use cases, uml diagrams, state diagrams or even flow charts if I go back further and solved problems *before* man weeks of time were spent XPing code into existence only to be refactored correctly the second time through.

      --
      poliglut.org: they're still alive and fighting the man
    14. Re:What the XP folks have right (and wrong) by jstoner · · Score: 1

      Funny: a lot of scaling claims being made here. "XP doesn't scale." "Waterfall development doesn't scale."

      I'm first to acknowledge there are huge problems with waterfall methodology. But a lot of the biggest, longest-lived systems out there were developed for decades using waterfall methodology. I've seen it up close: My first job out of college was working at IBM on operating-systems extensions to an OS (MVS) that was (is) older than I am.

      Maybe it doesn't scale comfortably. Maybe it scales when billions of dollars are thrown at it. Maybe it scales when large chunks of the planet's economy depend on its day-to-day function.

      But we know it can scale, because it did. I don't think XP has been through the same kind of proof-by-demonstration. I'm not at all sure it would pass.

      The Egyptians proved you could build the Pyramids without the wheel. They did not prove you could build them out of talc.

      --

      'In knowledge is power, in wisdom humility.'
    15. Re:What the XP folks have right (and wrong) by dubl-u · · Score: 1

      Then, arguably, this isn't refactoring but something simpler.

      Refactoring is improving the design of existing code. Be it 10^1 or 10^6 lines, if you're changing the design without changing the functionality, it's refactoring.

      In any case, to leave terminology aside, my point is that design is a higher level thing that helps 100K lines look, feel and behave similarly. XP doesn't address this well.

      Design is design. A program can have good or bad design at many levels of abstraction. You're right that it's important to look at the high-level ones, but many of the important clues about high-level design lie in how things are working on smaller scales.

      As far as I can tell, any refactoring of big issues can be broken down into a series of tiny refactorings. One's notions about the big picture are played out in one's small actions. As an analogy, think of a cross-continental road trip. The fact that I'm going from San Francisco to New York has at least a little influence on every move of the wheel, and a lot of influence on some of them.

      See above, I wasn't referring to the small work units. I agree 100% that the XP ideas work really well on the time scale of a day or a week, but they don't scale to a project or a large team.

      A bold assertion. Do you mean to say that you've been unable to do it? That it's utterly impossible for anybody to do it based on some mathematical proof you have? Or just that you can't currently see how it would work?

    16. Re:What the XP folks have right (and wrong) by thac0 · · Score: 1

      Refactoring is improving the design of existing code. Be it 10^1 or 10^6 lines, if you're changing the design without changing the functionality, it's refactoring.

      I've never seen it defined as that broad a range, nor do I believe that is the current usage. Regardless of the etymology of the word I was using it to mean something larger scale, say 10^3 lines at a minimum. Read my not in that context.

      Design is design. A program can have good or bad design at many levels of abstraction.

      Again, we're parsing definitions. When most people speak of software design they are not speaking of the design of a 30 line routine, but rather of a module, subsystem or large unit. That was how I used the term, read my note in that context.

      Regardless of that I do agree 100% with the statement you made, "You're right that it's important to look at the high-level ones, but many of the important clues about high-level design lie in how things are working on smaller scales." This is, as you say, critically important. It is also something not explicitely called out in XP.

      As far as I can tell, any refactoring of big issues can be broken down into a series of tiny refactorings.

      This is the first place that we really disagree. I don't think you can get a 20,000 foot view from ground level no matter how man square feet you've examined carefully. The high level view is important and, I think, mostly ignored in XP.

      A bold assertion. Do you mean to say that you've been unable to do it? That it's utterly impossible for anybody to do it based on some mathematical proof you have? Or just that you can't currently see how it would work?

      I have the same proof that the XP proponents have. The results of years of experience in trying different things.

      You are right about one thing though, I shouldn't say "they don't scale". What I should say is that they don't scale as well as a more comprehensive approach.

      I guess I see the XP practitioners as sharing a lot of philosophy with the phonics people. They both have a hammer and they both think it solves all problems. Just as comprehensive literacy teaching involved phonics, so to does comprehensive project management involve XP (and agile, waterfall, JAD, RAD, structured... the list goes on). Both camps are sometimes remise in seeing the shortcomings of their approaches too. Which is a shame, because a complete set of tools is a very valuable thing.

      --
      poliglut.org: they're still alive and fighting the man
    17. Re:What the XP folks have right (and wrong) by Anonymous Coward · · Score: 0

      You should probaly have a career change to become tester.

    18. Re:What the XP folks have right (and wrong) by dubl-u · · Score: 1

      Again, we're parsing definitions. When most people speak of software design they are not speaking of the design of a 30 line routine, but rather of a module, subsystem or large unit. That was how I used the term, read my note in that context.

      Yes, and I'm saying that they are the same thing. The techniques may be different, but the principles are the same. Someone who can't write good code will never make a great "architect", and somebody who has no clue about the bigger picture is a dangerous coder.

      The high level view is important and, I think, mostly ignored in XP.

      The fact that nobody explicitly says, "Hey, don't forget the big picture," doesn't mean that XP pracitioners don't pay attention to the big picture.

      On the XP projects I've been on, we talk about the big picture with frequency. Little issues with object lifecycles lead us to examine and perhaps change our persistence layer. The recognition that some packages are annoying for us to work on because they have too many classes sometimes leads to a major code reorganization.

      Note that some of the people involved in XP are people who are very interested in design on the larger scale. Martin Fowler, for example, has written entire books about UML and Enterprise Architecture. Many XP practitioners are also very involved in the Patterns movement.

      You are right about one thing though, I shouldn't say "they don't scale". What I should say is that they don't scale as well as a more comprehensive approach.

      Unless you want to come up with some statistics, I'm going to translate this as, "I think they don't scale [...]" or maybe, "I don't know how to make them scale".

      People are using XP (and other Agile methods) on projects with large code bases. They seem to think it works well. Perhaps you should drop by a mailing list and find out how they're doing it. Arguing is always more fun once you have some facts.

    19. Re:What the XP folks have right (and wrong) by Pete+Bevin · · Score: 1

      I think the XP folks would agree with you. Nobody is advocating that you don't do design, just that you allow your design to stay flexible in the face of changing requirements.

      There's probably a "common misconceptions about XP" FAQ somewhere that deals with this :)

    20. Re:What the XP folks have right (and wrong) by thac0 · · Score: 1

      Arguing is always more fun once you have some facts.

      In fact, I've used XP on more than one project, including the one I'm working on now, and am friends with a prominent agile author who taught me about those methods when they were still nascent. So I think I have the facts down cold.

      Despite my knowledge of the subject, I think that XP's generally direction is only half good and the lack of focus on higher level constructs is dangerous. If you want to claim that *you* are using higher level constructs, then fine. But you are doing something *in addition* to what XP suggests, which is exactly what I was saying should be done.

      --
      poliglut.org: they're still alive and fighting the man
    21. Re:What the XP folks have right (and wrong) by thac0 · · Score: 1

      I think the XP folks would agree with you. Nobody is advocating that you don't do design, just that you allow your design to stay flexible in the face of changing requirements.

      I know the XP folks would agree with me. I'm one of them in a sense and know many of them.

      My objection is that the methodology doesn't explicitly call for it. Therefore, folks paying attention to these higher level issues aren't practicing XP, but something like XP++.

      These things should be called out in the core methodology and it isn't.

      --
      poliglut.org: they're still alive and fighting the man
    22. Re:What the XP folks have right (and wrong) by Anonymous Coward · · Score: 0

      I have seen this too, and worked in XP places where the tests were "made" to work. I think its a very silly idea to write as much test code as you write the real code. How do you know your test code is correct, may be you should write more test code to test your test code. Write test code what is neccessary, not for the sake of pretending to write productive software. Do your basic testing to make sure you are doing the right thing, and find a good QA guy for your testing needs.

      public int add2(int x, int y)
      {
      return x+ y;
      }

      does it really need a testing method?

    23. Re:What the XP folks have right (and wrong) by Anonymous Coward · · Score: 0

      Waterfall development can scale when either the developers are very experienced in the problem area or enough time is allocated for the design phase.

      The thing is that even as you are going through requirements, you are already thinking about the design, and as you are putting down the design, you are thinking about the implementation. This is pretty natural and inevitable, and the more experienced you are, the more realistic your idea of the next phase is, and the less stupid kludges you have to make to compensate for lack of foresight in the earlier phases.

      But it also always requires genuinely smart people. I've seen developers experienced with the waterfall development model, who consistently produce truly horrifying products that fulfill the specified requirements...

      Currently, my approach to any non-trivial project is basically bottom-up. First, I create an environment and tools which allow the rest of the system to be implemented efficiently, then I start working on the main part of the problem. The first phase is generally a one-man thing, bringing other people onboard happens when the environment and tools are in place.

    24. Re:What the XP folks have right (and wrong) by tcopeland · · Score: 1

      > To a first approximation software development is a lore that is passed and not some kind of a hard core science.

      I agree. There's a lot of comp sci theory out there that breaks down once it gets out of its strong areas - sorting, searching, finite state machines, etc.

      > I have found tons of problems by using use cases, uml diagrams, state diagrams or even flow charts

      OK, you feel you have found and solved problems before writing code. Fair enough. However, consider how much time you have spent on that non-coding stuff, though, and how much you could have accomplished if you had spent that time writing tests and code.

      What's more valuable to the customer after a month - 80% of the functionality in clean, testable code? Or 0% of the code but a big pile of Visio diagrams?

      Yours,

      Tom

    25. Re:What the XP folks have right (and wrong) by thac0 · · Score: 1

      What's more valuable to the customer after a month - 80% of the functionality in clean, testable code? Or 0% of the code but a big pile of Visio diagrams?

      After a month, clearly they will perceive more value in having some code (I quibble with the 80% figure though. Any application that can get 80% of the code written in a month is aproachable using *any* methodology).

      After a year or two though. The story changes when you look at the longer term. An application that is properly designed and controlled will have better maintanability than one that was continually refactored into a thousand discrete chunks.

      OK, you feel you have found and solved problems before writing code. Fair enough. However, consider how much time you have spent on that non-coding stuff, though, and how much you could have accomplished if you had spent that time writing tests and code.

      I write tests and code. I claim that if one adds serious high level design to the XP development cycle that the amount of code produced goes down and, more importantly, the quality of the code goes way up. Perhaps not as important to the people doing the initial development as being told that they can work without thinking and then go back and think about whether they could have done things better, but clearly of great importance to the folks paying for the application. They will be the ones who continue to pay for it during it's maintenance and enhancement phases.

      --
      poliglut.org: they're still alive and fighting the man
    26. Re:What the XP folks have right (and wrong) by user2048 · · Score: 1
      ... the state of testing in corporate america. Just atrocious. ...

      Yes. That's what I've seen. No unit testing. No regression testing. No automated testing.

      Manual, very-high-level system testing only.

      Tremendous amounts of time and money spent in the integration phase.

      The first step to improvement is to just do some unit testing. Writing the tests before the code is secondary.

    27. Re:What the XP folks have right (and wrong) by thac0 · · Score: 1

      While I agree with you that the big win is to have testing regardless of when it's written I have to say that I agree with the XP folks concerning when is the best time.

      I've worked on dozens of projects and the only ones that were well tested were the ones with explicitly formed testing groups. The reason for this is simple. Developers know they need to test. Management knows that testing needs to be done. If the testing is not done first, however, it is far too easy to ship the product three months late than to high five everyone and say, "great job, now we just have to spend six months testing and we're golden". The market pressures are quite strong to ship something now instead of doing QA.

      There is a secondary issue as well. Development of software it a constructive task. It is very difficult for a developer to spend a month or a year building something and then turn around and do an effective job of trying to destroy it. It is much easier to get into that frame of mind before you've spent hundreds of hours being constructive. The XP folks have this part strongly right.

      --
      poliglut.org: they're still alive and fighting the man
    28. Re:What the XP folks have right (and wrong) by dubl-u · · Score: 1
      If you want to claim that *you* are using higher level constructs, then fine. But you are doing something *in addition* to what XP suggests, which is exactly what I was saying should be done.

      No, I'm doing exactly what XP says to do. Since design is good, I do that in the most extreme fashion possible: I design all the time. Sometimes that's small stuff; sometimes that's big stuff. Whenever big issues come up, I do big design.

      Pulling out Kent Beck's book "Extreme Programming Explained", I note that there are four different entries for architecture, which is the common name for the high-level design that you're talking about:
      Architecture
      • design strategy and, 113
      • exploration phase and, 132
      • guiding metaphor and, 56-7
      • iterations and, 134
      Looking through these pages, I find a number of relevant quotes:

      System Architecture
      I haven't used the "A" word anywhere abouve. Architecture is jsut as important in XP projects as it is in any software project. [...]

      For the first iteration, pick a set of simple, basic stories that you expect will force you to ctreate the whole architecture. Then narrow your horizon and implement the stories in the simplest way that can possibly work. At the end of this exercise you will have your architecture. It may not be the architecture you expected, but then you will have learned something.

      [...]

      The programmers should also experiment with architectureal ideas -- how do you build a system for multiple levels of undo? Implement it three different ways for a day and see which feels best. These little architectural explorations are most important when you find the user coming up with stories that you have no idea how to implement.


      So as far as I can tell, XP's attitude is that yes, architecture is important, and that yes, you should pay attention to it, but that there are no special rituals regarding it.

      What special rituals do you want? And when you did XP, what architectural problems did your team have without those special rituals?
    29. Re:What the XP folks have right (and wrong) by thac0 · · Score: 1

      What special rituals do you want?

      Architecture should be part of the process. XP describes a process without explicit steps for architecture.

      And when you did XP, what architectural problems did your team have without those special rituals?

      None. We added the rituals. Each iteration included 'tests' (in the form of human walk throughs) to ensure adherence to design and refactoring of the design itself. Just like the code, we iterated over the design.

      --
      poliglut.org: they're still alive and fighting the man
    30. Re:What the XP folks have right (and wrong) by chromatic · · Score: 1
      XP describes a process without explicit steps for architecture.

      I see your point now. Yes, there is no explicit step that says "Only design something right now." However, design is part of the planning game, when developers write and estimate task cards from the stories. (There's your high level design.) Design is part of test-driven development, when the pair asks "What tests can we write to explore the next feature?". (There's your low level design again.) Design is part of refactoring, when the pair asks "This works, but is there a way we can improve its design without changing its functionality?" (There's a mixture of high and low-level design.)

      There's no explicit design stage for two reasons. First, it's expected that the ideal design will emerge as the system grows. If the customer is allowed to make changes to the specification, if developers improve their understanding of the business rules and the technology, they're allowed and encouraged to adapt the design accordingly.

      Second, because a "proper up-front design" is amazingly difficult to get right, takes a long time to get right, and, if you can reach that point iteratively anyway, doesn't add as much business value as delivering a couple of iterations worth of software in the same time period.

      Again, this is most appropriate for projects that are expected to change.

    31. Re:What the XP folks have right (and wrong) by thac0 · · Score: 1

      Second, because a "proper up-front design" is amazingly difficult to get right, takes a long time to get right, and, if you can reach that point iteratively anyway, doesn't add as much business value as delivering a couple of iterations worth of software in the same time period.

      We're close to agreement here, but let me just belabor this one additional post.

      I'm not arguing for up-front design. As you rightly point out, it is amazingly difficult to get right. Perhaps impossible even as your second point is equally well taken. Requirements change and therefore the design will also.

      I'd just like to see the XP movement embrace medium and high level design as an instrinsic feature of the methodology rather than an implicit fallout of some of the work done.

      --
      poliglut.org: they're still alive and fighting the man
    32. Re:What the XP folks have right (and wrong) by dubl-u · · Score: 1

      Architecture should be part of the process. XP describes a process without explicit steps for architecture.

      Architecture is part of the process. Beck and others mention it; the teams I'm familiar with have no problem with it. There is no explicit step because they see it as all part of "design" and "refactoring", which are explicit steps already.

      XP attempts to be scale-free. If you want to impose scale distinctions, fine, but recognize that it's not part of XP.

      Each iteration included 'tests' (in the form of human walk throughs) to ensure adherence to design and refactoring of the design itself. Just like the code, we iterated over the design.

      Why wasn't this happening naturally?

      For adherence to the architecture, that's everybody's job. And if they forget, they have a pair to keep them in line. Sure, some people are more architecture-savvy than others, but since pairs should change a lot, those people should be able to influence the design as needed. Why wasn't that happening in your team?

      As far as refactoring of the architecture it's not clear to me how a part of the architecture could be bad enough to need refactoring without anybody noticing that it was a pain. When they feel they pain, they should raise their voice a little and say, "Has anybody thought about X?"

      Even if they don't raise it right then, they should be raising things at the next daily stand-up, yes? Were they doing that in your team?

      Also, generally at release and iteration planning meetings we'll talk over architectural issues when new stories or tasks inspire their discussion. Didn't this happen for y'all?

      We added the rituals.

      Did you do this in response to an actual problem? E.g., that you got two months into and discovered that y'all were letting the architecture get crufty? Or was it imposed from the beginning based on theoretical concerns?

      If the former, I'd agree that one way to solve that is adding an additional ritual every iteration. And bravo for fixing the problem you had! But there are other ways to solve the problem, too.

      Saying, "My team had a problem adopting XP and we did this to fix it," is a pretty different thing than saying, "XP has a fundamental flaw."

    33. Re:What the XP folks have right (and wrong) by thac0 · · Score: 1

      Why wasn't this happening naturally?

      For the same reason all the steps in XP that are explicitly called out weren't happening naturally I suppose.

      is a pretty different thing than saying, "XP has a fundamental flaw."

      I didn't say that XP has a fundemental flaw. I said, in fact, that the testing first thing was good. I implied that iteration was good. I believe in a large number of the XP constructs. In fact, off the top of my head I don't know what they have that I would argue is wrong.

      However, I do think it is incomplete.

      I'm glad you think it's perfect. More power to you and best of luck on your projects. I find it to be insufficient for large scale projects without some additional, explicit, steps to build a coehesive whole.

      --
      poliglut.org: they're still alive and fighting the man
  7. too many developers by netsavior · · Score: 2, Insightful

    it would be nice to have 2 developers for every problem... but that is never going to happen.

    1. Re:too many developers by Lumpish+Scholar · · Score: 1
      it would be nice to have 2 developers for every problem
      It would be even nicer if two developers working together were more than twice as productive as either of them working alone ... but that's pair programming, a different XP practice, and a whole different book (Amazon.com, BN.com).
      --
      Stupid job ads, weird spam, occasional insight at
    2. Re:too many developers by Anonymous Coward · · Score: 0

      The funny thing is that, the two developers working together has less productivity than either of them working alone.

  8. Haven't we... by Some+Bitch · · Score: 5, Funny

    ...been doing this for years anyway? My code development cycle has always been... 1. Write code to use function/procedure. 2. Write function/procedure. 3. If function/procedure==fucked return to 2 and unfuck. 4. Once it works, tidy it up. Now it appears someone else has added steps 5 and 6... 5. Write a book about it. 6. Profit!!!

    1. Re:Haven't we... by Anonymous Coward · · Score: 0, Insightful

      but the point is you also add a "test suite" - in addition to your routine and the code that uses your routine. That way you have an "objective" test of your routine, regardless of what your app does.

      Imagine if you call the same method/function from three different places - in one place it expects a return value (int) > 0, in another it expects a return value >= 0 and the third it expects any return value. Which one is right? Well, in XP your routine would be called from a fourth place - from within the test. And the version called from the test is, by XP's definition, the correct version. The test effectively becomes a specification.

    2. Re:Haven't we... by Anonymous Coward · · Score: 0

      They've also added a 2.5: Try to write it as fucked as possible while still functional.

  9. Dibert and eXtreme Programing by QEDog · · Score: 4, Funny

    What would Dilbert do?

    Here and here!

    I love buzzwords with X anyway...
    --
    "There is no teacher but the enemy."-Mazer Rackham
  10. Buy PEAA, too by Amsterdam+Vallon · · Score: 2, Informative

    You can get Martin Fowler's "Patterns of Enterprise Application Architecture" in a bundle bargain at Amazon along with Kent Beck's "Test Driven Development" for $79.98 [link to PEAA bundle]

    --

    Reply or e-mail; don't vaguely moderate. Ex-O'Reilly/MIT employee, now a full-time Google employee.
    1. Re:Buy PEAA, too by asrb · · Score: 1

      Although both good books, 79.98 is not a 'bargain bundle'; it is just a bundle. $49.99 + $29.99 = 79.98.

  11. Is XP good? by timeOday · · Score: 5, Interesting
    Now that XP has been "out there" for a while, does anybody have some war stories?

    Does the reliance on incremental development and refactoring rather than a intricate, up-front design really work, or result in a big wad of band-aids?

    Is pair programming OK, or do you sometimes get stuck with the nitpicker from hell who has to have every detail his own way?

    Is close involvement with the customer good, or does it just give them daily opportunities for endless bright ideas that prevent convergence?

    Just wondering...

    1. Re:Is XP good? by silkySlim · · Score: 3, Insightful
      I can't speak for XP specifically, but lightweight development has been nothing but a positive experience for my team. But it's a tricky question. Because if you truly believe in the "Agile" methodologies, you find that the development process quickly becomes customized based on your team members and type of project. It's all about creating the path of least resistance for your team while still moving towards the end product.

      I work in a game studio where our last project had 6 months of pre-production time. We generated reams of technical design documents. The intention was good, but they were never maintained or even referenced after their initial creation. We just said "documentation is necessary" and it needed to be done. In production, the team wasn't on the same page. Every programmer had a task list they just milled through. The assumption was the initial requirements won't change. The result was ugly. The product was subpar and a couple months late. Everyone was miserable. It sucked.

      I'm currently leading a new project here. We're 6 months into production and every milestone has been delivered ON TIME and accepted by our customer. The team is focussed on the current milestone, there isn't a lot of process to get in the way. The best part is, writing code is fun again. We don't have goals we can't accomplish. And we fully expect the product requirements to change during production.

      I could get into specifics about our process. But I don't think it would be that helpful. I think specific methodologies like XP are guidelines to get you started. From there, you really should re-evaluate your process frequently (a fundamental excercise to be "Agile") and make changes as necessary. Kind of like optimizing your code.

      The following links gave me all the information I needed to devise an initial process plan (which included TDD). But once it was put into practice, it naturally evolved into the process we have now (which doesn't include TDD)...

      The New Methodology by Martin Fowler

      The Agile Manifesto

      Agile Software Development Ecosystems by Jim Highsmith

      I also suggest reading the chapters on "thematic milestones" in Writing Solid Code.

    2. Re:Is XP good? by spstrong · · Score: 2, Insightful

      Now that XP has been "out there" for a while,
      does anybody have some war stories?

      It's interesting. The "war" has been with management. We showed our Project Manager a couple of the books (he actually READ them) and we were allowed to use XP. After our first project was successful, we have been trying to get official approval to develop using the methodology and it has been tough.

      Does the reliance on incremental development and
      refactoring rather than a intricate, up-front
      design really work, or result in a big wad of
      band-aids?

      As with any approach the team must be disciplined to
      1. Test First
      2. Talk to each other
      3. Ask for help when needed
      4. Refactor mercilessly
      5. Code the simplest thing that will work

      You will probably say "of course!" to all of the above, but if you don't stay disciplined within the team, you will get into trouble.

      Is pair programming OK, or do you sometimes get
      stuck with the nitpicker from hell who has to
      have every detail his own way?

      Pairing is great. If your goal is not well written simple software, you are not part of the team. You are the cowboy who is the reason the team is all working on Saturday to fix the sh*t you went off and wrote by yourself! (Ok, Ok, breathe....)

      Is close involvement with the customer good, or
      does it just give them daily opportunities for
      endless bright ideas that prevent convergence?

      The customer wants an application as quickly as possible. They have a business need and don't want to have to wait 4 more months for their great ideas to be implemented. If they continue to think off the top of their heads, they probably didn't know what they wanted in the first place and it will take that extra 4 months to get it out of them and get it into the application anyway.

      XP works. Our teams are 4 or 6 programmers with a tester. When we test first and give the tester something to test that is not fragile, we get much farther much faster than "code it and throw it" at the tester and hope it works.

    3. Re:Is XP good? by Anonymous Coward · · Score: 2, Interesting
      War Stories you want? You got it!! By the way, I am going as Anonymous Coward 'cause I can't say anything negative about the company. The company shall also remain anonymous. We tried it and it worked. However, it did not work well. The primary reason it did not work well was that the concepts were not consistently enforced. Also, upper management forced it on us as the next great thing and then proceeded to do things in the same old way.
      • We had a project and a project lead who developed the stories.
      • A customer is supposed to develop the stories. The customer tells you what is needed and you develop that, and only that. Stories are small pieces of functionality that can be developed in a few (three to five days). One of the mantras is that the stories have to be short.
      • We had problems with the project lead writing stories and then changing them in mid-stream.
      • There is nothing wrong with the project lead re-writing the story. However, our project lead would re-write the story without allowing the developers or testers to re-factor their development time.
      • We had problems with the lead developer including functionality because the customer will want this down the road.
      • One of the primary rules is that you code the story and only the story. You do not add in functionality that you thing the customer might want.
      • We had stars and gurus that were allowed to work alone rather than as part of a team.
      • Another rule is that all production code is developed in pairs. This is for mentoring and learning as well as having two sets of eyes looking at the code to notice the missed comma or semi-colon. You pair an experienced programmer with one less experienced so the less experienced programmer can learn.
      • We had tests written to test the story, and tests written to test what the customer really wanted.
      • We wasted time testing the additional functionality as well as wasting time coding the additional functionality. It also, agin, violated the XP rules.
      • We had stories that took three days to code; the tests to verify the story took two weeks to code.
      • This was, in most cases, an extremely valid time requirement. However, upper management and the project lead refused to allow the time. The statement was made repeatedly that it shouldn't take that long. Again, this violates an XP rule. The customer tells the team what is needed and developers tell the customer how long it will take to code the story. The testers tell the customer how long it will take to code the test. Management, the project lead, and the developers, as a whole, were of the opinion that the test should not take any longer than the actual code. This resulted in the testers working overtime on a near-continuous basis.

        Then, after several months (almost a year) of developing the XP way, the company had to have a demonstrable product within the next two weeks. In the end, nothing mattered except the ol' bottom line. We had to go to market to beat a competitor. It did not matter that we still had nine weeks of stories to finish the project. It did not matter that tests were failing. It did not matter that the kernel and OS version had changed twice in the year, each time causing the developers and testers to re-visit, re-test, and re-code a large part of the existing code.

        A nice shiny package was not ready exactly when the suits wanted it and the company shut down the devision, moved everything to another state and other developers. The product still has not gone to market, but the company got rid of the developers and testers that didn't deliver.

        Lest you think this is sour grapes, I actually think XP practices can work for what it was intended; small project development.

        Ours was a major undertaking with an entirely new product. There was education and training necessary that was never taken into consideration as far as the project timeline was concerned. We also had to learn new hardware technology, operating systems, development and testing languages at the same time we were learning XP methodology.

        It was not fun!!
    4. Re:Is XP good? by timeOday · · Score: 1

      Interesting, thanks. You may think nobody read it becasue you posted it AC and it's scored 0, but hopefully somebody will mod it up.

    5. Re:Is XP good? by dubl-u · · Score: 4, Interesting

      Hi! I've been doing XP on and off (depending on client preferences) for a couple of years.

      I'm immensely happy with it. It's not a magic bullet, but gives me the tools to solve a lot of common problems.

      Does the reliance on incremental development and refactoring rather than a intricate, up-front design really work, or result in a big wad of band-aids?

      Yes, it works. It takes a bit to learn how to do it well, but it works.

      Indeed, in some ways, it works better. When I did most of my designing up front, I had to guess about a lot of things. Now I'm a pretty good guesser, but I'm not perfect. And since I knew I was making designs that I had to live with for years, I tended to play it safe, putting in things that I would probably need someday. I hoped.

      Now, I don't put anything in until I know I need it. This keeps the design cleaner, and saves me all of the time I would have spent on bad guesses and things obsoleted by changing requirements.

      Is pair programming OK, or do you sometimes get stuck with the nitpicker from hell who has to have every detail his own way?

      I like pair programming a lot, and more people are good at it than you would expect. But some people are indeed pains in the ass; just last week we had to sit one guy down and have The Talk with him. If he doesn't shape up, he can go be a nitpicking cowboy on somebody else's project.

      Right now I'm also doing some solo work, and it really suffers from the lack of a pair.

      Is close involvement with the customer good, or does it just give them daily opportunities for endless bright ideas that prevent convergence?

      It can work really, really well. The trick is that you must let them steer the project, so that they can see that asking for all sorts of random stuff means that their precious project will be screwed.

      For example, I and another fellow were recently called in to work on a project that was six weeks from delivery and running late. The product manager handed us a one-page spec, spent 30 minutes showing us the existing code and said, "So can you do that in time?"

      Now the only honest answer was, "I dunno, but probably not with all that you've asked for." But we walked him through the XP practice known as the Planning Game, where we broke his requirements down into bite-size chunks, wrote them on index cards, and then he ordered them by importance. There was far more work than could be done in time.

      So then we asked him to draw a line at the point which, if we didn't reach it, he would slip the date, and if we did, he would ship. It cause him great pain, but he did it. Then we agreed that we would start developing and see how things were progressing.

      As time went on, he, like any client, had all sorts of great ideas, and so did we. Every one got written on a card, and we asked him to place them wherever he wanted in the stack. This forced him to make tradeoffs; the more stuff he put in before the release, the farther away the release would be.

      When the six weeks were up, we shipped a product with less than half of what he originally asked for. But instead of being pissed, he was happy! He got the half that was most important to him, and he was the one who made every choice about scope, so it wasn't our fault, that was just how things were.

      And best of all, because we'd stuck to the XP practices and done extensive testing, there have been no bugs reported against our code. With code that solid, we're glad to start extending it, instead of the usual pattern where a big deadline push means the code is crap.

      So yes, I like XP a lot. I get to write good code, polish the design, and have good relationships with the business folk. It rocks!

    6. Re:Is XP good? by jjl · · Score: 2, Insightful
      > Is pair programming OK, or do you sometimes get stuck with the nitpicker from hell who has to have every detail his own way?

      The team should create a common guidelines specification which then must be agreed by everyone in the project. After that nitpicking to make stuff conform to the guideline is a good practise, since sticking to the agreed style is an improvement.

      --
      --
  12. if you're organized by Anonymous Coward · · Score: 2, Insightful

    Isn't that the whole crux of XP? If you're not organized, nothing will help. If things are organized, but need tweaking, then XP can be beneficial. Having the pre-requisite of having some organization to how software is developed is the hardest part. If your PM isn't organized and you're not organized, forget about it. If you're organized, then you're probably already doing unit testing in some form.

  13. Write code to determine if your code is flawed... by Dareth · · Score: 2, Insightful

    The idea of breaking your program into small parts and testing them is fine. Writing programs to test these parts seems to be a bit problematic. I wrote a test program to test this module. But then I remembered that I forgot to write a program to test the test module! You use your specifications to write your module, then you test against these specifications. If you write a program to test these specification, then you already must have a firm grasp of the specifications. What assumptions about your module are you making when you write your test? Or is this a simple black box type test where you do not care how it works inside? Any faults that you have in your conception of your test program will be carried over into your module, or worse your module might be correct but your test program flawed. Seems like an extra layer of complexity rather than a useful method. I also dislike the do it dirty and fast, then refactor part. Proper planning and implementation seems the better approach to me. I understand that "mad hacker" instinct to dive in and code away, but that has to be restrained a bit when the complexity of the problem rises.

    --

    I only look human.
    My mother is a halfling and my dad is an ogre, so that makes me an Ogreling
  14. The Unix Philosophy by cyber_rigger · · Score: 1, Informative
  15. In Other News... by Mazurbul · · Score: 2, Funny

    The RIAA issued a press release saying that they are initiating a lawsuit against Kent Beck because eXtreme Programming principles could lead to faster development of file-sharing software. The RIAA's main argument is that CD sales are falling at levels that could only be explained by eXtreme Programming.

    1. Re:In Other News... by DukeLinux · · Score: 1

      Falling musical quality and rising prices would not have anything to do with it, would it now? Anybody with talent is passed-over for the latest "Britney." I think we are all sick of the banal garbage that they are turning out.

  16. Moving beyond XP: XXP by Waffle+Iron · · Score: 5, Funny
    XP testing techniques are great in theory, but there is still a gaping hole: if your tests aren't correct, your program could still end up flawed.

    That's why I've moved on to XXP, which focuses first on correctness of tests. First, I write a test that tests a test. Then I write the test. I test the test until the test tests ok. Then I write a test for another test, and so on.

    My pair programming partner is currently working on an idea he calls "XXXP". I'll post our results if we ever finish a project without getting lost in infinite recursion.

    1. Re:Moving beyond XP: XXP by minister+of+funk · · Score: 1

      XXXP is actually programming while naked and sweaty.

    2. Re:Moving beyond XP: XXP by fastdecade · · Score: 1

      I test the test until the test tests ok. Then I write a test for another test, and so on.

      Test the test? Sure it's possible ...

      Tools like Jester let you evaluate the quality of your JUnit test cases. So yes you can evise your test cases in between refactoring your code.

      Hopefully the developers of Jester didn't evaluate their test code with Jester (XXP with Jester-for-Jester), the mere thought has me spiralling into a daze of infinite recursion.

  17. Opinion on Boost:'s unit test framework by Eponymous+Coward · · Score: 0, Offtopic

    Okay- this is a bit off-topic, but thought someone here might have some experience with the unit test stuff inside of Boost.

    I'm wondering if anybody has used the Boost framework for something more than a toy program. It seems well though out (like all of the stuff in Boost), but I just don't have any experience with unit test stuff. I have nothing to compare it to.

    -ec

  18. What's worse by oliverthered · · Score: 1

    Do they even consult?

    seriously the percentage of projects I've seen with features that don't work because that's what the client asked for. Or are poorly put together is amazing.

    You can't test if you don't have a design to test against. You can't design if you haven't consulted the requirements.

    --
    thank God the internet isn't a human right.
    1. Re:What's worse by Anonymous Coward · · Score: 0

      If all these stupid XP advocates shut their mouths, we can get our work done, without having to worry about more keywords.

      I never worked on a project that failed, except those that bind your hands using methodologies like XP.

  19. Sloppy programming by tuxlove · · Score: 1, Troll

    In my experience, extreme programming was invented by/for programmers who hate designing and discipline, and just want to start hacking. It leads to sloppiness and half-finished code, and it's not a scalable approach for large projects. I had the misfortune of having some guys on a project who insisted on working this way, and we had a huge mess to clean up in their wake. I'm glad this programming philosophy seems to be dying out.

    1. Re:Sloppy programming by Anonymous Coward · · Score: 0

      let me guess, you are either in academia or have never worked with someone who actually applied xp.

    2. Re:Sloppy programming by Some+Bitch · · Score: 1

      It's not necessarily dying out. Look around at a lot of the young people heading into the profession, there's a lot of BPFH (Bastard Programmer Fro...why am I explaining that on slashdot?) wannabees out there who see incomprehensible code as 'job security' and a sign of their '1337 sk1llz'.

      Admittedly I tend to just sketch out a basic overview of any project I set out on then dive straight into the code but my projects are small scale so I can get away with it :). I do tidy things up and comment before declaring them done though.

    3. Re:Sloppy programming by tuxlove · · Score: 1

      let me guess, you are either in academia or have never worked with someone who actually applied xp.

      I guess you didn't actually read my post. When I said I worked with some guys who used XP, what do you think I was saying? And I find your comment about academia humorous. It supposes that nobody would want to actually *design* something before building it except for academics. Wrong, sparky. I work for a company that takes pride in actual engineering.

    4. Re:Sloppy programming by chromatic · · Score: 1

      Yeah, aren't you glad we live in a world with disciplined designers who don't test their code and never work to customer specifications and don't integrate continually and never run acceptance tests? I'd hate to think about the quality of software we'd have if people did THOSE things!

    5. Re:Sloppy programming by tuxlove · · Score: 1

      I'd hate to think about the quality of software we'd have if people did THOSE things!

      Are you saying THOSE things were invented for XP?

    6. Re:Sloppy programming by Anonymous Coward · · Score: 1, Interesting

      Actually, if you look at the credentials of the original "inventors" of XP, and some of it's biggest champions (Robert Martin, Martin Fowler), you'll see that they are big champions of proper software design as well. They just realized that "big design up front" -- which they were preaching -- wasn't working out, and that most implementations of more iterative approaches weren't working out either. Hence a "reaction" in the form of XP.


      As for discipline, proper implementation of the XP practices requires far more discipline than most highly structured approaches. What it minimizes is the creation of documentation for documenation's sake. What has happened is that people who hate design/discipline have decided that by saying "we're doing extreme programming", they are off the hook. But don't blame the inventors.

    7. Re:Sloppy programming by chromatic · · Score: 1

      By no means! I am merely saying that they're fundamental to XP. If you're attempting to do XP without those, you will need a combination of very lucky and very, very brilliant developers to have a chance of delivering good software on time.

      (If you're not doing XP but you are doing those practices, you have a pretty good chance of delivering good software on time.)

    8. Re:Sloppy programming by Anonymous Coward · · Score: 0

      Hey moderator bozo, read the moderator guidelines. Do you know what a troll actually is? It's not someone who you simply disagree with. Bend over so I can whack you with my rusty-nail-encrusted clue stick.

    9. Re:Sloppy programming by Anonymous Coward · · Score: 0

      Programmers who dislike or are not good at design and discipline are going to make a mess whatever methodology is used.

      In a design-first model, the damage is perhaps somewhat more limited because they are assigned specific subprojects that can be scrapped and rewritten if they are bad enough.

      But for good programmers, design-first is not critical. I'm extremely disciplined no matter what I'm doing, and no matter what kind of hurry I'm in - I almost never find that I could save significant amounts of time by doing things less cleanly. If it's up to me (it usually is), I rarely spend more than a day designing something before beginning to implement it.

      One of the indicators why I believe my code really is clean and well-designed is that other people understand it, can and do use and extend it, even if it is not commented and was never intended for general consumption.

  20. Is there anything here for the GUI developer? by kahei · · Score: 3, Interesting


    I'd be the first to admit that XP offers a lot of risk-reduction -- for teams that are working on things that are easy to unit-test.

    With a class that is supposed to take in a bond and output the yield curve, it's easy to write a unit test. But what about the next class, that renders the yield curve on the screen? What about the complex, distributed system of Excel objects and forms things that draw a network and things that flash green and go 'ping' to indicate a change, that are equally necessary but generally much harder to write and much more likely to go wrong?

    Has anyone tried to apply test-first programming to complex guis? I can't say that any obvious way to do it has ever occurred to me. Worse yet, when I ask I generally find that people either

    a) Are in the same position as me, or
    b) Believe that a GUI is a little thing you spend a couple of days on after you finish the application

    So, for now XP is something I read about rather than something I actually do.

    --
    Whence? Hence. Whither? Thither.
    1. Re:Is there anything here for the GUI developer? by Jerf · · Score: 1

      Just for the record, the "correct answer" to your conundrum is to get the widget writers on board with the testing stuff. They need to add methods for testing, things that might expose inner details (readonly) about the widgets and other things that technically violate OO principles, so that testing can be done.

      Other things such as matching pieces of the picture and such would also be nice.

      It'll never be easy to test a GUI, but right now GUI widgets are almost entirely focused on giving commands and limit the information you can extract back from them to screen position, size, and little else. I want to be able to assert that my textbox can handle text of the size 50Ms with all of it being visible, which is exactly the sort of thing a user requirement might be. (Indeed, I think of this example because of a text dialog I just dealt with for entering a Wireless access key that was two chars too short; if you're that close, why not go for the gusto and let me see the whole thing for visual verification of correctness?) In fact you can do some of this in some widget sets; Tk will let you do that exact test, for instance. But it's haphazard from a testing point of view, because it wasn't implemented for testing.

      The other thing we need is a way of inserting all user-sourced events cleanly, and in a well-documented and supported manner, directly into the event loop as if they came from the user, indistinguishable from user input to the rest of the application. Again, haphazard, poorly-supported and poorly-documented abilities to do this exist in some toolkits, but since it's not meant for testing it's often not complete or completely undocumented.

    2. Re:Is there anything here for the GUI developer? by JohnFluxx · · Score: 2, Interesting

      All my GUIs seem to collapse on themselves, so I'm in no position to talk...

      However :), what I _do_ like are programs where you seperate the code and gui as much as possible. Even to the point of making them seperate programs or at least a library.

      Pros:
      You can have many different gui's - personally this is how I like cross platform gui's done - one tailored for each platform.
      If it is a seperate program, then you can script it, right from the start too.
      You can test the code easier, since there's the gui is seperate.

      Cons:
      For some reason having them seperate seems to make them less robust in the examples I've seen.

      So er yeah anyway. One solution is, as above, seperate your gui and code. Another solution, perhaps, is to plan all your dcop calls (or whatever your favourite scripting thing is).
      This ties in nicely in nicely with your use case diagrams since you can have calls for your "stories".

      I'll shut up now.

    3. Re:Is there anything here for the GUI developer? by Lumpish+Scholar · · Score: 1
      Has anyone tried to apply test-first programming to complex guis?
      Yes, but this book doesn't really cover the subject. See the test driven development forum at Yahoo! Groups for more on test-driven development of systems with GUIs.
      --
      Stupid job ads, weird spam, occasional insight at
    4. Re:Is there anything here for the GUI developer? by Some+Bitch · · Score: 1

      b) Believe that a GUI is a little thing you spend a couple of days on after you finish the application

      A couple of days? If a variable dump's good enough for me it's good enough for the proles ;)

    5. Re:Is there anything here for the GUI developer? by dubl-u · · Score: 1

      The problem is that a lot of GUI frameworks are pretty hostile to testing, but it can be done.

      Rendering stuff, for example, can be tested by comparing output bitmaps. For example, I'm doing some photo stuff, and all of the methods that output images I just get working manually and then once their output looks right, I save that and make the check part of the test suite. Anything that outputs numbers (e.g., the calculation of the size of the new image for a scaling operation) is just tested the usual way.

      Other GUI stuff you can test by generating fake events and setting up mock collaborator classes to make sure things do what they should when they should.

      And you can also take a just-the-essentials approach. For my web work, I test the underlying components extensively. I also have a web robot that hits a test copy of the site and makes sure that it all works well enough. I don't test every bit of HTML; I just make sure that important strings appear in the right place, that clicking through gets to where I think it should, and that feeding the right data to the right forms gets abuot the right responses.

      Still, it's more of a pain than it should be. I look forward to the day that somebody develops a GUI framework test-first; those components will be much easier to work with.

    6. Re:Is there anything here for the GUI developer? by David+Leppik · · Score: 1

      My solution for web development has been to use unit tests wherever possible, and to write the UI components to be as test-friendly as possible.

      That is, I try to do a strict MVC (Model-View-Controller) class separation, with the View as lightweight as possible. That is, make the UI as dumb as possible, so that if there is any room for errors they show up in the simplest UI walk-through.

      This also means that you can do rapid development (usability testing, anyone?) on the nitpicky presentation details. Automated GUI testing tends to be screen-reader testing, which means the test needs to change when minor GUI components change-- which is unreasonably nasty.

      As a specific example, JSP tag classes have a doStartTag() method which typically write to the web page stream. It is annoying to unit test because it needs web page context and must handle lots of data gathering and exceptions.

      I write my doStartTag()s to gather data, handle exceptions, and write to the web page-- and everyting else (the real meat of the method) is done by a helper method that takes data and returns a String. The helper method is written to be easy to unit test: it throws all the interesting exceptions and can fail in all the interesting ways. The doStartTag() is simply the JSP wrapper.

      Of course, a pure MVC approach has my helper method in a separate class-- which is actually my most common approach-- but in many cases that would be overkill.

      This approach can be applied to any kind of GUI: treat GUI code as a minimal wrapper around easy to test code.

    7. Re:Is there anything here for the GUI developer? by radtea · · Score: 1
      The VTK (http://www.kitware.com) framework unit tests visualizations by dumping a png of the visualization and diffing it against a "correct" version. This is is a pretty extreme test--one pixel out of place and it fails--but it does ensure stability of the rendering code.

      --Tom

      --
      Blasphemy is a human right. Blasphemophobia kills.
    8. Re:Is there anything here for the GUI developer? by cpeterso · · Score: 1


      Having had to test GUI apps before, I think a useful approach is to separate the GUI ("View") and the data ("Model"). Automating GUI tests is a bitch and the tests are very fragile if anything in the GUI changes. If possible, design a command-line version of the app that includes everything but the GUI. The command-line version can be scripted to perform automated input/output tests. If your real app is a COM object, your command-line version could even be a simple app that loads the app COM object.

      This application design is not a "natural design" a developer would choose on their own, but I think using a test-driven process it can really improve the app's modularity.

    9. Re:Is there anything here for the GUI developer? by Anonymous Coward · · Score: 0

      IMO the GUI toolkit should create the interface according to specifications, so you should not need methods for explicitly testing whether this or that can fit.

      As for user-sourced events...the problem with testing these is that most individual events are not significant, only sequences of events, and an exhaustive set of possible sequences is far too large to test.

      Ultimately, the only way to test a user interface is by using it.

      As a side not, all of my programs with GUIs separate the interface from the functionality, and most are scriptable, so you can invoke all functions that you can from the GUI from a script.

    10. Re:Is there anything here for the GUI developer? by Anonymous Coward · · Score: 0

      I always separate my GUI and code to the greatest extent possible, but for some types of programs, the GUI is a huge part of the code.

      If you have a program that edits some sort of data, the hardest part of that program is usually the widget that lets you interact with the data. Generally the widget needs its own internal representation of that data in order to be able to display and/or modify it efficiently enough.

      Most of the time, I don't think programs that don't present an interface to some data need GUIs.

    11. Re:Is there anything here for the GUI developer? by tupps · · Score: 1
      It is commonly known as the MVC model. MVC is Model, Veiw Controller. Basically you have code that handles the data (model) and code that handles the View (GUI) then the controller sits in between as a basic sort of glue to combine them.

      On smaller projects the controller and the view often get integrated into the same place, but once you start talking multiple windows etc then you need to split the Controller out.

      I beleive that Java's gui stuff is done like this and Cocoa on MacOSX definitely uses this (the framework is built on this foundation).

      --
      Go out and get sailing!
  21. Success Stories? by Lucas+Membrane · · Score: 3, Informative
    A few years ago, the XP promoters were bragging about the Chrysler Compensation System, the first big XP project. They were redoing all of Chrysler's payroll systems, they were part done, they were succeeding where much larger efforts had failed, and the new managers from Mercedes wanted them to finish it so that they could go on and apply XP to other problems.

    Last I heard, the Chrysler Compensation System was not finished, scrapped prior to going into production. What are the more recent projects that demonstrate how well XP works?

    1. Re:Success Stories? by JohnFluxx · · Score: 1

      Any ideas why it failed?
      You've only told half the story :) Don't leave us in suspense.

    2. Re:Success Stories? by Anonymous Coward · · Score: 0

      Projects designed on the whiteboard and in the minds of the coders tend to fall apart sooner or later.

    3. Re:Success Stories? by Joseph+Vigneau · · Score: 4, Informative
      Any ideas why it failed?

      Hear it from the players players themselves.

      One of the benefits of XP is that it can tell you much earlier about whether or not to terminate a project in the first place. From Extreme Programming Explained:

      One of the features of XP is that customers can see exactly what they are getting as they go along.
      -- Kent Beck
    4. Re:Success Stories? by Anonymous Coward · · Score: 0

      Look at Software Development Magazine (www.sdmagazine.com). The Jan 2002 issue has an article about a XP project at Symantec for a new security product. They check in with the project at 6 months and 1 year after it started.

      Bottom line for them was few bugs, hitting their dates, and everyone is happy.

    5. Re:Success Stories? by 5KVGhost · · Score: 1
      Hear it from the players players themselves [c2.com].

      A brief excerpt:

      I think this is almost always the case if you have a OnsiteCustomer, since the GoldOwner usually cannot be full time on site. ScrumMethodology tries to balance this by having the GoldOwner in the DemoAfterSprint meeting (roughly equivalent to XP's IterationPlanning).


      Ack. Whatever its merits as a development technique, XP has clearly suceeded in generating a remarkably high concentration of silly buzzwords.
    6. Re:Success Stories? by JasonAsbahr · · Score: 1

      To quote the Wiki:

      It has now been 18 months since I left DaimlerChrysler and the ChryslerComprehensiveCompensation system. The decision to stop further development on the software was made in January 2000. A lot of people have been speculating as to why this occurred and what are its implications for XP. As far as I can tell, all of this speculation has come from people who were not there.

      At last report, the software is still running. It is not paying as many people as it did at its zenith. In fact it is paying a very small group of former employees who are eligible for extended layoff benefits. Not what we had in mind when we started, but it is doing a job that no other available piece of software can do.

      DaimlerChrysler still wants to replace all of their payrolls systems with a single solution and are gearing up to spend about 4 times C3?s total cost to do it. This will be DaimlerChrysler?s fifth attempt to do this. C3 is the only one to go live, in fact, at one point it was paying employees from what were three separate payroll systems.

      None of this actually matters, because building a payroll systems was C3?s secondary goal. I don't think anyone has written about this before, mostly because it happened before RonJeffries joined the team. The team?s original charter, and it was reiterated when the decision to bring in KentBeck was made, was to learn how to use object technology, to learn how to manage projects that use it and if we built a new payroll system, that would be gravy.

      There can be no question that we achieved the first two. New software at DaimlerChrysler is being written using objects (if you can call Java objects). Management was not happy that we didn?t replace the old payroll systems, but they didn?t ride us out of town on a rail. C3 alumni have gone on to lead development efforts in areas central to the company?s success, areas such as cost management, vehicle manufacturing and personnel management. Reports of XP?s demise at DaimlerChrysler have been greatly exaggerated. In fact, we are beginning to see a second generation of conference speakers come out of DaimlerChrysler. At the 2001 JavaOne conference Dave Boehme, gave a talk about how his team, with the help of a C3 alumnus, turned around a large scale J2EE project.

      As best as I can tell, the decision to stop C3 development was made, not because we were wasting the company?s time and money, but because it was time to use what we had learned on more important problems. We did not work for a payroll processing company; we worked for an automobile maker.

      The techniques learned on C3 are now being used on projects that impact the bottom line. As a stockholder, I think it is a good thing.

      With all that being said, what really happened at C3?

      I don't think that there is one simple answer to that question. The best answer is that we stopped providing value to our customer. Elsewhere on this page the bifurcation of our customer is discussed. The fact that we had two customers, with differing goals, means that we violated the principle of a single on-site customer. Let this be a lesson to you! Your customer must speak with one voice and if that is not the case you will suffer. -- ChetHendrickson

  22. XM by oliverthered · · Score: 1, Insightful

    eXtreme Medicine.

    Your feeling I'll, so you pop along to the doctor.
    Hey Doc, I have a problem can you fix it.
    The Doc has an Idea what's wrong, could be complicated, but:
    throws a load of drugs at you
    does a some tests, your a bit better but, well have some nasty side affects.
    Changes some of the drugs, and gives you a few more......

    In the end, your sort of all right, but a drug addict, and occasionally have to go back and get a different fix from the Doc.

    Not-so eXtreme Medicine.
    Your feeling I'll, so you pop along to the doctor.
    'Hey Doc, I have a problem can you fix it.'
    The Doc has an Idea what's wrong, could be complicated.

    I'll put you on some light medication and get an appointment with a consultant.

    The consultant comes along, has a word, still not sure, advises the Doc on some better medication gets in a specialist for one of you conditions.

    The doc treats most of you conditions, and some have already cleared up.
    The specialist takes a look at you and give the Doc some more advise and training.
    After a few months you in perfect health.

    --
    thank God the internet isn't a human right.
    1. Re:XM by giel · · Score: 2, Insightful

      IMHO you mix things up, sorry.

      eXtreme Medicine -> not so eXtreme Programming:

      (in general use a lot of blahblah and don't show what you're doing)
      make a big picture of all what's wrong
      try to fix everything at once (dripping nose, broken legs, breast enlargements, etc)
      determine whether or not thing have gone well is the patients problem (hey my?? oh, cute, well let's make em even bigger)
      leave your patient, with a lot of (new) problems


      not so eXtreme Medicine -> eXtreme Programming:

      (in general use a little blahblah and show what you're doing)
      focus on the most important issues (broken legs)
      make sure you can see if it's fixed
      fix the most important issue, and continue with the next important thing (dripping nose)
      disencourage breat enlargement


      Yes, it means that you need very good developers for XP. These people must be able to do good designing to have the big picture in mind and they must be able to judge quality.
      Do they exist? Yes...
      Many? Enough, but there is an awfull lot of very crappy developers out there.

      --
      giel.y contains 2 shift/reduce conflicts
    2. Re:XM by Anonymous Coward · · Score: 0

      I think you've mixed things up....
      XP takes an all things to all men aproach, programmers are notoriously bad at remembering things outside because they have soooo much to remember for there work, a better aproach would be to allow people to work in there specilist area alowing 'expert' development and not just the jack of no trades aproach taken by most companies.

      I'm good at design encapsulation and debugging, I'm not that great at general codeing. As a result you get a well designed program with few bugs only because I fix all the bugs that I introduced through typos and other weirdness.

      typically I can write about 5000 lines with one logic error and 20+ typos.

  23. My view on XTREMEprogramming by Anonymous Coward · · Score: 1

    I've never really tried the official XP methods, but I have had a couple experiences with some of the ideas of it, like when I'm coding when my brothers or "programming literate" friends are around. My general conclusion is that it works pretty well, you don't make as many mistakes when first typing your code and they make it easier to find problems when you do make mistakes.

    I don't know whether it is truly more practical than two separate individuals programming, but it does feel more productive and more enjoyable, it's like you hardly ever get stuck on anything.

    The thing is, like I said I've only done it with my brothers or friends, people I generally get along with. I could easily imagine my great experience with it turning into the programming project from hell if you don't like the person you're with.

    1. Re:My view on XTREMEprogramming by _pruegel_ · · Score: 1

      It does not make any sense making two developers an xp team who do not like each other. If a manager does this than he/she is a bad manager. Generelly you should change teams quite often to ensure knowledge flow and you should never force anyone to do pair programming. Some people just can't stand it and they for sure would be less effective if forced.

  24. Do we need a book for every rule of XP? by Anonymous Coward · · Score: 3, Interesting

    What? Is he going to write a book for every rule of XP?

    Testing is important, but XP testing philosophy is a catch all for actually thinking about your product and the purpose of you product. XP is about making hack programmers look legit. XP has some good points, such as an emphasis on simplicity, testing, and customer satisfaction, but mostly it's about making bad habits look good, like no design and iterative feature hacking with ignorance to the bigger picture of the app.

    Some design up front is important. Documentation is important. Code ownership is important to an extent. In a medium to large system, having everyone able to change any line of code is just stupid. People change shit and don't have a clue why the code looks the way it does. One of the arguments for no code ownership is that a lead architect can't keep it all in his head. Well, what about a team of that consist of many folks that aren't as capable as that lead architect? they are able to comprehend the whole system according to XP. And, they are allowed to change whatever they want, when they want. So, get a couple of average programmers with large egos, and you have a lot of problems.

    XP is great for people who are happy doing bug fixes all day instead of avoiding the bugs to begin with. The assertion that XP results in less bugs is pure speculation and from my experience, a very misleading claim. Just because your test succeeds doesn't mean that your program is correct. And if the test is the only glue validating the success of your final solution, you're screwed.

  25. just another way of designing by WPIDalamar · · Score: 2, Insightful

    It sounds to me like this is just another way of designing, but that makes the wrong emphasis. These tests sound a lot like low level use-cases. You should be creating those anyways. But you should create all of those first! Not one at a time as you code.

    1. Re:just another way of designing by dubl-u · · Score: 1

      It sounds to me like this is just another way of designing, but that makes the wrong emphasis. These tests sound a lot like low level use-cases. You should be creating those anyways. But you should create all of those first! Not one at a time as you code.

      Should? What, because it was written on the back of the stone tablets that Moses brought down?

      Hi, I've tried it both ways. Test-driven design and refactoring work. It's possible to build good software both ways. In my opinion, TDD and refactoring are more productive and more fun. But hey, you're welcome to stick with your stone tablets if you want.

  26. Oh say can you rock by Anonymous Coward · · Score: 0

    There's trouble in a far off nation
    Time to get in love formation
    Your love's more deadly than Saddam
    That's why I gotta drop da bomb

    -Party Posse

  27. Tests are only as good as your requirements�. by (H)elix1 · · Score: 3, Insightful

    Requirements are the Achilles heel of XP. Without rock solid requirements, you are just guessing for the test scripts.

    Take a trivial example -- an entry form for a phone number. What is a valid phone number? Add in real world things like extensions, folks using alphanumeric substitution (1-800-DISCOVER), and internationalization and it gets interesting. Now a test driver is not that big of a deal if you know what to put in it. From a design standpoint, it would really be nice to have solid requirements and test scripts that provide concrete examples as to what the business was asking for. Real world? I could only dream for mediocre requirements that might resemble not only what they asked for, but what they want.... At least enough to try and read their minds.

    1. Re:Tests are only as good as your requirements�. by Lumpish+Scholar · · Score: 1
      Requirements are the Achilles heel of XP.
      Then user stories (what others call "use cases") must be the glass slipper. XP addresses this; read Planning Extreme Programming by Kent Beck and Martin Fowler (Amazon.com, BN.com).

      XP also calls for "customer on site"; the theory is, it's far quicker to get answers in real time rather than waiting for someone to write a 600 page document.

      THIS DOES NOT SCALE UP. You know it, I know it, Kent Beck probably knows it. Some of the other agile development methods try to address this.
      --
      Stupid job ads, weird spam, occasional insight at
    2. Re:Tests are only as good as your requirements�. by mikemulvaney · · Score: 2, Informative
      I think you are missing the point. You seem to realize that you are never going to get rock solid requirements, which I think most people would agree with. But then you use that as an excuse to throw away XP?

      Test Driven Development is a great way to deal with changing requirements. For a phone number validator, you would write up tests for all of the initial requirements:

      testLocalNumber()

      testLongDistanceNumber()

      testTenDigitLocalNumber()

      testAlphaNumericNumber()

      Then when you deliver the application and find out that you need to deal with international numbers, you write:

      testInternationalNumber()

      You get a red bar, beacuse you can't handle i18n numbers yet. So get that working, and when you are on a green bar, then you know that it still works for all those US numbers and it works for the new foreign numbers.

      Then you extend as you get new requirements:

      testEnglishNumber()

      testFrenchNumber()

      testItalianNumber()

      What is the alternative to this? You are still lacking requirements, even if you aren't doing TDD. But you wouldn't have any tests, and you wouldn't know exactly what your class can do for you.

      Test Driven Development is not all about leaving test artifacts. The tests are constantly changing during development as your requirements change. The main idea behind TDD is to program from the client side of things first. This is similar to the idea of writing documentation first, with the added benefit that as you finish the tests, you prove that the class does what you want it to do.

      -Mike

    3. Re:Tests are only as good as your requirements�. by swisener · · Score: 1

      So write tests only for the cases your code can handle. If someone asks if your code handles extensions, you can look at the tests, see that there's not one there, and confidently answer "No, but I can add that..." Your tests are then invaluable in describing the functionality of your system.

      --Steven

    4. Re:Tests are only as good as your requirements�. by dubl-u · · Score: 2, Insightful

      Requirements are the Achilles heel of XP. Without rock solid requirements, you are just guessing for the test scripts.

      Spoken like a guy who has never done XP.

      One of the core requirements of XP is known as the On-site Customer. This means that there should be somebody at all the meetings and sitting within shouting distance of the programmers, somebody who can answer questions like that or find out the answers. (In some companies this person is called a Product Manager; in others a Business Analyst).

      I could only dream for mediocre requirements

      Yes, requirements documents are generally silly. That's why XP doesn't use them. Instead of waving around some phone-book sized pile of garbage, XP practitioners use high-bandwidth, low-latency communications techniques: they talk. And they try out new versions of the software every week.

      At least enough to try and read their minds.

      Yep! And get yelled at when it turns out you don't have psychic powers. 'Cause that's what it takes to make standard development practices work. Isn't that a sign we should try something different?

    5. Re:Tests are only as good as your requirements�. by (H)elix1 · · Score: 1

      I think you are missing the point. You seem to realize that you are never going to get rock solid requirements, which I think most people would agree with. But then you use that as an excuse to throw away XP?

      I'm not sure I have. First off, I'll qualify this - I've done some XP development and I am bit cynical at this point in time. I'm not expecting a 200 page specification document, use cases, etc. Normally I'd settle for a return phone call, email, or some sort of feedback/response. The business users tended to be vague or rotate the requirements faster than a borg's shields if they responded. That was a pretty big if, btw... Poor communication is a major hurdle for any methodology, and XP suffers 'when business behaves badly'.

      In the above example, what the business really wanted was a unique identifier - they just did not know it at the time. The phone number changed to an email address, to a SSN, and a few other things. The XP process puts too much emphasis on testing at the wrong time, IMHO. The forest was lost in the trees.

      Don't think I'm against test scripts... I create drivers in my own code, and also expect someone to test the veracity as well. To be honest, I think it is better if I don't create the final test script as users tend to have an unlimited imagination when it comes to using things improperly. The lack of faith in XP does not translate into dumping QA at the development, staging, or production level.

      I've got opinions on paired programming, and a few other aspects of XP too. The short of it is if you have strong communication, teamwork, and realistic expectations, almost any methodology will deliver. Success when things are going to hell in a hand basket? XP is not a silver bullet. I've seen management cut the number of workstations in half, but when was the last time you saw a 40 hour work week?

      Anyhow, I concur about test based development. Same idea, different denomination... (grin)

    6. Re:Tests are only as good as your requirements�. by jgp · · Score: 1

      Obvious: The unit of functionality here is to be able to understand an arbitrarily complex phone number. Not validate all phone numbers, which is very fuzzy and probably impossible (since it is a function of where the number is expressed such that the same number tested in to different locations will be evaluated different).

      Write some tests for a phone number specification language, make your code pass the tests and your done. Now what you expess in the phone number specification language is .. the customer's problem^H^H^H^H^Hchoice.

    7. Re:Tests are only as good as your requirements�. by (H)elix1 · · Score: 1

      The example had an evil twist. The customer driving the specifications was internal, while the users were not. In the end, the business really needed a unique ID for each user and group, but tried to implement it by giving us only the information we needed at the time. There was no initial design meeting, just a steady stream of ever shifting requirements since we 'refactored' and drove the process through regression testing. Their interpretation of XP...

      Natural selection fixed the problem - everyone (myself included) lost their job and options.

  28. Integration tests on entertainment software? by yerricde · · Score: 1

    OK, so developing automated unit tests, possibly even before writing the code that will be tested, is usually straightforward and almost always a good idea.

    But how can anybody design automated integration tests for applications that are intended and designed to have pseudorandom behavior, such as interactive entertainment software?

    --
    Will I retire or break 10K?
    1. Re:Integration tests on entertainment software? by Anonymous Coward · · Score: 0
  29. Book Draft is available online by Googol · · Score: 3, Informative

    here, [pdf,yahoo.com] with more information here[vt.edu].

  30. My (mixed) experience with test-driven development by Lumpish+Scholar · · Score: 3, Insightful

    I've done a little test-driven development on my own.

    Test-driven development seems to call for a series of baby steps, each corresponding to a unit test case. Unfortunately, I wasn't always able to identify "the next baby step"; even if I could pick what I thought was the next unit test, I sometimes found myself spending far too much time, and writing far too much code, for just that next test.

    I also sometimes found that "the next test case" already passed. I don't know if I wrote more than I needed to early on, or I picked the wrong next case, or if there's more to all this than I've picked up.

    When I was in good TDD mode, I was flying; test, red, code, green, refactor, green, next! It's a very rapid, and very intense, experience. There's a reason XP usually calls for a 40 hour week; by the time you're done with a few hours of this, you are tired! (But you've gotten a lot done.)

    --
    Stupid job ads, weird spam, occasional insight at
  31. MarathonMan by smileyy · · Score: 1

    MarathonMan Brought to you by your good friends at ThoughtWorks.

    --
    pooptruck
  32. Re:Write code to determine if your code is flawed. by chip33550336 · · Score: 1

    Actually, I think that refactoring roots itself in reality. A greater percentage of the time a programmer (as a consultant or newly hired employee) will be brought into a situation where there is an existing application. Generally there isn't an option to redesign an entire application without costing the company more $$$ than it would like.
    Better Design is perferred, but it is not always a reality in the workplace.

  33. eXtreem buzzWording by shadowtramp · · Score: 1
    With time passing it seems to me that all this "test driven programming" promoted by people who completely forget about basical design.
    Realy! Who will care today about all those boring things like FSM analysis and formal task description! Who needs deep understanding of what his/her software does, when one just can test small part of it!
    I just want to emphasize following simple thought: one may invent new perpetuum mobile without slight undrstanding of physics. And those invention nowdays aren't even considered anymore.
    Computer science is matured enough to be utilized in everyday work. One have no need to study another perpetuum mobile invention guide. Just remember you classes.

    I hope that in my lifetime analitical computer science will take its place in program developmen instead of witchcraft spells.

    I just want to ask those adpets of XP: how you will ensure that small change in the code won't affect quite distant code parts?

    --
    I'm not a brake. I'm an accelerator. Just a slow one...
    1. Re:eXtreem buzzWording by Anonymous Coward · · Score: 0

      I hope you code better than you spell.

  34. XP == Xtremely Pstupid by copyconstructor · · Score: 2, Informative
    One day my manager came and suggested we try XP. So I did what I normally do in such situations and did a search on the pattern [stupid management suggestion] +stupid and quickly turned up what I was looking for:

    http://http://www.softwarereality.com/lifecycle/xp /case_against_xp.jsp

    In two minutes I was able to save both myself and my company many man-years and headaches.

    1. Re:XP == Xtremely Pstupid by copyconstructor · · Score: 2, Informative
  35. Great without XP by Anonymous Coward · · Score: 1, Interesting
    We've been going through a big management push to have quality code. A QA manager is now senior VP over development. So, I picked up the book and read it and tried it out.

    I'd already written an engineering requirements document which we reviewed with management and our partner company on the project. I've already put together an architecture document showing all the major components and who talks to whom (reviewed with the dev and QA teams). My manager even insisted that I write a design document on the specific module I was about to write, which included a schedule and unit tests.

    After two months of documentation I was desperate for a chance to code. TDD? Why not. I gave it a try -- not in nearly the detail the book mentions, but I have a dozen tests each hitting a key requirement of the design. When I recompiled the code for the ARM hardware, it was gratifying to see that everything still worked on the target platform. Every time we make a change, we have the initial tests I wrote to make sure nothing is broken. It's nice.

    I'd like to make the junior guy's do this -- at least then I can tell how far along they really are. "Oh, it's 80% there!!" Sure, show me the test cases that pass and how these relate to the requirements and design.

    Don't ask me to pair program. I'd rather write docs and review them with the team and do code reviews.


    BTW, I didn't like the book that much. But the method is good.

  36. Finding appropriate tests by Anonymous Coward · · Score: 0

    I am an OS developer and I am an extreme proponent of developing using extreme programming as my development method. I have three tests that I have set for myself. I have to be able to run GCC with correct output and with good efficiency (relative to Linux). I have to be able to run XFree86 with correct output and with good efficiency (relative to Linux), and I have to be able to run KDE with correct output and with good efficiency (relative to Linux). Also, it has to run all those tests on an 8 processor test machine using all 8 processors of the machine.

    Anyway, I can come up with lots of tests (I do have lots of tests!) but the XP thing just doesn't work... most of my bugs are things I wrote months ago that are tripped by some odd race condition.

    Also, KDE seems to crash all the time. What is the XP-complete thing to do about this?

  37. scrum methodology plus xp == happy developers by maharg · · Score: 2, Informative

    I work for a largish (the largest?) media organisation in the world cutting code as part of a team of 4 developers plus a senior developer.

    We've been using Scrum and Test Driven Development for about six months now, and there is NO WAY I'm ever going back to writing code without writing tests first.

    Scrum (see http://www.controlchaos.com) is a "lightweight" development methodology. It's developer driven (no more gannt charts !!!!), and it's agile, meaning that it embraces change throughout the project lifecycle. I can highly recommend it. But I digress...

    Test Driven Development is something that every halfway serious programmer should be doing IMHO. It doesn't replace the initial back-of-a-fag-packet design stage, nor does it stop you designing elegant and effective architectures. What it does do is:

    • force you to define rules that your code must obey by requiring that you write tests first. This really is useful, because it makes you think about the implications of how your application behaves.
    • facilitate unit testing - you know that every function, procedure etc works as expected, and fails as expected.
    • facilitate regression testing - when you change / enhance / refactor or otherwise modify your codebase, you know that you have not broken any existing functionality, because you will re-run the test suite against the modified code. Of course, you will have added tests for the new / changed functionality before having coded the new / changed functionality.
    • focus your mind on developing the required functionality - when all the tests pass, it's time to stop coding. No temptation to just tweak a line of code. Careful with that axe, eugene.

    So I can recommend TDD. Check it out. By the way, we're coding mainly in python with some java thrown in too.

    --

    $ strings FTP.EXE | grep Copyright
    @(#) Copyright (c) 1983 The Regents of the University of California.
  38. I might be missing the point... by The+Brain+Murderer · · Score: 1
    ... but I have always found that quality goes up and the nunmber of bugs go down when there is actually adequate time allowed for development and testing.

    So many projects don't even get completed and this is mainly because management will not accept realistic estimates as to how long they will take to complete so the timescales get shrunk and funnily enough, the project runs over. Once the time pressure is on, quality goes out of the window because it is more important to deliver.

    Cynical??? - Maybe, but I have seen this happen so many times and yet no-one ever faces up to the fact that poor estimates are the root cause of most failures. If it can't be done in time, DON'T DO IT. If it must be done, allow sufficient time to do it properly.

    Still, I'm only a software engineer. What do I know about anything.

    harrumpf.

  39. Kent Beck is a cult leader by Junks+Jerzey · · Score: 1, Troll

    First of all, note that I'm not knocking the principles of Extreme Programming (XP).

    The first XP book written by Kent Beck reads like a self-help book. If you're going to write a book whose principle is "feel good about yourself," and you're trying to fill 200 pages, then you can't just cut to the chase. You have to ramble on for a few chapters about what you're going to say, and slowly let out bits of information here and there, then there are chapters the reiterate what you've already said. Beck's books--and all of the books in the XP line that I've seen--read the same way. You could explain XP clearly and concisely in a few pages, but the XP books go around and around in cicles, and after a while you're not sure if you're getting new information or not. And, miraculously, the XP line has been extended to six or more books, each of which goes over the same small bit of information in another verbose and rambling way. There's even a book about XP critcisms, which is an officially sanctioned book in the XP series, which exists simply to reinforce the basic principles of XP.

    The whole thing smacks of books like Dianetics or various lightweight volumes from self-help gurus. If there was any meaning to XP, it has been lost in endless self-justification. Imagine an entire series of books that did nothing but tell you how cool Linux was. What's the point?

    1. Re:Kent Beck is a cult leader by Anonymous Coward · · Score: 0

      Imagine an entire website like Slashdot, where the stories and posters do nothing but tell you how cool Linux is. What's the point?

  40. Re:Write code to determine if your code is flawed. by dubl-u · · Score: 1

    Any faults that you have in your conception of your test program will be carried over into your module, or worse your module might be correct but your test program flawed

    In practice, this isn't really a problem. As long as you write your tests first (rather than hacking them together afterwards) then they're a pretty good expression of what the code should do. Then the code itself is an expression of how to accomplish that.

    Of course, it's possible that one has the wrong idea and makes the same mistake twice, but you use other practices to guard against that.

    Seems like an extra layer of complexity rather than a useful method.

    Maybe. My score for the last year or so is less than one reported bug per man-month of coding. And it's lower than that for my code written while doing pair programming.

    I spend almost zero time hunting bugs.

  41. Re:Write code to determine if your code is flawed. by Anonymous Coward · · Score: 0

    This appears at first to be a trivial observation ("who will test the testers?"), but you're right on the money here. No spec is thorough enough to explicitely detail every possible scenario, and you just aren't going to consider situations in writing your test app that didn't (or won't, in XP) occur to you when writing the module.

    The best solution that I can think of (and it's still far from ideal, as it takes manpower and is only statistically more likely to find bugs) is to have many test apps written by many different people, all based on the spec.

  42. Design & requirements by Anonymous Coward · · Score: 1, Interesting

    Especially with multi-processor systems, you need a solid design. Design errors here will kill you no matter how much testing you have. Generally, thinking of the tests will help you flush out your design. With a multi-threaded / processor situation, you have to know that you have no race conditions or deadlocks. Tests only say, "for this run, nothing went wrong" you need a design that says "for any run, it will always work". Review the design with others as these can be hard to spot. Once you have a good plan, you have better tests to help ensure you deliver on the plan.

  43. And now for something completely different... by Baracus · · Score: 1

    Here's an idea: design projects so that they're testable! Yeah that's right design components and subcomponents so that they can be tested! This is the biggest problem I have found when tackling any project. Developers are always thinking in terms of quick and dirty solutions delving straight into implementation details without paying any attention to architecture

    The fundamental problem is that most folks aren't thinking in terms of testing and architecture. I'm not convinced that the XP method works. Actually, after having read the case against it, it seems counter-intuitive and plain annoying. I'll say this though, XP is onto something by placing such a strong emphasis on testing. The first question on every developer's mind should not be "How can I solve this problem?" but "How can I solve this problem with a testable solution?" The project architecture should be subsetable and the only way to achieve that is by designing each piece of the total solution to be testable.

    A project I'm currently working on has a portion of the team building a GUI enabled, unified test suite for testing the many components being developed. The developers in turn are making sure that each component has an interface available so that they can plug their components into the tester and test them. Not only can the developers test their own code with confidence but so can their peers without having to look at code written by someone else.

    So far it seems as if the effort being invested into the dedicated testing environment is paying off...

  44. Extreme Programming-why not exterme hiring? by linuxislandsucks · · Score: 1

    Most of the time software is bad because in experienced college grads nto trained in testing are hired to code out a project...win3.0 through win95 and winNT3 to winNT4 are good exampe sof that approach..

    Paired programming starts with the HR department when they hire programmers for a project in that one should hire 7%5 exp in solving that exact or similar problem and 25% inexpericed in that area for that specific project..

    But most companies as you may knwo woudl rather save short term costs and vastly increase futre costs rather than do it right the first time..

    Contrast the with OpenSource OS efforts where testing is a standard processs simply because it gurantees it will compile right on very lean sub standard machines that this group tend s to have access to do their work..

    The reason why HP and Microsoft and Cisco went to India to recruit and staff coding centers is because they understand testing jsut as OpenSource does...

    How to chgange in the US? Volunteer to be an informed Software Eningeer speaker at your local univeristy..speak and instruct the new CS students on testing...

    --
    Don't Tread on OpenSource
    1. Re:Extreme Programming-why not exterme hiring? by Anonymous Coward · · Score: 0

      Umm... I think cost has a lot to do with hiring programmers in India vs. US also.

  45. Re:Write code to determine if your code is flawed. by phamlen · · Score: 1
    I wrote a test program to test this module. But then I remembered that I forgot to write a program to test the test module!

    Actually, test-first development tackles this case specifically. You write the test first - which has to fail since you haven't written the code yet. (Technically, it even fails to compile. You then create stubs for the methods you call so that it compiles.) This is the state known as "Red". If the test passes when you first create it, you know that you have a bad test.


    Once the test fails, you then write the code so that the test passes. This is the state known as "Green".


    In practice, I do find that I occasionally write insufficient tests - which means that bugs get into the final product. But once a bug report comes back in and we find the problem, the first thing we do is write a test that fails (ie, back to the red state.) Then we fix the bug so that we move to the green state. And voila, we have a regression test for that particular bug.


  46. But I thought.... by Tsali · · Score: 1

    Extreme Programming was eating Taco Bell and coding at the same time. /rimshot

    --
    This space for rent.
  47. The important bit: zero tolerance for bad code by pong · · Score: 1

    Here's the thing in a nutshell as I see it. Up front design is not outlawed by XP, but the XP theory is that you can go faster if you skip it. More importantly if you have a big up front design you are likely to be more likely to stick to it, even when you realize that real life is different from the assumptions that you based your design on. You will then start living with adaptations and local fixes and your code starts growing these tumor-like work-arounds that will eventually kill your ability to maintain the code.

    The really important thing in XP is that there is zero tolerance for bad code and incomprehensible design. Once it is realized that something could be made better another way it is changed to be that way. The automated tests greatly facilitate this.

    1. Re:The important bit: zero tolerance for bad code by thac0 · · Score: 1

      More importantly if you have a big up front design you are likely to be more likely to stick to it, even when you realize that real life is different from the assumptions that you based your design on.

      My experience is that any project that would make the 'stick to it' design decision you mention above is going to fail regardless of what flavor of project management they choose. A management plan cannot make up for a team that makes poor decisions in the field.

      If, however, you assume compitence of the team then I see no reason to believe that, just as XP refactors code and therefore design explicitely, a non-XP approach can refactor code and design explicitly.

      That said, I believe that an explicit design is axiomatically better than an implicit design. If people know what the design is they are more likely to be able to work to it and contribute to fixing it. There is little to no oppourtunity to do this in XP.

      --
      poliglut.org: they're still alive and fighting the man
  48. Re:My (mixed) experience with test-driven developm by Bob9113 · · Score: 1

    I sometimes found myself spending far too much time

    Generally my unit test code writing takes about 100% - 150% as long as my production code writing. However, I spend almost no time on debugging. I find 95% of the bugs that would otherwise make it to the QA department (or worse yet, production) while the problem is still fresh in my mind. Usually it's caught and cleaned within a few minutes of when I write it.

    Try not writing any unit tests on a fairly isolated chunk of code sometime. Then keep track of your debug time on that class for the following six months.

    and writing far too much code

    The more you write unit tests, the quicker you will become at laying out test data. You may also want to look through the constructors of your production code - sometimes this can be an indicator that it would be worthwhile to simplify the construction process. If it's taking you a bunch of lines of code to get a test-worthy object when testing, it probably takes a bunch of lines of code to get a usable object in production.

    That said, there are some objects that are just a hassle to create a sample of. For those, I grit my teeth and get through it by reminding myself how much worse it would be to have to debug it after it's in production, with the customers at a standstill and my boss pacing a groove in the carpet.

    I also sometimes found that "the next test case" already passed. I don't know if I wrote more than I needed to early on

    My first test for a given class usually fails with a "cannot resolve symbol" because the class doesn't exist yet. I also occasionally go back and intentionally break a class to get the test to fail, because I want to verify that the test itself is actually testing something (prevents you from having to write a test class for your test class: Monkey, MonkeyTestCase, MonkeyTestCaseTestCase, MonkeyTestCaseInfinity, MonkeyTestCaseInfinityPlusOne...)

  49. Just say no by Anonymous Coward · · Score: 1, Insightful

    I worked at a company that decided to do exclusively Extreme Programming. They even hired an extreme programming coach whose name I won't mention but would be recognizable to some people. We had tons of problems as I see it but the manager likes this way of doing things so they are doing it until their VC funding runs out. I found XP to have quite a few problems.

    1) Lack of planning

    We didn't plan and ended up redoing things over and over. There were things we (the experienced people) knew well ahead of when we had to do them. Things that were self evident from day one and other things that a half decent architect would have recognize as needing to be addressed right away. Hoping to refactor things all the time is nuts since it ends up chewing up tons and tons of time. Writing what was suppose to be a "server" without taking into account multi-threading and more than one user was an example of this.

    2) Lack of code ownership

    You can?t ?fix? something when you don?t own it. The funniest example was our battle with the coach. He changed something that was working fine. We found lots of bugs in it that were a result of refactoring. We decided to change it back to a previous version but included a comment in the cvs log saying why. He must have gotten pissed and checked it all back in including the bug. Idiotic. People make mistakes and never correct themselves because there?s no feedback since they don?t live with their mistakes. Other people ?fix? it. Sometimes it?s not broken but simply a different solution to the problem. This is best called battle of the microarchitectures. The code doesn't get finished.

    3) Pair programming

    This was so tiring. Watching someone make mistakes and correcting them is boring. It?s worse almost for the person making the mistakes because they get constantly corrected even when they are in the middle of formulating stuff and just moving things around. It?s very tiring. You cannot force anyone to make a change because if they disagree they just keep doing what they want if they have the keyboard. How long can you complain before you get tired. If someone lives with their mistakes and corrects them fine but why have someone look it over. I didn?t see the quality of the code being any better than before we did do this stuff. In fact it tended to get worse because we were so bored we started making more and more stupid mistakes.

    I'm not necessarily discouraging XP. It's great. You can actually slack off much more than in a regular shop. There's always your pair to blame and since no one owns anything there's no one to pin something on. The coach even admitted when interviewing someone that XP doesn't lead to producing experts since the knowledge is distributed in the group and no one concentrates on any particular thing.

    The tests are a total joke. Since people want to test every method we have very little private methods (read encapsulation) because you can't test a private method from another class. Since it's expensive to do the set up for a method and we are testing a thousand or more methods a lot of methods are simply public static (we are doing Java BTW). Since everything is tested you just end up throwing away tons of tests every time you realize there's an easier way to do things. Some times you say to hell with refactoring something since that would mean changing tons of tests.

    I totally hate working at this company. It sucks big time. Our code looks like spaghetti. I've already decided as I look for a new job that I will not work for an XP shop again. I'll consider another agile shop with an architect and some thought out plans for an architecture and testing.

    1. Re:Just say no by Anonymous Coward · · Score: 0

      We had similar experiences. We tried using Mock Objects in our testing to make things simpler. Like a bad joke some of the tests ended up testing the Mock Objects and not testing the product we were actually developing.

    2. Re:Just say no by Anonymous Coward · · Score: 0

      You got off easy. Our boss is a control freak. He loves XP. With a script he tied check-ins to CVS through Eclipse so that you had to put in the pair name and how much time you spent on what you checked in. If people were pairing together too much he put a stop to it. He didn't want cliques to form controlling the code.

    3. Re:Just say no by Anonymous Coward · · Score: 0

      I've got it worse. Our XP "coach" actually told someone they were programming too fast with their pair. The joke is she built in six months a prototype that does more than the "production" code the eight of us have been working on for six months.

    4. Re:Just say no by Anonymous Coward · · Score: 0

      Get off it. XP is so tiring that after a week of this shit people are tired and mad. They've fired three people at my company so far out of a max development team of eight because the programmers got a little to tired of XP and have questioned using XP.

    5. Re:Just say no by CarlBenda · · Score: 1

      I'm not sure why people seem to think that this methodology is driven by programmers. XP is great for managers who want to control their team.

    6. Re:Just say no by Anonymous Coward · · Score: 0

      what you speak has the ring of truth. a garbage methodology for script kiddie hackers who like to spew crap code. no thought, no planning, no architecture. to hell with tomorrow, let's just code what we need _right now_. never mind the fact that YOU TEND TO USE WHAT TECHNOLOGY IS AVAILABLE NO MATTER HOW INFERIOR. if that isn't a solid argument for application frameworks (the antethesis of XP) i don't know what is.

      i guess when you only have a hammer all your problems start to look like nails. but when you realize it isn't a nail, not to worry. we'll just refactor it 8x and the architecture will emerge. hell i like that, let's coin a new paradigm "emergent programming". as in "look what just emerged from my bowels".

    7. Re:Just say no by CarlBenda · · Score: 1

      No need to come up with a new phrase. Its been known as "debugging into existence" for a long time. DIE for short I guess. The XP people just hide behind a new set of acronyms for DIE.

  50. If you meet the XP in the road, kill the XP by code_rage · · Score: 1

    Some of the comments I read in the "software reality" web forum that defend XP sound a little... well, defensive. One comment made it sound more like a philosophy than a set of measurable practices. I also sensed in the "case against XP" article that the author feels that XP's defenders can always say "Well, they didn't implement XP in the way that Marx^H^H^H^HBeck intended, so it doesn't count!" just as supporters of Communism sometimes said about Marxism(TM).

    I think the "Case Against XP" makes a lot of valid points. Who can afford to continuously refactor 100KLOCs of C code for example? It's hard enough keeping up with the integration issues with a stable code base. You want code rage? Try breaking a few dozen test cases by making "improvements" to your design that ripple in all directions.

    One important point about "Case Against XP" is that it may be criticizing radical forms of XP that might not exist in practice. A little slack might be warranted if XP projects in practice do not actually churn the code base as much as the religion might expect. And the author makes fun of Beck for excessive optimism, even as he exhorts the effortlessness and elegance of "getting it right the first time"... yea right.

    So yes I'm a critic of XP, but I'm also a critic of ~XP.

    If you meet the XP {booster,critic} in the road, listen to him but don't follow him... chaos and madness may await you as surely as dereferencing NULL. You must find your own way on the road, grasshopper.

  51. I prefer bug-driven development... by DrCode · · Score: 1

    Write a bunch of code that possibly does something like you think you or the user wants. Let someone else try it out, then fix what they complain about.

    I'm only partly joking. When the requirements are vague, this actually works.

  52. This is new? by Anonymous Coward · · Score: 0

    I've been doing this for 10+ years... it's the best approach for coding there is. It may not look pretty, but hell .. it works, and it works a hell of a lot better than any of my competitors' software ever will.

  53. Testing database-driven apps by SlowMovingTarget · · Score: 1
    "I was also hoping for more of a discussion on the practicalities of unit testing database-driven systems, where you frequently have to test business entities which are closely coupled to the database.

    This is kind of like that joke: "Doctor, it hurts when I do this..." Seriously, avoid, where possible, coupling your classes (even persistent ones) to a database. The fact that you're having trouble testing these should tell you something about the quality of the encapsulation in your system.

    It certainly was an eye-opener for my development team. We were working with an implementation of the Data Access Object pattern (Service class +value object + DAO = persistent component). What we found was that the further we got from the database, the more we were repeating tests. In other words,test that DAO can retrieve, test that it can write. Then test that the service can read, then that the service can write, and go check the database. Set up and tear down was a major pain, and only got worse, until...

    We figured that we couldn't be the only ones to run into this issue. We started digging around the Wiki Wiki Web to find suggestions for how to factor our classes properly to make them easier to test. We turned up the Mock Object pattern. Basically, have the DAO implement an interface, then implement that same interface in your test. You now have a well factored class, and you can do setups and teardowns of data that doesn't exist.

    Handling related instances is difficult, but that leads to the next refactoring... a domain model architecture with a service layer on top, and a o/r mapping layer underneath. But that's another story.

  54. XP experience by RCR · · Score: 1

    I did about 6 months of XP (all day team programming included). Some comments:

    "Test First" helps more than you can imagine without trying it. Our rule was "no code is written unless it's a fix for a broken test". This saves all kinds of time wasted on grand schemes, frameworks, APIs, etc. - you're forced to write what you need, *just* what you need.

    By the time you've written the tests, you understand the problem a lot better than you did when you started.

    Having the tests gives you the connfidence to refactor. When you can test *all* your code by running the hundreds of tests you've built up over the course of the project, you'll never again hear (or say!), "I'd like to imprive module X, but I'm afraid I might break the system."

    I'd encourage anybody to give "test first" a try, even if you don't combine it with other XP practices.

  55. Jim Highsmith? by Lucas+Membrane · · Score: 1

    IIRC, he was some years back the mastermind of a big OO project at Cash'n'Carry stores. Is that right? It was supposed to be a killer major competitive advantage kind of huge leading edge triumph. Somehow, I never heard a success story kind of post-mortem on that one. What happened?

  56. Another book for stupid people by Anonymous Coward · · Score: 0

    Heres another book to teach programmers how to write programs... because we programmers dont know how to program.

    I'd buy these XP books if they were cheaper than toilet paper, to wipe my ass, but they are too overpriced for me.

  57. Multitude of XP books - book refactoring by otisg · · Score: 1

    Damn, this guy Kent Beck surely (and Martin Fowler, and Jeffries, etc.) surely can write a ton of books on the same topic.
    It is all really the same philosophy - XP and refactoring and TDD (Test Driven Development), and so on. There is a lot of overlap there, and all is (obviously arguably) just good advice for approach to software development.

    How many times can they repeat the same thing?
    It is all just refactoring of the same material, same philosophies.
    What's the big deal?

    At over $30 USD per book, plus all the invitations to give speaches, presenations, and so on, it's quite obvious to me why they are doing it.
    Isn't that a bit lame, though, at least for them?
    Doesn't it get boring?

    --
    Simpy
  58. Re:Write code to determine if your code is flawed. by Woodrose · · Score: 1
    Test-first is not new, and yes it does work. We used it in the mid 70's for projects orgeom (orbital geometry) and cmdflgen (spacecraft command file generator) for the Pioneer 12/13 Venus orbiter and multiprobe, written in disciplined and highly modular Fortran IV under RSX-11M.

    Writing a little UI for each module was easy, as we only passed a few parameters back and forth. It added perhaps 20% to our coding time at most, and easily saved back 100% over previous attempts. Being NASA, we had very absolute deadlines and had to keep a tight rein on disk space, but we did it anyway.

    Also at Logisticon (now defunct) a little later, a bespoke supply chain app for JC Penny's with close to a million lines of Fortran.

    Same techniques, except we had code reviews instead of pair programming, still test-first though. Result was maybe a dozen bugs per major release. The stuff worked; good techniques overcame a horrible development platform (GA-440/Fortran 66/iftran) for happy customers. Pretty extreme.

    --

    Thou hast damnable iteration, and art indeed able to corrupt a saint - Henry IV, Act I scene II

  59. My question after trying XP by The+OPTiCIAN · · Score: 1

    How are you supposed to design a reliable schema if you don't do a complete design before you start?

    For a project I've recently been on, we did the whole half-assed XP thing: skipped on design but didn't really make up for it enough in other ways. It was a bit of a mess.

    Anyway, I spent heaps of time correcting for database changes that came up late in development, and that was a pain. Because a schema change in one place means code changes all over the place... you get the idea.

    So how do people usually get around that? Is there a good strategy to abstracting the database away like crazy that gets around the problem?

    --


    Believe with me, my saplings.
  60. Nice, but it doesn't work by Banner · · Score: 1

    All extreme programming does is hide your mistakes cause you write the code to pass the test case, but nothing else.

    I've been doing test and QA longer than any of you have been doing programming (or the guy who wrote the book) and before that I was programming and designing circuits.

    Reading the comments it's clear that most of you don't really know how to write code, you just hack on it till you think you have something that works and leave the problems to be patched by others after the release.

    Coding is easy, ANYBODY can do it. Designing and planning are hard. Not a single line of code should ever be written until the ENTIRE design has been laid out and planned. People who feel they have to code before the product has been defined and designed always code in hundreds of bugs and errors. Letting your coders do all your own testing of course never finds the mistakes either. After all, if you could see the mistake would you code it in the first place? Of course not.

    All these 'programming fads' are just that, fads. They won't deliver the goods. The way to do software projects was laid out over a decade ago, if companies would just FOLLOW THEM, we wouldn't see so much buggy crap turned out by companies.

    1. Re:Nice, but it doesn't work by chromatic · · Score: 1

      How can there be bugs in code that has never been written?

      How can you be sure that your design will never change?

      Where do you find customers that give you a complete specification before you start coding?

      How do you expect programmers to debug if they can never see the mistakes they make?

  61. TDD is valuable, more valuable as part of XP by ltkije · · Score: 1

    This thread is turning out better than some others about Extreme Programming, like here and here.

    I worked on a project that used XP for most of 2001. It was a liberating experience. We had two domain experts who also acted as XP coaches, which helped a lot. Our biggest problem was convincing some team members to suspend their disbelief long enough to give the XP practices a chance. At the end, we found we were about 50% more productive than similar, non-XP projects, despite spending a lot of time cutting excess code out of the project. About 20% of the source code was devoted to unit tests and mock objects to support the tests.

    When budget-cutting forced us to halt development abruptly, we had 12 known bugs. 11 of them were GUI problems, which we could not easily unit test. We had 70-80% unit test coverage, most of it written under the mantra "write the test, then the code." This turned out to be a key factor in our code quality.

    Having all those unit tests in an automated test framework gave us tremendous confidence to keep moving forward. This leads to the other key factor TDD provides a project: freedom from fear. Why worry about failing the regression tests at the next code freeze when you can run them every hour?

    Our XP project convinced me that one big reason for quality problems in C-language software is the lack of automated unit test tools. Sorry, that's just another good reason to move to OO, even for embedded systems.

    TDD is still valuable without the other XP practices. Short development iterations also deserve wider use outside XP.

    For all the naysayers... Look, nobody is saying you have to abandon experience, judgement or common sense to use XP. What you have to do is immerse yourself in the experience -- add the flow of programming the XP way to the other tools on your belt. XP is a little harder than riding a bicycle, definitely easier than Tuvan throatsinging, and as hard to describe on the printed page as both.

    That said, Kent Beck's testing book is pretty thin. It adds very little to what you'd get from reading Extreme Programming Explained plus the JUnit tutorial. To understand why people "get religion" about TDD, understand why people are religious about the most effective ways to get software development done. Two views that come to the same place from vastly different starting points are Alistair Cockburn's excellent book, Agile Software Development , and the "lean software development" material at Mary Poppendieck's website.

  62. XP is just another foolish process by Anonymous Coward · · Score: 0

    Even if an XP project succeeds, its not because it is valid process, but because so much money has been thrown at it that it cannot fail... much like the Amazon model.

    I have worked on an XP projects that worked well. Why did it work? because there were only 2 developers and both of us worked on our own stuff rather than Pair Programming. Basically, we did the XP because our boss wanted it (because its a buzz word he'd picked up), and we told him we are using it, did a few code reviews as we normally do, boss was happy, we were happy... if we were asked to pair program... no work would ever get done.

    I have also worked on XP projects that were plain stupid. Refactoring is not a good excuse for writing bad code. I have seen bloated, ugly code with lousy design at places of "ideal XP" and they wait for a factoring to get everything fixed, but by then it has become so ugly and bad, that nothing got changed. Lot of bad developers hide behind this XP ideas, and lousy code had been written. Somehow the XP philosopy seems to attract the bad developers, because it allows them to speak of the "good" way to write software instead of writing good sotware.

  63. I think you're on to something... by SuperKendall · · Score: 1

    I find most stable, well written code I encounter is usually pretty modular and thus, able to be tested easily.

    I have some misgivings about XP, having had a very, very bad experience with it in the past. But I do think there is something there... however, perhaps a lot of what makes XP work is that simply by writing tests first, they cannot help but write implementations that lend themselves to testing as you have noted! The resulting code is thus more modular and less prone to error.

    I still think that XP presents a lot of overhead that might not be nessicary given the right people - like instead of having a thousand unit tests that you have to maintain with the code (one of the nightmares encountered), you have well-written modular code with just a few tests.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
  64. "don't worry about prettiness" by Anonymous Coward · · Score: 0

    for me prettiness is only thing interesting on proggraming, i will change job if somebody insist on not worrying about it

    what is reason, you do programming?

  65. flaws in tests not a problem by Bazzargh · · Score: 1

    This argument (that tests may be flawed, and so don't help) isn't as much of a problem as you think.

    Suppose 10% of the code you write contains errors (at random), and you write tests covering 50% of the code. Then you find 90% of the errors in 50% of the code (assuming your error rate in test code is the same as the error rate in 'real' code). Your error rate for the overall program should now be around 5.5%.

    In other words, it doesnt matter if your tests can also be flawed, you'll still improve your code by doing testing. On the other hand, planning will make absolutely /zero/ difference to your error rate (compared to any other method that appears to implement a specification). In order to remove bugs, you have to do /some/ testing, so I have to assume you're advocating test-last.

    It then boils down to whether test-driven or test-last is the most economic policy, and how much testing to do.

    Anyway - since this economic argument (not flawed tests) is the crux of the matter, you should take a read of Beck's thinking on the issue, in May 1999 issue of C++ Report, particularly the last paragraph.

    Cheers,
    Baz

  66. The wheel was used to build the Pyramids by Anonymous Coward · · Score: 0

    Four chords were strapped around a block such that, viewed from the axis of rotation, one would see a cylinder with an inscribed square. Cool trick that.

  67. Diets by John+Bayko · · Score: 1
    There is no magic formula for producing quality software in a reasonable amount of time yet, but XP is another step in the right direction.
    Programming methodologies are like diets. The fundamentals are always the same - eat better, exercize more. Diet/fitness plans are just methodologies for keeping track of that, and making sure you get around to doing what you know you should anyway - using food points, tracking calories burned, whatever. All have trade-offs and different emphasis, and some are more suitable for some people than others. Of course, if you have enough self-discipline and aren't distracted by other things in your life, you don't need a diet plan, you can simply keep yourself healthy on your own.

    Programming methodologies are the same thing. I haven't seen anything in XP that I haven't seen elsewhere, using different words (for example, Steve McConnel's excellent Code Complete). Again, all methodologies have trade-offs and different emphasis, and some are more suitable for some projects than others, and again if your developers have enough self discipline they know how to do a project properly and don't need a set of rules to follow.