Rewriting the app using a test-driven design