Unit tests with files and better variable detection