??????TDD????У????(Refactoring)???????????????????????????????????????????(Transformation)??????????????????????????Щ???ε?仯??????????????specific?????generic??
????Uncle Bob??????????????bowling game kata ?? Prime Factor kata???????
?????????????ε??????Uncle Bob?о??????????????????????????
({}–>nil) no code at all->code that employs nil
(nil->constant)
(constant->constant+) a simple constant to a more complex constant
(constant->scalar) replacing a constant with a variable or an argument
(statement->statements) adding more unconditional statements.
(unconditional->if) splitting the execution path
(scalar->array)
(array->container)
(statement->recursion)
(if->while)
(expression->function) replacing an expression with a function or algorithm
(variable->assignment) replacing the value of a variable.
???????????????TDD?????????(Impasse)?????????test??????????о??仯?????????????????????????———?????????????????????????????????????????????????????????????test case??????????????????????????(?????)?????????????????????????и?????test??
??????????word wrap kata????????????????У???????
assertThat(wrap(“word word”?? 6)?? is(“word word”));
?????????Bob??????
return s.replaceAll(” “?? “ ”); //(expression->function)transformation
???????????????????
???????Bob??????????????и?????????????????????????
assertThat(wrap(“longword”?? 4)?? is(“long word”));
assertThat(wrap(“longerword”?? 6)?? is(“longer word”));
    ????? (null->constant) ??(expression->function)  ???
return s.substring(0?? length) + “ ” + s.substring(length);
????TDD???????????????????????????????(expression->function)???Σ????????????壬???????????????????????“???”????
?????????????????case????????? (null->constant) ??(expression->function)  ?????????????
????Bob??????·?????????????????????????????в??????