I have an iphone application. Should i do unit testing or UI tesitng or is both necessary.
If UI testing is sufficient to test the models I will use Instruments.
If unit testing I'm planning to use OC Unit test. I'm new to it. I went through some tutorials but all seem to be very vague. I have few doubts in that.
My front screen is a login page that has username and password. How to verify if the user has entered both the textfields or none?? Im using interface builder to create the screen. My IBAction method [ -(void)login:(id) sender] verifies the username and password. Now how to use this method and perform unit testing for various scenarios? What should be passed in place of (id) sender while testing?
After succesful login the page navigates to another view which has table view. What unit testing to be done for tableview?
Thanks in advance.
For examples have a look at this set of videos on Unit Testing With Xcode.
The trouble you are facing is one of getting responses from a server when you do not have a connection or a response.
The solution is to use mocks, such as OCMock to pretend you have those responses, or to call the methods that would have been called by responses directly.
As for how much testing - do as much as you can. Test it yourself and get others to test it for you because they won't be using it the same way as you. Automate testing where you can, test the app with a script that runs you through the functionality of your app. Test it randomly, doing the wrong thing to make sure that your app fails gracefully.
There's no point asking us if you have performed testing, that's for you to decide. But think about the response the user of your app will give you if you ask - "Have I tested enough?".