Database Reference
In-Depth Information
CHAPTER 5
Testing Enterprise iOS Applications
If there's one philosophy that has become entrenched in the DNA of software devel-
opment in recent memory, it's that testing is crucial. For some organizations, it means
comprehensive unit testing, for others a full-on TDD approach with continuous inte-
gration and regression testing. But the chances are that you're not going to be shipping
your iOS application out the door without some significant test infrastructure.
Beyond simple unit testing, you also should have testing of the running application,
which offers its own challenges. Not only do you need to have a testing framework that
can successfully exercise your UI, but you also have to make sure that all your other
integration components (such as backend servers and databases) are in a consistent
state every time you run the tests.
Recently, more advanced metrics such as cyclic complexity numbers (CCN) have be-
come en vogue. They recognize that just because code is fully tested doesn't mean that
it's well written. On the other hand, developers can end up gaming the system to get
lower CCN numbers, at the cost of code quality. We'll take a look at how to generate
CCN metrics automatically, later in the chapter.
It's worth noting here that the various testing frameworks have, in my opinion, been
the most poorly maintained and casually broken parts of the SDK over the time that
I've been developing. Apple changes how (and if!) test frameworks operate without
notice, and sometimes apparently at random. Developers with automated test frame-
works pray to their chosen deity before taking an XCode update, because you never
know what may and may not work afterwards. With that in mind, be aware that any-
thing you see here is subject to change, and just because you set something up one way
today doesn't mean that it will work the same way tomorrow. The general principles
outlined here should hold true, however.
 
Search WWH ::




Custom Search