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?
- A. Wrap Method
- B. Extract Interface
- C. Sprout Method
- 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.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- A quality-attribute scenario reads: 'During peak sale traffic, a shopper's search request is answered by the catalogue service within 2 s…
- A project planned to finish in month 10 actually finishes in month 13. Why does its schedule performance index (SPI = EV / PV) show 1.0 at…
- An activity not on the critical path has a total float of 3 days and a free float of 1 day. It is delayed by 5 days, and nothing else…
- Which loop invariant lets you prove this binary search correct for a sorted list a? python lo, hi = 0, len(a) - 1 while lo <= hi: mid =…
- A team has 40 open defects; 15 new ones arrive and 25 are fixed each week. If these rates hold, how long until the backlog is cleared?
- Which statement correctly contrasts a centralised VCS such as Subversion with Git?