My comment about me not trusting CakePHP caused quite some discussions. Some interpreted it in the way that I think CakePHP is crap (well, if that would be the case I wouldn’t use it *g*). Others criticized me for publicly mentioning that some tests fail in the development branch… Anyway, what I missed was a discussion about the implications of my statement. So I will catch up on that with this article.
One point I mentioned in the aforementioned comment are the missing tests. Not every class is tested. That’s because CakePHP was not developed with testing in mind originally. The first tests were added at the beginning of this year I think. And since then more and more tests have been written. But still, it will take quite a while to get a high test coverage. So the consequence of this is that when a developer makes changes in an untested class it is possible he will break something by accident that worked before, and he won’t notice it (you can find many such examples on trac). That means a working feature in version x may no longer work in version x+y.
The other point are the failing core tests in the development branch. They signal: “Hey, something doesn’t work”. Maybe it is “only” a broken test, maybe it is a broken feature, whatever. It doesn’t matter, the message is the same: something is broken. Sure, it can always happen that you commit something that breaks the tests, nobody is perfect. But if the tests fail over a longer time period, well, then the impression I get is that the developers don’t care about the tests.
Ok, I am now aware of those “trust problems”. But what can I do? It is no fun to write tests for existing, untested stuff, so writing core tests is not an option. And I cannot change the attitude of other developers towards tests from one day to the other. But I can write tests for my own application, and so test the underlying framework indirectly. If I update the framework, and my tests fail afterwards, then it is very probable they failed due to a newly introduced bug in the framework, and I can report it.
Of course, the aforementioned points are not the only motivation for me to write tests, the article “Top 12 Reasons to Write Unit Tests” lists other points that are important to me.
So my recommendation to everyone using CakePHP (or writing software in general): write tests, tests, tests!