Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Behavior-Driven Development for your iPhone projects!

DZone's Guide to

Behavior-Driven Development for your iPhone projects!

· DevOps Zone
Free Resource

Learn more about how CareerBuilder was able to resolve customer issues 5x faster by using Scalyr, the fastest log management tool on the market. 

So let’s say you’re interested in Behaviour-Driven Development testing of your iPhone projects. But there isn’t anything to help out Objective-C like all the cool kids have, you say? Not so! Here is your introduction to Cedar:

 

BDD-style testing using Objective-C

… One of the things I found I miss most in testing Objective-C, Java, or C++, is the hierarchical structure for organizing tests that frameworks like RSpec or Jasmine provide. I find nested describes indispensable for managing orthogonal aspects of the classes under test, for handling preconditions, for eliminating redundant setup code, and for generally keeping my sanity. So, when I first heard about the addition of blocks in the GCC compiler for Objective-C the first application that came to mind was testing.

So, I wrote Cedar, a BDD-style framework for writing tests in Objective-C. The code is available here. Perhaps more importantly, Cedar is in its infancy so I’m interested in any suggestions and feedback. To that end, I created a public Tracker project for it here


and a followup post correcting people who thought it wouldn’t work for iPhone development:

BDD-style testing for iPhone projects

… I actually wrote Cedar specifically for testing iPhone OS projects we’re working on at Pivotal. To prove it, I’ve started a small public iPhone project that I’ve test-driven entirely with Cedar. You can get the project here (more on that in a bit); it should eventually allow you to log into Pivotal Tracker, see all the delivered stories in a given project, and accept or reject each one…


So that looks like that might be an interesting new development style to take up. Although, at this exact point in time, one might wait for that currently-NDA’d version of Xcode to be released before making any firm commitments…

h/t: iPhoneFlow!

Find out more about how Scalyr built a proprietary database that does not use text indexing for their log management tool.

Topics:

Published at DZone with permission of Alex Curylo, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}