add compile task and its test

This PR adds a task `compile`

In addition, `TestHelper` was made and some code duplication were removed