Radu Marinescu – The Good, the Bad and the Ugly of Dealing with Smelly Code
We all have a burning desire to write clean code. Every morning we wake up, look in the mirror, and promise ourselves that today we will follow the principles and best practices learned from Uncle Bob and his disciples. But we live in a cruel environment, surrounded by millions of smelly lines of code, reflections of a stinky design… and these constantly challenge our pure-hearted desire for writing clean code.
In such an environment, the stubbornness to practice daily the writing of clean code is vital.
But is it enough? Can we avoid getting lost in a sea of smelly code and design?
In this talk I will try to persuade you that, in dealing with large-scale systems, craftsmanship must be supported by proper techniques and tools that can help us to quickly understand, assess and improve the sea of smelly design that surrounds us.
I will present a pragmatic approach on how design anti-patterns (e.g. God Class, Feature Envy, Refused Bequest, Shotgun Surgery) can be automatically detected using a set of metrics-based detection rules, by analyzing the history of the system, and by using intriguing software visualizations.
The presentation will also include a live demo of tools that can automate the entire approach to a high-extent. These tools are so robust that they can deal with systems of several million lines of code; but they are also friendly enough to provide you with customized hints that help you deal with each and every case of an “unclean” code.
The overall goal of this tutorial is to discuss the good, the bad, and the ugly of assessing design quality, with a special emphasis on object-oriented design. Specifically, the tutorial will be composed of the following parts:
- The use of metrics to characterize, assess and improve the design of object-oriented systems. This will include a discussion of common pitfalls in using metrics, and how to circumvent them.
- Detection of well-known design anti-patterns using metrics, structural analysis techniques, as well as information about code evolution.
- Tool-supported techniques for dealing with instances of design anti-patterns, in a customized manner (i.e. understanding the problem and getting hints for cleaning the code. In this context, we will describe how state-of-the-art polymetric visualizations can help us to be more effective in understanding a software context.
Each part of the presentation will include a live demo of tools that can make these techniques part of our daily programming experience.
What will you learn?
You will learn how the detection of code and design smells can be automated, and how state-of-the-art techniques and tools related to software metrics, software evolution, software visualization can help you to understand and improve “unclean” design fragments.
The openness to let yourself impressed by a completely different way of dealing with projects with a “smelly” design. Having been part of such a project (at least once) is not a prerequisite… but it certainly helps.
Learn more about the detection rules and software visualization by reading the “Object-Oriented Metrics in Practice” book and start using yourself the tools that will be presented during the talk.
Do the attendees need a laptop?
No. But they may bring their laptops if they want to experiment live with the tools.