Unit Testing

Unit testing is only one of the many good practices that became popular with agile and test-driven methodologies such as XP and SCRUM. At its most basic, a unit test is a code test method that tests an actual code method of your application.

For every method you write in your application, you have one or more corresponding unit test methods. Your goal is to run all the unit tests at set intervals or events, for example, daily or every time you check in code to source control or every time you build. If all unit tests run and pass, you know that all your code works as expected. Of course, for this to happen you must always include unit tests for every new method that you add to ensure 100 percent code coverage.

Unit tests are invaluable ...

Get Microsoft® Mobile Development Handbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.