There are lots of types of automated tests that can be coded. All of them have their strengths and weaknesses. The following are the most common ones:
Unit tests: These provide fast feedback, but they test only an isolated unit of code (say, a method in a class). For example, an issue with a SQL query would not be caught since a unit test would not hit the database. Unit tests usually are executed in seconds or even milliseconds.
Integration tests: These provide slower feedback, but they include testing the external integrations such as databases or web services. ...