Sep 3rd, 2009
by dagfinn.
Image by niallkennedy via Flickr
Brandon Savage is writing a series on code improvement using a code example (starting with Peer Review: Taking Code And Making It Better). In other words, it’s about refactoring, which is practically my favorite subject. Although I don’t agree with all of it, it’s mostly good advice. I recommend it.
That said, [...]
Feb 21st, 2009
by dagfinn.
Image by libbyrosof via Flickr
The debate on the “one assertion” principle continues. Pádraic Brady and I agree on the general principle, but since he is so categorical in his second article, I needed to inspect his reasoning more closely. It’s clear that our disagreement is more than superficial. The more I think about it, the [...]
Feb 15th, 2009
by dagfinn.
Image via Wikipedia
Pádraic Brady pleads for the principle that a unit test method should have only one assertion. His point is perfectly valid; there are several good reasons why one assertion per method is a smart guideline when writing unit tests. But since he drags up the term “lazy”, I feel the need for soul-searching [...]
Nov 27th, 2008
by dagfinn.
They say there’s no free lunch, but at least there’s free breakfast. Last week I attended a “breakfast seminar” with Robert C. Martin (Uncle Bob). There really was free food.
Anyway, Uncle Bob held an extremely entertaining and useful introduction to the FitNesse testing tool. He got me hooked on it, but I’m even more fascinated [...]
Nov 18th, 2008
by dagfinn.
I admit I don’t follow Zend Framework very closely, since I haven’t been using it for any serious work. But I did write a piece about testing a Zend Framework action controller with View Helpers.
This might need updating, since the testing capabilities of the Zend Framework have grown substantially since then. In [...]
Nov 8th, 2008
by dagfinn.
I got some interesting comments to my previous post on “beautiful code”. Some were pretty strong disagreements.
So am I wrong? Did I get carried away? Did my critical faculty go on vacation somewhere nice and sunny? I admit that sometimes I deliberately look at the positive and ignore the negative. (And sometimes [...]
Nov 3rd, 2008
by dagfinn.
Max Horwath has published his slides on Making Selenium Test Writing easier using a DSL onlinefrom IPC 2008. Let me quote the whole short description:
Implementing automated tests by using Seleniums API methods has several [...]
Sep 16th, 2008
by dagfinn.
This is something I posted to the Sitepoint PHP Application Design Forum with a little bit of added background.
The background is the idea that unit test methods, for the sake of readability, should test only one single behavior. This may mean several tests for one method under test, since one method may [...]
Jun 10th, 2008
by dagfinn.
I came across a Zend Framework (ZF) example I wanted to refactor. You really have to have unit test coverage to refactor effectively, and since there were no tests, I started trying to find out how to test it. There didn’t seem to be a wealth of information available on the web, so I’ve [...]
Jun 2nd, 2008
by dagfinn.
Silvan Mühlemann has written an excellent piece titled Unit testing makes coding more fun.
I keep saying that sort of thing, too. I also say it raises your IQ. But when I attended a presentation by Uncle Bob (Robert C. Martin) last summer, I was mildly shocked to see that he described TDD as tedious [...]