Unencapsulated Collection-A Teachable Design Smell


Design smells are design structures that indicate poor design quality. Many identified smells are difficult to teach as they require a degree of experience and judgement that novices, by definition, do not have. We have identified a design smell, which we call “unencapsulated collection”, that is common in novice designs. It is simple to describe, allowing it to be objectively detected, and the refactoring steps needed to remove the smell are usually simple to illustrate. We give a description of the smell and present the results of an empirical study showing its prevalence. We outline the general steps for refactoring the smell, and illustrate it with a case study. The simplicity of this smell makes it a good candidate for teaching good design principles to novices.

In Proceedings of the 49th ACM Technical Symposium on Computer Science Education (SIGCSE), February 21-24, 2018, Baltimore, Maryland, USA, to appear