Add unit tests and integrate into build process