debuggable

 
Contact Us
 

Agility? Divide and Conquer? What?

Posted on 17/8/06 by Felix Geisendörfer

Ok, right now I'm deep inside the process of exploring some of the agile coding technics out there (including test driven development). But what I slowly come to realize, is that I'm still trying to pinpoint the concept of agility itself.

One thing I've learned so far: It's most likely not testing, not automatisation, not source control, not wiki's, not any of the stuff I've just finished about reading in "Practices of an Agile Developer". Don't get me wrong, I enjoyed reading this book a lot, I think the tips in it are awesome and I'll try to make use of them where I see need. But one thing that I think should be more emphasized is the non-technical aspect of agility.

Let me try to show what I mean by talking about living in a house (or appartment):

You just finished your dinner and you want to get right back to that interesting book/movie/... you were involved with before starting to eat. You take your plate and put it into the sink (the place were you put the plates from last night, and the night before). On your way back to the living room you notice the dirty carpet in the hallway and you hear yourself saying: "uhm, guess I should clean that up - one of these days". Back in the living room you see a pile of magazines, empty cups and old (are they?) phone call notes on the table -> "Hm, guess I should clean those up was well, ...". But back to your interesting book/movie/... you wanted to enjoy! ... - All the sudden it's 1:30am. You've got distracted by some other things (this new cool tv show, a friend calling on the phone, ..., etc.) and you decide it's time to go to bed. The next morning you wake up, the sink is still full of unwashed dishes, the carpet is dirty and the living room is a mess, but do you feel like cleaning them up, now, at 8 am in morning? You probably don't. This will most likely go on for a couple more days (weeks?) until you decide to do one big clean up session that you try to push off as long as possible. After you are done with it, you will feel a lot better for next 1-2 days, until everyday live slowley starts to turn your place into a mess again.

Alright, if this story does not sound a bit familiar to you, consider yourself lucky and go back into your IDE, this post is not for you. But if you are like me, who always talks about his desk that he wants to clean up the next couple days, that class that needs documentation and those other things that never seem to really get done - welcome in the club.

When you think about it, you'll probably agree that you could have a clean house (and not a messy one for 90% of) all the time if you would constantly wash the dishes, clean the rooms, and take out the trash. But realistically, you are not always going to do it. You don't always feel like commenting all your code, refactoring crapy interfaces and answer the emails in your filled up inbox.

So what to do? To be quite honest, I don't claim to have the ultimate answer to this one. But how about this:

"Divide and Conquer" -- (most likely) Julius Caesar

It's one of my favourite quotes of all times because it can essentially be applied to *any* kind of problem. The bigger and more complicated an issue is, the more likely it's made up of smaller chunks you could attack one at a time. The house is dirty? Next time you see those dishes - do them. Next time you see the carpet - clean it. Oh and before you watch this movie tonight, clean up the table in the living room. Don't try to do it all at ones, it's not agile. Sure, getting a big issue solved all at ones is a very satisfying feeling, but unfortunatly it's not big enough to motivate you earlie enough the next time it comes up. The same goes for code, projects, etc. You are behind the deadline of a project, but instead of sending out the email to the client, you try to finish at least this one promised feature to show him as an excuse before getting the email out? Don't. Send the email, let the client know what's going on. And if you still manage it to complete one or more of the features he'll be just as happy to hear it. Got this huge undocumented piece of code? Go in and comment 3-4 functions right now, and do it again over the next couple of days, try to find a rythm in it.

Ok, enough hypocritical ranting - back to reality. The question is still, how do you motivate yourself to be more of a google octopus instead of a microsoft wale? What technics work, which ones don't?

I'm trying my luck with progressive tasks lisks that have little progress bars you can fill up as a tasks come closer to completion. I set my watch to alarm me when I'm overtime on a certain thing I was working on. I write posts on my blog about agility ; ). And it does seem to have some kind of positive impact I think. But I'm more then interested to hear about your ideas / oppinions / experiences in this area. So in case you are one of those people I told to stop reading after the house story, what's your secret?

Oh and before I forget, a very nice article in this category that I read about on A List Apart a while ago: The Four-Day Week Challenge

--Felix Geisendörfer aka the_undefined

 

You can skip to the end and add a comment.

Daniel Hofstetter said on Aug 17, 2006:

Great article. In my opinion "agility" is more about values than some specific techniques, see also the Manifesto for Agile Software Development (http://agilemanifesto.org/).

I am in a similar situation as you, I don't have found the ultimate solution to getting things done yet. I tried the "Getting things done" approach, and worked with todo lists, but I am only partially happy with them. The "problem" is that I am just too lazy to keep such lists up-to-date ;-)

But at least in programming I found a way that works for me to get things done: test-driven development (TDD). A nice side effect is that I usually no longer have to document my code (unless it is framework code).

Felix Geisendörfer said on Aug 17, 2006:

Hey Daniel, thanks for your comment. Yeah I feel the same way about to-do lists ... there got to be something better then that ; ). Another strategy I've been using is to take a Calendar program and explicitly plan what you want to do in the next 2-6 hours ahead of time. While this is a good motivational factor (a little time pressure ^^), I found that I could almost never make realistic estimates on how long certain tasks would take me and so I had to update the calendar quite often, which was somewhat defeating it's purpose. Still, I felt like it actually helped a bit.

As far as TDD goes, I'm still trying to get the controller testing to work out for me. I got to the point where I can work with it, but I think I'll need to build a DataGeneratorHelper that I can use to create random Model data for my Mocks in the Controller.

I put the latest code I use on here: http://cakephp.org/pastes/show/8803bd09150cb65cc7da63f92cdbc828 in case anybody cares.

Anyway, I just saw your post about your tasks for the test suite, but unfortunatly comments are disabled. What's up with that? ; ).

teemow said on Aug 17, 2006:

on reboot8 i saw marc hursts lecture about inbox management and todo lists:
http://reboot.dk/wiki/Bit_Literacy:_A_New_Strategy_for_Productivity_in_Your_Bit-drenched_Life

his demo of gootodo.com was nice, but i haven't used it. at least my inbox is very clean since then:
http://www.goodexperience.com/blog/archives/000344.php

tdd is what should keep your motivation high. be creative in writing tests breaking your code. make short iterations.

where do you put your testhelper, felix? it looks cool.

Vladislav said on Aug 17, 2006:

Can I recomend for your attention very nice "self improvment and also" blog Stive Pavlina?

http://www.stevepavlina.com/blog

Read old post about dreaming, TV watch etc. Very useful!

Thank's for your great site, and sorry for bad english ;-)

Felix Geisendörfer said on Aug 17, 2006:

Hi Vladislav,

uhm that "Steve Pavlina"-weblog really has some great articles in it. I think I'm still quite a bit away from turning myself into a meditating, spiritual vegan but who knows. One of the things I'll try out is becoming an earlier riser at 5am. Right now I work all night and sleep from 6am to 12am-1pm which is kind of nice since nobody distracts you late at night, but missing the time from 6 to 12 kind of sucks, and I also feel like I have ~2 hours every night were I feel very sleepy and am not productive at all. Let's see how it goes. I'll definetly do some more reading on this blog (and other sources) and see if it can be translated into the workflow of a (freelancing) web developer.

Thanks for your comment, I'm glad you like my blog ; ).

teemow: Thanks for your links, but I don't have a credit card to try out gootodo.com. Oh well I guess it's not really about the todo-lists anyway, even so I think theirs looks nice. Right now I use Mozilla Sunbird for it (it got a lot better recently).

About that TestsHelper: You can put it anywhere and require/include it on top of your testsfile I think. (You'll also have to include the required simple test files for mocking). Currently I work with my own testrunner since the CakePHP test suite isn't flexible enough for my needs and I don't feel like hacking it. But the code I use is "tracer code" which isn't ready for prime time yet. Currently I'm sharing ideas with Daniel Hofstetter about how to improve the test suite. Hopefuly we'll have a new one soon ; ).

Christian Tietze said on Aug 18, 2006:

Well, you just said what drives me crazy for a few weeks now.

I'm having this great ideas and stuff (well, and a very COUGH "cleanable" COUGH room) but I don't really get them in some order, hence developments isn't fun at times. I debug stuff with the common trial & error priciple; I insert something, run/test it in the application, encounter errors and try to fix them. Then I do the testing again, wheras testing means calling the website in Firefox.
I read a lot about TDD and Extreme Programming, but unfortunately all these articles miss something that seems essential for me to really understand the principle. I just can't adopt the abstract principles people write about when thinking about coding PHP or C# or whatever. In my opinion, there's a connection missing between these articles and my personal real world. If you've got something very comprehensive, well, why don't you actually link to them :) Probably it'll help people like me who subsribe to your RSS feed. Oh, and don't hesitate to give German links away as well since I'm totally capable of understanding it. And maybe some others as well, yeah (I don't want to be tooo self-centered :)).

I'm looking forward to reading of your newest ideas on agile development!

Felix Geisendörfer said on Aug 18, 2006:

Hi Christian,

regarding good examples for tdd with php: They are rare, that's for sure. One that really seems to pinpoint the approach is this one:

http://www.phpbuilder.com/columns/baker20040202.php3

The Agile Development book I mentioned in my article has some good stuff on it as well. Regarding good Documention for TDD with CakePHP: It does not exist. I don't know anybody who really uses tdd with cakephp right now, maybe some unit testing, but not pure xp-tdd ; ). One of the reasons is, that controllers turn out to be a bi*** to test. If you've looked at the code I put in cakebin (see comments) above you'll know why. It's just that controllers are highly coupled objects and you have to essentially mock one or more models / components for each one in order to do TDD on them. I looked at tdd in railsland and they have a *really* nice testing suite, which can be used for tdd, but does not too well on unit testing controllers. I think I'll write another article about testing soon explaining the problems with tdd in cakephp and maybe possible solutions. I'm highly motivated to get the community into it as I think it'll lead to better interfaces, higher quality code and happier developers. The stuff I've done on it so far has been great fun and was kind of mind expanding in regards to the way I used to code, if you forget about the annoyances I experienced that is ; ).

Ok I hope this article helps you. Regarding general productivity: I think this problem cannot be fixed in software, ie. on my computer, but rather in hardware - myself. Reading this weblog of Steve Pavlina has been great fun so far and even so I'm not totally buying into all of it quite yet I'll try out some of this advices since I think it can't really hurt, can it ; )? Today I started by getting up at 5 am, and after that horrible first 20-30 minutes I felt just great and was very productive. My e-mail inbox is empty, I did a long phone call with my business partner, I finished some SEO reports, done some work on a couple of projects and am in the process of setting up a custimized dokuwiki right now. For more info's what this is all about see:

http://www.stevepavlina.com/blog/2005/05/how-to-become-an-early-riser/

Btw. this guy says he actually did polyphasic sleep for 5 1/2 month, if that's the case I have some very high respect for that man ; ).

Bye, Felix

PS: Uhm, gotta do something about this urge to write page long comments ... ; )

teemow said on Aug 21, 2006:

what's about caffeine naps ;)
http://goalsuccess.typepad.com/goaltips/2006/02/how_to_take_a_c.html

This post is too old. We do not allow comments here anymore in order to fight spam. If you have real feedback or questions for the post, please contact us.