Well I reckon I’m well on the way to being a better test driven developer .. perhaps making a clean start and moving away from old habits when you move to a new project is the best way to change your coding habits.
So now when ever I have a bug to fix or new functionality to write then the order I attempt it is second nature:
1. Fire up NUnit to run all of the existing tests .. if green continue, otherwise figure out what’s broken.
2. Write a test for the functionality I want,
3. Run the test and watch it fail.
4. Write/change the code and re-run the test.
5. If it’s green then great otherwise fix or breakdown to smaller tests till the tests pass.
6. If finished then stop. If not then add more tests, get them to work and refactor if necessary.
Now if I ever have to write code without first writing a test it feels like I’m coding without a saftey net .. I can do it but I feel nervous and not happy.
Simplify Caching using the Policy Injection Application Block: Aspect-Oriented Programming Opportunities - I’ve always been keen on the idea of doing the right thing in the right place in your code. Whether it be via Design Patterns or a framework/architecture to solve a particular software problem. That’s why I’m interested in Aspect Orientated Development and here’s a good demonstration of the technique.
Well .. not quite.
Out running last month I discovered some dirt jumps near Newbury. Went back there last week on my rock hopper MTB to see what’s what. Unfortunately a bunch of kids were there .. managed to humilate myself attempting one of the easier jumps (my excuse was that I couldn’t lower my seat becuase of my mud catcher). Oh well back to the drawing board .. and wait until the school holidays are over so I can practise a bit rather than having an audience.
P.s. it’s a lot more difficult and scarier than it looks. So researching technique .. it also looks like getting some front suspension might be a good idea (but can’t afford ‘em at the mo).
Apart from last week I’m managing to run most week days during my lunch break.
Doing large (ish) loops around the south west of Newbury, along the canal and there’s even a hill up the side of the A34 I do hill training (weirdly enough).
NB: My personal best for the hill climbs is 5 in one session .. managed it today .. also managed to run hard on the mile or so back (running quickly rather than just jogging along).
.. hmmm, I can’t decide what the hell is going on with my shoulder. For the last couple of weeks it’s varied from not too bad (no pain while just sitting around, only pain when moving over head) to annoying (aching most of the day, waking during sleep with sore shoulder, quite painfull overhead .. painfull just changing gear driving the car or coming back from a run). There just doesn’t seem to be any rhyme or reason to it though.
Today, however, I think I’ve felt just about zero pain .. even overhead movements are OK
I think I’ll rest for another week and then really slowely start some exercises.
God only knows when I’ll get back to climbing though.
.. by David Bowie
Really listened to the lyrics for the first time today .. and you can see why the BBC Series was given the same name
“..It’s the freakiest show
Take a look at the Lawman
Beating up the wrong guy
Oh man! Wonder if he’ll ever know
He’s in the best selling show
Is there life on Mars? ..”
.. David Bowie’s Scary Monsters (and Super Creeps)