Generate tests from existing code