During an Evergreen Test Writing Day, people in the community gather on IRC to write tests, which can be used to help determine if code is functioning correctly.
In general, the code takes values that are both valid and invalid. In the case of valid values, the expectation is that the code does the task designed, and the tests should output information confirming or denying this. In the case of invalid input, the tests should indicate failure.
Tests can stop regression into non-working states. In other words, if I change a piece of code, and that code has a test, then the test can tell me whether my change has an error or not.
In the Evergreen Community we use both Perl tests and PgTap tests. PgTap test check to ensure that the PostgreSQL code is functioning properly. http://pgtap.org/