I have long been a fan of Test Driven Development (TDD). I have used all kinds of frameworks for doing my tests and for all of them have adopted the Act, Arrange, Assert pattern. I have looked into doing Behaviour-Driven Development and like the idea, just never found a framework that I was comfortable with and could use back and forth with unit testing.
I have been using OCUnit that ships with Xcode to do my testing. I decided that I wanted to branch out. I had heard good things about Kiwi for doing BDD with iOS. I decided that I should try it out. I normally I stick to the web and spelunking, yet this time I decided to buy a book on the subject: Test Driving iOS Development with Kiwi. This book is only available from the iBooks store.
I have to say the book was worth every penny. I really thought it was a simple and easy introduction. It doesn't try and cover every nook of the framework, but it gives you enough information to get you started and how you can easily use it. It also takes advantage of the fact it works on the iPad: you get media built right into the book. Rather than just text walk throughs, you get video / slides of how to do things visually. I really love this new way of doing books.
If you have never done or looking to do testing for you application (shame on you if you don't), you should really look into this book and Kiwi. I give it 5 stars!
Jason Zander's blog post on Unit Testing mentioned our Hilo project doing unit testing for Metro Applications in C++.
If you are really interested in this, download the code and check it out. We have to do some tricks to test Asyc methods, but since everything is async these days, you will probably find it useful.
If you have any feedback, leave it on the site so we can put this into future releases.
I am not a huge fan of the Windows Phone. It is a personal taste. I am not that into Metro. I keep seeing these things about being smoked by Windows Phone and it makes me sad. Are people really that gullible? Don't they realize that the person using the phone is an expert with the phone. This is all they do. Do you really think the test is not rigged in every way to give the advantage to the Windows Phone? This reminds me of the quote from Princess Bride when Vizzini and the Man in Black go against each other:
Vizzini: You only think I guessed wrong! That's what's so funny! I switched glasses when your back was turned! Ha ha! You fool! You fell victim to one of the classic blunders - The most famous of which is "never get involved in a land war in Asia" - but only slightly less well-known is this: "Never go against a Sicilian when death is on the line"! Ha ha ha ha ha ha ha! Ha ha ha ha ha ha ha! Ha ha ha...
Vizzini: [Vizzini stops suddenly, his smile frozen on his face and falls to the ground dead]
Buttercup: And to think, all that time it was your cup that was poisoned.
Man in Black: They were both poisoned. I spent the last few years building up an immunity to iocane powder.
I am pretty sure death is not on the line… just make sure you don't get fooled into not thinking for yourself.