r/iOSProgramming • u/juanbautistajryabadu • Mar 03 '15
How do you do Unit Testing?
I have a fairly big project at work and want to start adding unit tests. Basically I have to start from scratc; but I find myself against a plethora of frameworks and tools that can be used. So before diving in and commiting to one, I wanted to know some opinions. In addition, I want to start doing TDD at some point, so it'd be great to consider it in advance.
From what I've been reading (OCMock, OCMockito, OCHamcrest, specta+expecta, Kiwi, Cedar, Catch), you can go with BDD using matchers; or you can simply use a mocker and work with XCTest; or you can work everything by brute force and not use any tool at all.
It seems that a good solution is OHHTTPStubs to stub requests, plus some tool to create mocks.
What do you think? Do you do BDD? Do you only use XCTest from the bat? Any other cool tools that might be useful? Any help would be great. Thanks!
View all comments
Show parent comment
1
u/cactus_rape Mar 17 '15
Probably just an assertion library like nimble, mocking with ocmock, and no extra framework. I'm dealing with a lot of kiwi pain at the moment and I feel like reliable tests are orders of magnitude better than an attempt at an rspec-like framework that doesn't buy you much. It's not worth the pain just to be able to put a test in a 'describe' with a 'forEach'.