Also, though unit testing does not focus on code coverage, developers know which parts of the code are most likely to break and will test those parts more rigorously. Unit testing at this level also catches problems long before any other testing method will reveal the defects. Developers will usually run the unit tests every 10 or 15 minutes. When a test fails, developers must debug only the last 10 minutes' worth of changes at any one time. With other testing methods, developers sometimes must debug changes made over the span of several months.
Unit testing allows developers to start writing tests before writing the code.
Design the component. This can be done formally or informally, depending on the complexity of the component. Write unit tests to confirm that behavior. At first, the tests will not compile, since the code they test is not yet written. Your focus here is on capturing the intent of the component, not on the implementation.