Cognitive Code Quality Improvement with Pattern Recognition and Recommendation by Examples

2020 
Several groups work on automated design pattern recognition or automated refactoring. The goal of our paper is to present examples for ugly program code and its transformation into a pretty version. These examples are useful to test and teach their systems. What does ugly code and pretty code mean? In an ugly code there is redundancy, which means that we have anomalies. Pretty code means that it has the same functionality as the ugly one, it follows a design pattern, and there is no redundancy. Our work is motivated by the fact, that we could not find a similar work, although, we work on an automated design pattern tool, so we think that there is a need for ugly and pretty code examples. This work contains examples for the design patterns: Null Object, Template Method, State, and Strategy. We do not discuss how to refactor the ugly code into a pretty one. The program codes are presented in Java.
    • Correction
    • Source
    • Cite
    • Save
    • Machine Reading By IdeaReader
    9
    References
    0
    Citations
    NaN
    KQI
    []