Posts
Unit testing tricks: Using unit tests to validate static code
In my current project, we use Flex as the user interface framework of choice. Flex has some nice features, but it takes a long time to build changes and start up, so it takes a while to validate our changes. Yesterday, we found a problem with one our UI components, and used JUnit to hunt down the same problem all over our code.
The problem was with tables. We had a table where we had set the percentage width of each column, but the total did not add up to 100%.
read morePosts
Book review: Breaking the Spell
Why do all societies we know of practice some form of religion? Either religion must be “true”, or there must be some sort of natural explanation for this universal phenomenon.
[caption id=“attachment_403” align=“alignright” width=“161” caption=“Breaking the Spell”][/caption]
“Breaking the Spell” by Daniel Dennett presents avenues of research into these explanation. He does not profess to have the answers to this question, or even the right question. He merely sets out to prove that the questions are important ones and ones that we can hope to gain insight into.
read morePosts
Book review: Predictably Irrational
[caption id=“attachment_394” align=“alignright” width=“300” caption=“Summer is starting”]![Summer is starting](/wp-content/uploads/2009/07/01072009084-300x225.jpg ““Predictably Irrational”, a beer and the view from the top of Oslo”)[/caption]
“Predictably Irrational” is a perfect book for lazy summer days on the beach or, in this case, while enjoying a beer from top of Oslo’s tallest office building.
Dan Ariely is on a bit of a crusade against traditional economics, with it’s idea of rational behavior from everyone in the marketplace.
read morePosts
Book review: A question of torture
After receiving request to revive my book reviews, I’ve decided to blog about books I read again.
If a known terrorist in police custody knew the whereabouts of a ticking bomb about to explode in a large city, would the use of torture be acceptable? Would it be helpful? I stumbled across Alfred McCoy through fora.tv. The program impressed me so much that I decided to pick up his book A Question of Torture.
read morePosts
From computer determinism to real world indeterminism
I thought it was about time I wrote about topics where I’m an amateur. This time: Experimental philosophy.
As a computer programmer, I often entertain myself with writing computer programs. Last Easter I stayed up a few nights playing with an insignificant, but entertaining program. During a discussion with my philosopher uncle, I discovered that this program might provide some insight as to why determinism is, if not dead, then at least lame.
read morePosts
Unit testing tricks: Look ma, no setters!
Here’s a neat trick if you want set an object in a specific state in a unit test, but you don’t want to violate encapsulation:
@Test public void withdrawShouldReduceBalance() { Account account = new Account() {{ super.balance = 100; }}; account.withdraw(10); assertEquals(90, account.getBalance()); } @Test(expected=IllegalStateException.class) public void overdraftShouldThrow() { Account account = new Account() {{ super.balance = 5; }}; account.withdraw(10); } This seemingly magic code lets me have a protected (but sadly not private) field Account#balance.
read morePosts
Guidelines for eGovernment Projects
The Agency for Public Management and eGovernment in Norway is currently developing guidelines for IT-projects within the Norwegian governmental sector. The Norwegian Computing Association hosted a presentation and discussion about this work yesterday. I was privileged enough to summarize the comments from one of the three discussion groups at the meeting. For the enjoyment of the internet, I hereby provide a few ideas on eGovernment projects.
Value first The speaker from The Norwegian Government Agency for Financial Management (SSØ) pointed out that many projects are not sufficiently concerned with satisfying real objectives.
read morePosts
PodCast: Linda Rising
In this third podcast in the Oslo Developer Conversation series, I talk with Linda Rising about fearless change. We discuss the how to inspire an organization to change and touch on how developers are, at the end of the day, just another mammal.
See the (English language) podcast at ProgramUtvikling’s site.
read morePosts
Den Smidige myte?
This is a Norwegian language copy of an article I published with Niklas Bjørnerstedt in the Norwegian computing magazine ComputerWorld
Studier som utgir seg for å være vitenskapelig utført viser seg stadig å ikke tåle nærmere granskning. Kommersielle tenkesmier tar mange snarveier i kampen om å få frem oppsiktsvekkende resultater. Forskeren Magne Jørgensen har gjennom årene bidratt til å “avsløre†flere tvilsomme studier og dermed bidratt til å heve den vitenskapelige standarden innenfor systemutvikling.
read morePosts
Alt kan refaktoreres
This blogpost is a Norwegian language tribute to one of my home city’s great poets
Med takk til Joachim Nielsen
Ta en titt inn på skjermen din æ’kke testen grønn Det var mye værre her om da’n da var alle tester røde Skulle vært her i forrige uke, da hadde byggserver’n stopp Alt jeg tenker på er test og kode og bygg og mat hver bidige dag
Alt kan refaktoreres, alt kan leveres Alt kan refaktoreres, og ingen ting blir bedre
read more