Add tests and measure code coverage