CS FundamentalsVery hardProduct-company placement

A new filter must be added to a 400-line untested method. Instead of editing the method's logic, the developer writes the filter as a new method, test-drives it in isolation, and inserts a single call to it from the old method. What is this technique called?

  1. A. Wrap Method
  2. B. Extract Interface
  3. C. Sprout Method
  4. D. Strangler Fig

Correct answer: C. Sprout Method

Sprout Method (from Feathers' work on legacy code) grows new, tested code beside old untested code and links them with one call. Wrap Method renames the old method and adds behaviour before or after it; Strangler Fig works at system level.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic