I am a beginner as a Software Developer. I have seen Test-Driven Development approach being talked upon on lot of technology blogs. There was also an SO Post on TDD for small projects.
But I wanted to know, how do people write Test Classes for their code in iOS project? Especially those that have very short deadlines, you have to give a build with new features every week.
And there are scenarios that UI and Requirements keep changing. So do we write test classes for each and every functionality in our Models only?
Or we also test the logic we use to write custom code for controls we create, or for testing code in View Controllers as well?
I want to write test classes, but I get scared trying it out in a live project thinking it will take a lot of my time. So is it that we test all the functionality or we test selected important features?
For an experienced TDD’er it will be the fastest to write tests for everything. For someone just starting to learn TDD, using TDD might be something like 50% slower* and they might not yet know how to write tests for some hard parts (such as the UI). An advantage of using TDD in a project with tight schedules is that you can release the project whenever you wish, even after every commit, because the program should be working at all times.
* Though in my case the speed of development in my first TDD project, which took about a month, was the same as before using TDD (when measured in lines of code per hour – which isn’t a good measure of productivity).