What is unit testing? How to write test before writing code

Unit tests are snippets of code written to verify the expected behavior of an item. To test the item, you...