constraint based refactoring
play

Constraint-Based Refactoring Rename Field Problem Proven Correct - PowerPoint PPT Presentation

Constraint- Based Refactoring Hansruedi Patzen Refactoring Constraint-Based Refactoring Rename Field Problem Proven Correct Solution Constraint- Based Refactoring Hansruedi Patzen 1 Constraint Rules Generalize Type Implementation


  1. Constraint- Based Refactoring Hansruedi Patzen Refactoring Constraint-Based Refactoring Rename Field Problem Proven Correct Solution Constraint- Based Refactoring Hansruedi Patzen 1 Constraint Rules Generalize Type Implementation University of Applied Sciences Rapperswil Researchers Summary 14th January 2019 Discussion References 1 hansruedi.patzen@hsr.ch

  2. Constraint- Based Refactoring Hansruedi Patzen Refactoring Rename Field Refactoring Problem Solution Constraint- Based Refactoring Constraint Rules Why even bother? Generalize Type Implementation Researchers Summary Discussion References

  3. Constraint- Based Refactoring is everywhere Refactoring Hansruedi Patzen Refactoring Rename Field Problem Solution Constraint- Based Refactoring Constraint Rules Generalize Type Implementation Researchers Summary Discussion References

  4. Constraint- Based Rename Field Refactoring Hansruedi Patzen Refactoring 1 class BankAccount { Rename Field int n; // the amount of money a customer has Problem 2 Solution 3 } Constraint- Based 4 Refactoring 5 class Customer { Constraint Rules Generalize Type BankAccount account; 6 Implementation 7 Researchers void receiveMoney(int amount) { 8 Summary account.n += amount; 9 Discussion } 10 References 11 }

  5. Constraint- Based Rename Field Refactoring Hansruedi Patzen Refactoring 1 class BankAccount { Rename Field int n ; // the amount of money a customer has Problem 2 Solution 3 } Constraint- Based 4 Refactoring 5 class Customer { Constraint Rules Generalize Type BankAccount account; 6 Implementation 7 Researchers void receiveMoney(int amount) { 8 Summary account. n += amount; 9 Discussion } 10 References 11 }

  6. Constraint- Based Rename Field Refactoring Hansruedi Patzen Refactoring 1 class BankAccount { Rename Field int balance ; // the amount of money a customer has Problem 2 Solution 3 } Constraint- Based 4 Refactoring 5 class Customer { Constraint Rules Generalize Type BankAccount account; 6 Implementation 7 Researchers void receiveMoney(int amount) { 8 Summary account. balance += amount; 9 Discussion } 10 References 11 }

  7. Constraint- Based Refactoring Hansruedi Patzen Refactoring Rename Field Problem Solution Constraint-Based Refactoring Constraint- Based Refactoring Constraint Rules Generalize Type Implementation Researchers Summary Discussion References

  8. Constraint- Based Constraint-Based Refactoring Refactoring Hansruedi Patzen Refactoring Rename Field Problem Solution Constraint- Based Refactoring Constraint Rules Generalize Type Implementation Researchers Summary Discussion References

  9. Constraint- Based Constraint Rules Refactoring Hansruedi Patzen Refactoring Rename Field Problem Solution Constraint- Based Refactoring query ( v ) Constraint Rules Generalize Type Implementation constraints ( v ) Researchers Summary Discussion References

  10. Constraint- Based Constraint Rules Refactoring Hansruedi Patzen Refactoring Rename Field Problem Solution C# Specification: “The type of a field must be at least as accessible as the field itself.” Constraint- Based Refactoring Constraint Rules f ∈ Fields (P) Generalize Type Implementation f . type . accessability ≥ f . accessability Researchers Summary Discussion References

  11. Constraint- Based Constraint-Based Refactoring Refactoring Hansruedi Patzen Refactoring Rename Field Problem Solution Constraint- Based Refactoring Constraint Rules Generalize Type Implementation Researchers Summary Discussion References

  12. Constraint- Based Generalize Type Refactoring Hansruedi Patzen Refactoring Rename Field Problem Solution 1 class Base { // decl Base Constraint- Base b; // ref Base , decl b Based 2 Refactoring 3 } Constraint Rules Generalize Type 4 class Sub extends Base { // decl Sub , ref Base Implementation Sub s ; // ref Sub , decl s 5 Researchers 6 } Summary Discussion References

  13. Constraint- Based Generalize Type Refactoring Hansruedi Patzen Refactoring Rename Field Problem Solution { // decl Sub 1 class Sub Constraint- b; // ref Sub , decl b Based Sub 2 Refactoring 3 } Constraint Rules Generalize Type 4 class NN extends Sub { // decl NN , ref Sub Implementation s; // ref Sub , decl s Sub 5 Researchers 6 } Summary Discussion References

  14. Constraint- Based Generalize Type Refactoring Hansruedi Patzen Refactoring Rename Field Problem Solution 1 class Base { // decl Base Constraint- Base b; // ref Base , decl b Based 2 Refactoring 3 } Constraint Rules Generalize Type 4 class Sub extends Base { // decl Sub , ref Base Implementation Base s; // ref Base , decl s 5 Researchers 6 } Summary Discussion References

  15. Constraint- Based Refactoring Hansruedi Patzen Refactoring Rename Field Implementation Showcase: Problem Solution Constraint- Based Refactoring Eclipse JDT Constraint Rules Generalize Type Implementation Researchers Summary Discussion References

  16. Constraint- Based Refactoring ChangeTypeRefactoring Hansruedi Patzen Refactoring 1 public Collection <ITypeBinding > computeValidTypes (...) { Rename Field constraintVariable = Problem 2 Solution findConstraintVariableForSelectedNode (...); Constraint- Based relevantVariables = 3 Refactoring findRelevantConstraintVars(constraintVariable , ...); Constraint Rules Generalize Type relevantConstraints= 4 Implementation findRelevantConstraints(relevantVariables); Researchers validTypes.addAll(computeValidTypes(selectionTypeBinding , 5 Summary relevantVariabless , relevantConstraints)); Discussion return validTypes; 6 References 7 }

  17. Constraint- Based Notable Researchers Refactoring Hansruedi Patzen Refactoring Rename Field Problem Solution Constraint- Based Refactoring Constraint Rules Generalize Type Implementation Researchers Summary Discussion References Friedrich Steimann Frank Tip

  18. Constraint- Based Summary Refactoring Hansruedi Patzen Refactoring Rename Field Constraint-Based Refactoring... Problem Solution • ...can be proven correct. Constraint- Based • ...can find multiple solutions for a refactoring. Refactoring • ...needs to limit the number of solutions, by Constraint Rules Generalize Type • tailoring the constraint rules Implementation • limiting the solutions space Researchers • ...needs a sufficient coverage of the target language Summary Discussion • ...is used in the real world → Eclipse JDT References

  19. Constraint- Based Refactoring Hansruedi Patzen Refactoring Rename Field Discussion: Problem Solution Constraint- Based Refactoring Constraint-Based Refactoring Constraint Rules Generalize Type Implementation Researchers Summary Discussion References

  20. Constraint- Based References I Refactoring Hansruedi Patzen F. Steimann, “Constraint-Based Refactoring”, ACM Trans. Program. Lang. Syst. , Refactoring vol. 40, no. 1, 2:1–2:40, Jan. 2018, issn : 0164-0925. doi : 10.1145/3156016 . Rename Field Problem [Online]. Available: http://doi.acm.org/10.1145/3156016 . Solution Constraint- ——,“Constraint-based Model Refactoring”, in Proceedings of the 14th Based Refactoring International Conference on Model Driven Engineering Languages and Systems , Constraint Rules ser. MODELS’11, Berlin, Heidelberg: Springer-Verlag, 2011, pp. 440–454, isbn : Generalize Type Implementation 978-3-642-24484-1. [Online]. Available: Researchers http://dl.acm.org/citation.cfm?id=2050655.2050700 . Summary F. Steimann and J. von Pilgrim, “Refactorings Without Names”, in Proceedings Discussion of the 27th IEEE/ACM International Conference on Automated Sofware References Engineering , ser. ASE 2012, New York, NY, USA: ACM, 2012, pp. 290–293, isbn : 978-1-4503-1204-2. doi : 10.1145/2351676.2351726 . [Online]. Available: http://doi.acm.org/10.1145/2351676.2351726 .

  21. Constraint- Based References II Refactoring Hansruedi Patzen ——,“Constraint-Based Refactoring with Foresight”, in Proceedings of the 26th European Conference on Object-Oriented Programming , ser. ECOOP’12, Berlin, Refactoring Heidelberg: Springer-Verlag, 2012, pp. 535–559, isbn : 978-3-642-31056-0. doi : Rename Field Problem 10.1007/978-3-642-31057-7_24 . [Online]. Available: Solution http://dx.doi.org/10.1007/978-3-642-31057-7_24 . Constraint- Based Refactoring M. Fowler, K. Beck, and J. Brant, Refactoring: Improving the Design of Existing Constraint Rules Code , 1st ed. Addison-Wesley Professional, 1999, isbn : 978-0-201-48567-7. Generalize Type Implementation F. Tip, R. M. Fuhrer, A. Kieżun, M. D. Ernst, I. Balaban, and B. D. Suter, Researchers “Refactoring using type constraints”, ACM Transactions on Programming Summary Languages and Systems , vol. 33, no. 3, pp. 1–47, 2011, issn : 01640925. doi : Discussion 10.1145/1961204.1961205 . [Online]. Available: References http://portal.acm.org/citation.cfm?doid=1961204.1961205 . F. Tip, Frank Tip , 2019. [Online]. Available: http://www.franktip.org/ (visited on 01/09/2019).

Recommend


More recommend