Understanding what it means to test code

When you test your code, you're essentially making sure that certain input produce the desired output. A very basic example of a test would be to make sure that calling a method that increments its input by a given value produces the output you expect.

Any time you launch your application in a simulator or on a device and test whether you can perform specific actions in an app, you are testing your code. Any time you print something to the console to verify that the expected value is printed, you are also testing your code. Once you think about testing this way, a concept that might have sounded hard before actually does not seem as complicated as you may have thought. So if using your app is a way of testing it, then what should you write tests for?

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset