Archive for category Uncategorized
The Emergency Appeal They Don’t Want You To See
Posted by admin in Uncategorized on January 27th, 2009
TDD Example Part 2 – Test Driving a View
Posted by admin in Uncategorized on January 27th, 2009
In Part1 we implemented a LoginController using Test Driven Development.
This tested that we correctly return a ModelAndView(“wrongpassword”) when our user credentials do not satisfy the IAuthenticationService, and ModelAndView(“frontPage”) when they do.
A ModelAndView is a Spring concept. It’s purpose is to seperate how we generate the information for a page, from what should be finally displayed on the page. Spring has created this data object so that it can be as flexible as possible about which parts of a system or technology should generate information, and which should display information.
One of the downsides of a generic framework is that it leaves a lot of abstract potential to tie down to what you actually want to happen (the reason some frameworks now tend towards sensible default conventions). As Cohen once said (to paraphrase from memory) “A theory of everything is like a giant black binbag around the universe. You know just as little afterwards as before”. That’s what it’s like with abstraction.
To understand what benefits TDD is going to bring us in View testing we should therefore first understand how the View fits into Spring.

Slaughter in the Gaza Ghetto
Posted by admin in Politics, Uncategorized on January 25th, 2009
Extracts from the speech by H.E. Dr. Srgjan Kerim, President of the 62nd session of the United Nations General Assembly.
http://un.org/ga/president/63/statements/onpalestine150109.shtml
- During this assault, more than 1,000 Palestinians have been killed, one-third of them children.
- If this onslaught in Gaza is indeed a war, it is a war against a helpless, defenseless, imprisoned population.
- Gaza’s population is imprisoned – they cannot leave, they cannot run, they have nowhere to hide.
- Israel remains the occupying power in the Occupied Palestinian Territory … and it has specific obligations under the Geneva Conventions to protect the occupied population.
WordPress – how to only show the article excerpt you want
Posted by admin in Uncategorized on January 23rd, 2009
Just getting used to this WordPress system myself. It turns out that control over whether an *excerpt* of an article is shown , or the *entire* article, is displayed in the article list is for the template designer to choose.
In the template they can either put a php call to “the_content” or “the_excerpt”. Unfortunately “the_excerpt” doesn’t display images and embedded content… so what to do?
Simply add <!--more--> into your blog articles (in HTML mode) where you want their exerpt to finish being displayed, even when using the_content in the theme.
Test Driven Development
Posted by admin in Software, Uncategorized on January 22nd, 2009
This is one of the best books I’ve read on Test Driven Development.
It is a historically radical technique for changing the way that software systems are programmed which is now entering the mainstream.
The core idea is to squeeze out a software system in response to tests that developers write – To “drive” development using tests. It is an *additive* process, using isolated tests that describe our system, like a scaffolding, until by satisfying those tests we have built *just enough* system. Should an alteration to the system cause a regression, we can also very quickly pinpoint the where and why.
At first doing Test -> Code -> Design rather than the traditional Design -> Code -> Test seems utterly ridiculous and counter intutitive, but I increasingly feel that it is very close to how natural systems behave. It is very close to how reality functions, and successful systems are, and have always, been created.
On one hand, it is something of a recipe for being organised. The TDD mantra of “small steps with rapid cycles”, and it’s focus on a re-evaluation of system design after each short cycle (refactoring) is something that I recognise in those well organised people I know, and in the science I have practiced.
It is also interesting in juxtaposition to the scientific method. TDD is constantly asking (and documenting) questions of our system, and using the satisfaction of those questions to squeeze out a new system, solution, or understanding. The scientific method also relies on these cycles of constructing a hypothesis (i.e. the system will do x/y/z), interfering with the system under examination, then reconsidering what the system under examination really is before entering into the next cycle of testing.
In evolution, “tests” are individuals of a species. The instances of a species implicitly test if the characteristics they are propagating are suitable for survival in a given environment. The rapid cycling is birth and death. The refactoring is mutation and selection.
Definately as good a read as good a read as a Software Development book gets.