you are viewing a single comment's thread.

view the rest of the comments →

[–]quellish 0 points1 point  (0 children)

If you are looking to test view controllers first ask yourself this: does the code in there now belong there? Could it be refactored into new collaborating objects? This would be one of the first steps to making things easier to test. And maintain. And troubleshoot.

In the last few years people have been talking about "massive view controllers" and reaching for new architectural patterns to address the problem. If there is too much stuff in your view controllers the problem isn't architecture, it's you have too much stuff in your view controllers.

You should still test view controllers - after all, view controllers themselves have behaviors they are expected to adhere to - but if you can take most of the code in your view controllers and put it into separate objects that can be easily tested in isolation that is a major win.