12. Platform Variations
Clone existing code and fix
low level platform interaction
+ Avoid complexity of virtualization layer
- Hard to propagate bug fixes
~ Ensure consistent behavior of all clones
12
13. Experimental Variations
Clone existing code and experiment
+ Maintain stable code
- Merging later may be difficult
~ Consistent maintenance becomes difficult
13
14. Boiler-plating
Cloning due to language constraints
+ Make reuse of trusted code possible
- Increased maintenance (close evolution)
~ Explicit and rigorous linking of all duplicates
14
15. API/Library Protocols
Clone reoccurring call sequences
+ Learn from code and reduce effort
- Degradation of Code Quality
~ Changes to API require maintenance of all clones
15
16. Language Idioms
a = malloc(64);
if (a == null) {
out(“Error!”);
}
...
Idioms provide standardization
+ Selfdocumenting and improve comprehensibility
- Faulty implementations are easily overlooked
~ no long term issues
16
17. Bug Workarounds
... ...
a = sqroot(81); a = sqroot(81);
... if (a != 9) {
a = 9;
}
...
Clone to provide work arounds
+ Clone buggy code and fix
- Source of the bug is not addressed
~ Remove clone when bug is fixed
17
18. Replicate & Specialize
Clone to reuse and adapt existing solutions
+ Less effort needed
- Long-term cost outweighs short-term benefit
~ Cost of refactoring rises over time
18