Kaag

Wish I'd taken more photos really..

 

Nice place really, had an apple pancake for lunch at a restaurant built over the edge of the lake.

T -1

I'm off on holiday tomorrow, currently dossing around in lovely Gloucetsershire

Its alright here, if a little quiet. I'm flying out from Bristol airport tomorrow afternoon, heading there in the morning so I can take my time getting through customs (I can see a laptop + camera + lenses + 2 phones being a problem in this day and age).

 

iPhone Jailbreak!

I jailbroke my iPhone last night, using the new PwnageTool, must say, not really much point anymore apart from the activation (now works with my t-mobile contract). Having not had *any* experience with the 1.1.4 software, I can't comment too much, but it is being really slow loading up my iPod playlist (and it's only half of movies). What does really impress me though from a new user point of view is the quality of the video playback. I watched Alfred Hitchcocks North By Northwest on the train journey back here, it was quite a nice experience, and the battery lasted well (took a fair few hours of Super Monkey Ball that evening to drain it down).

 

Anyway, I will be posting more pictures as and when I take them throughout the next week and a half.

Real Simple Test Driven Development in Visual Studio

 

Step 1

Decide the feature you need to implement. In this case I have decided that my DefaultNewsProvider class needs a method for returning a single news item when passed its Id.

 

Step 2

Open your test file that is responsible for testing the DefaultNewsProvider class (in this case it is in my Keima.Website.Data.Test/NewsProviderTests).


Step 3

Write the test with the expected result. I know that in my database their exists a news item with an Id of "tag:keima.co.uk,2008-06-26:Composer 2.0 Launch", therefore I construct a a test that calls the new GetNewsItem method with the Id, then compares the result to check we have been given the correct item back.

 

Step 4

We have hit a problem, this method does not actually exist despite having the test for it. So, bring up the code helper and generate the method stub.

Step 5

Test the code. Go on. Watch it fail.

 

Step 6

Make it pass. In this case its easy, a sort of 'fill in the blanks'. So back to DefaultNewsProvider it is and the implementation is finished off.

 

Step 7

Re-run the test, watch it pass. All is well, the code has been added, a test has been created, and if in the future the method breaks due to other code changes you will know immediatly.

 

List of reasons why test driven development can help you:

 

+ Allows your code to be maintainable, shows the exact point of failure of a program, none of this nasty debugger related stack tracing and breakpointing anymore
+ Forces you to focus upon the expected usage of a function, not the specifics of its implementation. Once you get in to the TDD mindset this allows you to be more concerned with the abstract ideas of how the project should be designed and structured with maintainability in mind as opposed to language specific implementation details (e.g. "I need a function that returns a file handle given a file name or null on an invalid file" rather than "What calls need to be made inside C# to open a file?"
+ At any one time, your code WORKS. Ensuring that code is correctly covered by tests allows you to guarantee that at any one time your project can be built and shipped to a customer. 
Your tests are more accurate (bold assumption I know, but here me out). Designing the code by considering how it will be used, and ensuring that tests are constructed at the beginning is much more preferable to designing tests once a project is finished, where code may be missed, meanings of code blocks forgotten about or motivation does not allow for proper testing.

 

A few other notes
+ Name your tests properly. GetNewsItemReturnsCorrectItem is much more imormative than GetNewsItem, especially in large applications where there can be tens of thousands of tests, it just makes finding the cause easier.
+ You _will_ be writting more code.
+ For each function, class and library you have have a matching Test function, class and library.
+ Try and have three tests for each function, a test that returns the correct result (like show above), a test which tries to break it (an invalid id) and a test which is just plain wrong (passing null in for example).

 

As ever address any personal experiences, observations, suggestions or death threats through the comments.

Your Top 10 Albums

So what are your top 10 albums? I mean, the ones you listen to the most, or maybe the ones you don't listen to that often, but when you do, you think "damn, I really fucking love this album".

 

These are mine, in no real order

 

All That Remains - The Fall of Ideals

Brutal from the first track (This Calling), filled with lashings of double bass and sweeping guitar solos. It certainly doesn't go downhill from there, with their other (arguably) two famous songs Six (of Guitar Hero 2 fame) and tremolo picking antics of The Air That I Breathe.

 

36 Crazyfists - A Snow Capped Romance

One of the first metal albums I ever bought, the four-piece metalcore band from Alaska left a marked impression on my musical taste. Opening with At The End of August, pushing on to the forceful riffs of Bloodwork and gently taking it downhill from there, Brock Lindows' vocals are unique, and certainly make this some of the best metal around.

 

 

Flyleaf (self titled)

Flyleaf are this new brand of hard-rock. Not metal, but fortunately not this indie crap, not soft. Just right. And besides, have you seen how cute the singer isI'm So Sick and Cassie are possibly my two favorite songs from the album, but only just, its got that kind of consistency that by the time the album is over you wonder if it wasn't all just one big, well written song. And if you look (listen) real carefully, Flyleaf can be soon at the start of Die Hard 4.0.

 

 

Ill Niño - Enigma

If you don't know Ill Niño, something is wrong with you. A dreadlocked mess of Spanish-guitar work and heavy, heavy metal, they are entirely unique, original, and their music is so good I didn't know which of their albums to choose. So I chose the latest. Opening with The Alibi of Tyrants, it mixes heavy riffs of Finger Painting (with the enemy) with the classical guitar interludes of Me Gusta La Soledad, its easily on a par for quality and originality that the rest of their material is on.

 

 

The Legion of Doom - Incorporated

Modern-day saints really, they took unbearable emo music and made it listenable by mixing it with rap and dirty electro beats. Mixes of From Autum to Ashes vs Dead Poetic and Dashboard Confessional vs Sage Francis make this ABSOLUTELY unmissable. If you don't listen to it at least once you're missing out more than you could ever know.

 

 

Killswitch Engage - The End of Heartache

Holy crap what. When Darkness Falls. Rose of Sharyn. Beathe Life. The End of Heartache. Its like a kick in the face from an angry horse. A fucking angry horse. 

 

Placebo - Meds

In a vain attempt to make it seem like I don't just listen to men with drop tuned guitars jumping around stage, screaming and thrashing the living daylights out of a bass drum, heres some Placebo. Possibly, the ultimate in stoned late night listening, this well-crafted album has some of my all time favorite songs on it, such as Post Blue and Follow the Cops Back Home. Undeniably good.

 

Trivium - Ascendancy

Get. The. Fuck. In. The. Pit. Epic, epic riffs, such as Pull Harder On The Strings Of Your Martyr, A Gunshot To The Head Of Trepidation, and Like Light To The Flies show up most other bands. Its a shame their latest album sounds like a Metallica knock-off, because Metallica really suck.

 

Queenadreena - Drink Me

'Alternative Rock' is how the album is billed, but I'd prefer the title 'just plain fucked up'. Songs such as Pretty Like Drugs and For I Am The Way, make this similar to the Placebo album here listed, easy, relaxing (for me anyway) music.

 

Bring Me The Horizon - Count Your Blessings

Taking their name from the closing line from the original Pirates of the Caribbean, these York based lads are not to be messed with. Fast paced riffage of (I Used To Make Out With) Medusa and the obscenely titled Tell Slater Not To Wash His Dick made it an absolute certain for my top 10 list.

 

So there we have it. My 10 favorite albums. Whats yours? Hit me up with a trackback.