XCODE: Set up TDD environment with xcode’s 3 Hidden Features.
Everyone knows how important test-driven development is as the years of development increase. To become an advanced developer, you must do TDD. There are hidden features for TDD in xcode that people don’t know about. I would like to introduce them.
[1] Enable Code Coverage
(1) Click Edit Scheme
(2) Tab on Test
(3) Activate “Gather coverage for”
(4) Run Test
(5) Check your test coverage
50% of the code was tested. The higher the coverage, the better the tested app.
[2] Enable Unit Test Breakpoint
If you enable this Test failure Breakpoint
option, whenever your test code fails, it automatically stops at the breakpoint.
[3] Check code coverage file by file
If you enable Code Coverage, after you run a test, the file indicates whether the code was covered for test or not.
This is really handy when developing your app with TDD!
Conclusion
- Enable Code Coverage on your scheme
- Enable Unit Test Breakpoint
- Enable Code Coverage for each file
If you do that, Your productivity will increase tenfold or more.
Please, leave a comment if the article was helpful !