Interactive Code Generation via Test-Driven User-Intent Formalization