Unit tests and validation