FW Editor: What are your plans or objectives in the near future?
Immo Landwerth: When we released Clone Detective for Visual Studio, Visual Studio 2008 was the most recent release of the Microsoft integrated development environment (IDE). Recently, Microsoft has released the new version Visual Studio 2010 which provides a significantly improved code editor. Microsoft has rewritten it from scratch so that it is now based on managed code and uses the Windows Presentation Foundation (WPF) for its rendering. That opens a whole bunch of new opportunities for us to visualize cloned code in the IDE.
So our most important short term goal is porting Clone Detective to Visual Studio 2010.
Our mid- and long term goals are the support for black listing clones as well as expanding the supported programming languages to Visual Basic . NET as well as C++.
FW Editor: How and when did you start writing the code for Clone Detective? What inspired you the most? Do you plan to develop new software, or are you more focused on optimizing the current ones?
Immo Landwerth: The project started at my university where a bunch of researchers had created a tool called ConQAT which represents a continuous quality assessment toolkit. The goal of ConQAT is enabling measuring and relating several different aspects of software quality, such as code size, the conformance to the specified architecture as well as code duplication. The toolkit contains many different tools which are designed to be executed during a nightly build to generate data that can be visualized in a project dashboard, typically implemented as a web site.
However, they found that although aggregating code duplication for a project dashboard provides a good hint for certain quality metrics – such as how well the code is factored – aggregated information does not provide enough context needed by developers to analyze the root cause for duplication and certainly does not help to maintain it over time.
Therefore, my friend Thomas Dallmair and I had the goal creating an integration between the clone detection tools provided by ConQAT and Visual Studio so that developers can easily run clone detections, analyze the results and are able to maintain duplicated code in a consistent way when removing the cloned code is impossible or too costly.
FW Editor: Can you tell us more about the most important features available in Clone Detective?
Immo Landwerth: - Integration into VS
- Browsing clones
- Visualizing them in the editor
- Having a visual clue when editing code that is cloned
FW Editor: Do you have any plan to improve Clone Detective in the future? If yes, how are you going to do that?
Immo Landwerth: First of all, Clone Detective simply leverages the clone detection algorithms provided by ConQAT. Therefore, for all detection related features we mainly depend on ConQAT. Our goal is to expose the most important aspects in a comprehensive but yet easy to use user interface that sits on top of the Visual Studio.
Since Microsoft has polished the Visual Studio code editor significantly in the Visual Studio 2010 release we see a huge potential for leveraging the editor visualization features in order to improve the clone detection integration. Most importantly, these custom margins and custom code highlighters.
FW Editor: What are the advantages of using Clone Detective over any other similar product?
Immo Landwerth: Most clone detection tools are simply implemented as command line tools that generate clone reports, typically in some text-based format, such as XML. While some of them even provide a graphical user interface (GUI) it is often separated from the toolset the developers are using.
The major advantage of Clone Detective is that it is integrated in the IDE that is used by most C# developers, i.e. Visual Studio. This way, clone information is directly available to developers in their everyday activities. This way, clone detection just becomes another tool a developer can leverage without requiring learning a completely new toolset.
We believe that in general, the symbiosis between software engineering tools and IDEs provides more value than the sum of their values provided in isolation.
FW Editor: What do you love the most at C++ language? Why?
Immo Landwerth: [Note to Editor: I guess you really want to ask me about the C# language. Right now, Clone Detective is limited to analyzing C# code. In addition, the tool itself is written in C#. Therefore, I assume in the following the question is really about C# - which BTW is completely different from C++.]
To us, C# is just a representative for a set of languages and technologies that have grown significantly over the last 10 to 15 years. Microsoft calls the code produced by them “managed code”. This names code that is executed in a managed environment, i.e. on top of a runtime that provides key services, such as automatic memory management, security and just-in-time compilation. Well-known instances of managed environments are the Java platform and .NET. Traditional code that does not run on top of such a runtime is typically “unmanaged code” or “native code”.
Managed code provides the benefit that it is way easier to create composable parts than it is with native code. One of the reasons is automatic memory management. In most cases, you can simply pass an object from component A to another component B. In the native world, this could result in problems when component A frees the memory and component B tries to access it later. Furthermore, managed environments also provide a single types system so that there is a single representation for a string.
What we like about the C# language is that it provides a programming model on top of a managed environment that does not deny its ancestors (C/C++) but also avoids many traps and problems of them.
But it is worth calling out that we also see some problems in the new world of managed code. Due to the advantages of managed environments they often result in systems with a lot of components. Besides the benefits of having componentized systems this also imposes engineering challenges, such as ensuring a well-factored dependency graph. Sometimes this causes unfortunate situations in which code is cloned due to architectural constraints.
We believe that clone detection is one of many tools required to cope with the challenges of a managed environment.
FW Editor: How can you describe Clone Detective in one single word?
Immo Landwerth: It is hard to reduce a tool like clone detective to a single word. However, since the main value provided by Clone Detection for Visual Studio is the integration with Visual Studio, it would be “integration”.
FW Editor: What is your message for Clone Detective users?
Immo Landwerth: If you care about software architecture and code quality in general, you should definitely have a look at Clone Detective for Visual Studio. It is the easiest and most convenient way to start analyzing your code for duplication.
About this interview
|