The Source for Java Technology Collaboration
User: Password:



Felipe Gaucho

Felipe Gaucho's Blog

Code fitness: how fat is your code? how tall?

Posted by felipegaucho on January 25, 2007 at 02:26 PM | Comments (1)

I recently attended a JUGS meeting where Prof. Nierstrasz introduced some details about his new book, titled Object-Oriented Reengineering Patterns. Very interesting lecture based on a project that aims to research and to produce tools for supporting the refactory of legacy code. Professor started asking the attendants what you mean by legacy code? and also presented some basic concepts about patterns and software reengineering. Then he introduced MOOSE - an environment for reengineering that comes with a tool that produces several views about the complexity of classes in OO projects. One of these views was very impressive for me, the one that show a class diagram based on code metrics like number of attributes, number of methods and line codes as code width, code height and code color - I immediately started to associate that with human caracteristics. Ok, the professor didn't suggested nothing about biometrics applyied to software, even because it shouldn't make sense to apply such concept to an inanimate stuff, but it was a funny mind game for me, to think about the code fitness. The two images below gives you a glimpsy about that:

bio1.jpg
Figure 1 - A Class Diagram.

A Class Diagram gives you a nice view about the hierarchical relationship between the classes, but does not represent too much about the quality of the code on each class. If one is required to choose a class on the above diagram for starting a code refactor, which class should be? Now, check the same class diagram presented through a MOOSE view:

bio2.jpg
Figure 1 - A Class Diagram with physical attributes.

At first sight, it is not so easy to understand what class is better or worst, but in a few seconds you start to figure out that more complex classes produced darker and bigger boxes. On the figure, the dark boxes represent classes with more lines of code and the tall boxes represent classes with more methods. And, of course, you can imagine several possibilities of representation with different shapes, colors or even including figures to represent different software quality deviations.

The physical attributes of the classes give us a very nice feeling about the bug champions candidates :) Imagine what is the shape of your current project. What is the shape of the classes? Lean classes? Imagine the silhouette of that weird code you noticed last year, and what about all that minor problems your team didn't had time to fix on the past?

I know there is several other tools and projects out there, but for me it was the first time I thinked about code with physical attributes. So, I decided to share this experience and suggest you to visit the project of the Bern University and try the MOOSE tool.

* MOOSE is written in Smalltalk, but it has also an Eclipse plugin that allow us to export java and jsp source code to a format understood by the Moose. More: there is a company that produced a compiler of Smalltalk code to Java, but I don't know if it is still available.


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first)

  • The subject of a very wonderful and distinct
    I thank you for continuing excellence
    Thank you

    =========================================================================

    ليبيا
    شباب ليبيا
    libya
    منتديات
    منتديات ليبية
    غرائب وحقائق
    أحاديث شريفة
    برامج اسلامية للجوال
    مفاتيح الديجيتل
    الشيرنج
    الرسيفرات
    كتب إسلامية
    خلفيات للموبيل
    الشعر الشعبي
    الصحة والطب
    طب اسنان
    كتب طب اسنان مجانية
    برامج طبية
    تعلم الإنكليزية
    اللغة الفرنسية
    طب الإعشاب
    الخواطرالادبية
    الازياء والمكياج
    تعليم الطبخ
    الاثاث الحديث
    مقاطع كرة قدم
    المصارعه الحرة
    اهداف كوره
    الفوتوشوب
    اروع البرامج
    الدوري الليبي
    خلفيات رياضية
    المصارعة
    كورة عربية
    كرة قدم عالمية
    الدوري الإيطالي
    الدوري الاسباني
    الدوري الإنجليزي
    صور المشاهير
    انواع الحلويات
    افلام كوميدية
    احدث الافلام
    افلام
    التقنية
    تحميل افلام
    برامج
    اخر برامج الجوال
    kaspersky
    أفلام كرتون عربية
    برامج برامج كمبيوتر
    برامج حماية
    برامج اختراق
    برامج صوت
    برامج تحميل برامج احدث البرامج
    محادثة
    خلفيات الطبيعة
    برامج مبايل للتحميل
    اخبار الفن
    احدث الافلام للتحميل
    تحميل افلام رعب
    ترجمةأفلام
    الكامات
    برامج جوال
    برامج محاسبة
    برامج
    kasper
    games
    برامج
    برامج
    انترنت
    برامج صوتية
    شبكات الحاسوب
    خلفيات للويندوز
    تطويرالمواقع
    العاب
    العاب الفيديو
    games
    شفرات
    برامج مسنجر
    خلفيات شاشة
    صور ترحيبيه
    الفوتوشوب
    خلفيات طبيعة
    تطويرالمواقع
    الفوتوشوب
    مقاطع البلوتوت
    مسجات ليبية
    خلفيات
    الفلاش
    التصميم الثلاثي
    برامج الجوال
    العاب الجوال
    فيديو كليب
    مسجات
    ترددات ستالايت
    نغمات

    Posted by: libyan on May 30, 2008 at 03:16 PM





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds