- Series: Developer's Library
- Paperback: 256 pages
- Publisher: Addison-Wesley Professional; 1 edition (April 19, 2012)
- Language: English
- ISBN-10: 0321774183
- ISBN-13: 978-0321774187
- Product Dimensions: 6.9 x 0.6 x 8.9 inches
- Shipping Weight: 13.6 ounces (View shipping rates and policies)
- Average Customer Review: 24 customer reviews
- Amazon Best Sellers Rank: #1,424,050 in Books (See Top 100 in Books)
Enter your mobile number or email address below and we'll send you a link to download the free Kindle App. Then you can start reading Kindle books on your smartphone, tablet, or computer - no Kindle device required.
To get the free app, enter your mobile phone number.
Test-Driven iOS Development (Developer's Library) 1st Edition
Use the Amazon App to scan ISBNs and compare prices.
Fulfillment by Amazon (FBA) is a service we offer sellers that lets them store their products in Amazon's fulfillment centers, and we directly pack, ship, and provide customer service for these products. Something we hope you'll especially enjoy: FBA items qualify for FREE Shipping and Amazon Prime.
If you're a seller, Fulfillment by Amazon can help you increase your sales. We invite you to learn more about Fulfillment by Amazon .
Customers who viewed this item also viewed
Customers who bought this item also bought
What other items do customers buy after viewing this item?
From the Back Cover
As iOS apps become increasingly complex and business-critical, iOS developers must ensure consistently superior code quality. This means adopting best practices for creating and testing iOS apps. Test-Driven Development (TDD) is one of the most powerful of these best practices. Test-Driven iOS Development is the first book 100% focused on helping you successfully implement TDD and unit testing in an iOS environment.
Long-time iOS/Mac developer Graham Lee helps you rapidly integrate TDD into your existing processes using Apple’s Xcode 4 and the OCUnit unit testing framework. He guides you through constructing an entire Objective-C iOS app in a test-driven manner, from initial specification to functional product. Lee also introduces powerful patterns for applying TDD in iOS development, and previews powerful automated testing capabilities that will soon arrive on the iOS platform. Coverage includes
- Understanding the purpose, benefits, and costs of unit testing in iOS environments
- Mastering the principles of TDD, and applying them in areas from app design to refactoring
- Writing usable, readable, and repeatable iOS unit tests
- Using OCUnit to set up your Xcode project for TDD
- Using domain analysis to identify the classes and interactions your app needs, and designing it accordingly
- Considering third-party tools for iOS unit testing
- Building networking code in a test-driven manner
- Automating testing of view controller code that interacts with users
- Designing to interfaces, not implementations
- Testing concurrent code that typically runs in the background
- Applying TDD to existing apps
- Preparing for Behavior Driven Development (BDD)
The only iOS-specific guide to TDD and unit testing, Test-Driven iOS Development covers both essential
concepts and practical implementation.
About the Author
Graham Lee's job title is “Smartphone Security Boffin,” a role that requires a good deal of confidence in the code he produces. His first exposure to OCUnit and unit testing came around six years ago, as test lead on a GNUstep-based server application. Before iOS became the main focus of his work, Graham worked on applications for Mac OS X, NeXTSTEP, and any number of UNIX variants.
This book is the second Graham has written as part of his scheme to learn loads about computing by trying to find ways to explain it to other people. Other parts of this dastardly plan include speaking frequently at conferences across the world, attending developer meetings near to his home town of Oxford, and volunteering at the Swindon Museum of Computing.
Top customer reviews
There was a problem filtering reviews right now. Please try again later.
The author also never covers any strategies for developing test cases. For someone new to TDD, the reason he chooses to test certain things is a complete mystery. Often it's "I want to do X here are some random test cases I think that are related to that." There's so little explanation as to why he thinks those are good tests e.g. it's good to have coverage on how data is handed off between classes or it's good to test for malformed data sent into method parameters.
I mostly found this book very frustrating to read because I had to constantly re-read his explanations, review his example code, and draw my own conclusions by reading between the lines as to why he chose to test things in the way he did.
If you are moderately experienced with iOS coding and don't mind analyzing this guy's code to figure out TDD best practices, then this book is for you. He does execute his stuff really well and you can learn a lot from the way he approaches things but if you want to start doing TDD on your own, strap yourself in for some serious code analysis because the author offers few strategic explanations.
Having recently moved from years of .Net development to iOS development, I was looking for both a quick indoctrination (by example) on how to configure and use the OCUnit test environment shipped with Xcode as well as wanting to see how a subject matter expert dealt with the early "expense" of writing unit tests while the design of the application continued to evolve. The book met both of these objectives for me, it was quite evident that the author truly employed the development processes on the project he proffered, by demonstrating on multiple occasions that some implementation paths dead-ended requiring refactoring of both test and code. Several other books on TDD seem to always get it right the first time and gloss over the investment of carrying unit tests throughout the entire development lifecycle. So a big thank you for a realistic work flow to drive the principles in the example.
For full disclosure, I have less than 3 weeks of iOS programming experience, but I am currently completely immersed in the platform while taking the iTunes University Stanford CS193p course. I was looking to augment the coursework with unit testing and this book quickly bridged the gap between Microsoft's Test framework and OCUnit tests. I can recommend this as a quick bridge if you have experience in the .Net world. I decided to build the project as I worked through the book which took me about 7 days. I had very little problem keeping in synch with the author, through Chapter 8, writing the same tests and validating pass/fail expectations that were set in the book along the way. This covered the application data model, application logic, and networking. The application is an iPhone app which browses the popular [...] My basic controller skills were not up to par with the author's resourceful/skilled implementation usage of a single view controller so I parted ways and implemented a three controller solution, but stayed true to the TDD way with unit tests that matched my pedestrian solution.
Once the controllers were in place the remaining couple of chapters again synched up well with my work and I was able to complete the project with same finishing touches to the views that the author made.
I was very glad to have the git repository of the code at my disposal, I would not have been successful without the code to reference. In fact, the availability of the code accounts for at least one of the rating stars!
So why not five stars? Granted its a first edition work, and though the typos/errors in the book are few, there is no website or online tool for checking or submitting errata.
- Chapter 5 starts with a sidebar on the need (or no need) to get an API key from StackOverflow, to guard against being throttled by StackOverflow for making too many requests. A few more words on what the limit is would have allayed my fear of a low limit cut-off and saved me from needlessly running into the StackOverflow oAuth/API key ditch.
- Chapter 9 is tough and needs a Black Diamond warning or novices beware warning, the technical complexity just seemed to jump a quantum from the rest of the book.
All in all, I recommend buying the book and doing the work. I'd love to have coffee with the author someday and personally express my thanks for the experience!
If you've already got the TDD religion from other platforms, you can jump directly to Chapter 4 "Tools For Testing"; those of us of a more skeptical bent will find reading through Chapters 1-3 an nice gentle progression through demonstrating the value of testing at all through to "How to Write a Unit Test" and how that leads to safely refactorable design.
Said Chapter 4 goes over the Xcode built-in support thoroughly and introduces GTM, GHUnit, CATCH, and OCMock on the coding side, plus Hudson/Jenkins and CruiseControl on the integration side. That covers anything you're even remotely likely to encounter in existing projects.
Chapter 5 "Test-Driven Development of an iOS App" starts the 6 chapter process of developing BrowseOverflow, a StackOverflow question browser; full source available on github for everyone. Note that's "process of" rather than "walkthrough of" developing; these aren't 5 chapters of simple lecturing, at every step the analysis and alternatives are discussed thoroughly, with asides on design patterns, refactoring, and all kinds of good stuff, finishing up with Chapter 11 on general design principles derived from the process, thoroughly applicable even if you're not using TDD at all.
Finishing up the book, Chapter 12 "Applying Test-Driven Development to an Existing Project" gives some straightforward advice on grafting testing into your ongoing development, and Chapter 13 "Beyond Today's Test-Driven Development" surveys techniques not fully baked for iOS development yet.
Overall, pretty much every -- no, seriously, pretty much *every* -- iOS programmer would solidly benefit from reading this book. Even if you're already developing with solid test coverage, there's almost certainly some insights here you'll find useful. And if you're in the position of most of us where you're using tests half-heartedly and more likely not at all, you should put reading this to figure out just how this TDD thing could do you some good at the top of your list of self-improvement tasks. And if you're new to development in general, why then this should be pretty much the next thing in your programming curriculum after design patterns!
Most recent customer reviews
I think that Graham Lee was extremely lazy in this book.Read more
At times I found it hard to follow since the pace gets really fast towards the end of...Read more