Writing Unit Tests for Legacy Code: Isolation Techniques