Best metric available

Discussion in 'Java' started by lavanya.msra@gmail.com, Nov 28, 2008.

  1. Guest

    Hi All,

    What is the today best metric standard available to measure coupling
    of JAVA code?

    regards,
    Lavanya M.
     
    , Nov 28, 2008
    #1
    1. Advertising

  2. wrote:
    > Hi All,
    >
    > What is the today best metric standard available to measure coupling
    > of JAVA code?


    Counting the offspring?

    --
    RGB
    (Maybe I mean non-local references or something :)
     
    RedGrittyBrick, Nov 28, 2008
    #2
    1. Advertising

  3. Guest

    On Nov 28, 5:48 pm, RedGrittyBrick <>
    wrote:
    > wrote:
    > > Hi All,

    >
    > > What is the today best metric standard available to measure coupling
    > > of JAVA code?

    >
    > Counting the offspring?
    >
    > --
    > RGB
    > (Maybe I mean non-local references or something :)
     
    , Nov 28, 2008
    #3
  4. Guest

    On Nov 28, 5:48 pm, RedGrittyBrick <>
    wrote:
    > wrote:
    > > Hi All,

    >
    > > What is the today best metric standard available to measure coupling
    > > of JAVA code?

    >
    > Counting the offspring?
    >
    > --
    > RGB
    > (Maybe I mean non-local references or something :)


    pls tell briefly miss lavanya i cont understand
     
    , Nov 28, 2008
    #4
  5. wrote:
    > On Nov 28, 5:48 pm, RedGrittyBrick <>
    > wrote:
    >> wrote:
    >>> Hi All,
    >>> What is the today best metric standard available to measure coupling
    >>> of JAVA code?

    >> Counting the offspring?
    >>

    >
    > pls tell briefly miss lavanya i cont understand



    Google turns up
    http://www.virtualmachinery.com/jhawkmetricsclass.htm

    If by best you mean "easily found using Google" then perhaps this is the
    best. Otherwise you might find it helpful to tell us what "best" means
    to you.

    If you have patience, a real expert in this field might read your
    question and provide a more authoritative reply.

    Good luck.

    --
    RGB
     
    RedGrittyBrick, Nov 28, 2008
    #5
  6. Guest

    On Nov 28, 7:53 pm, RedGrittyBrick <>
    wrote:
    > wrote:
    > > On Nov 28, 5:48 pm, RedGrittyBrick <>
    > > wrote:
    > >> wrote:
    > >>> Hi All,
    > >>> What is the today best metric standard available to measure coupling
    > >>> of JAVA code?
    > >> Counting the offspring?

    >
    > > pls tell briefly miss lavanya i cont understand

    >
    > Google turns uphttp://www.virtualmachinery.com/jhawkmetricsclass.htm
    >
    > If by best you mean "easily found using Google" then perhaps this is the
    > best. Otherwise you might find it helpful to tell us what "best" means
    > to you.
    >
    > If you have patience, a real expert in this field might read your
    > question and provide a more authoritative reply.
    >
    > Good luck.
    >
    > --
    > RGB


    Using google I could find that for measuring Cohesion LCOM is perhaps
    most commonly used industry practised way of measuring coupling.
    But for measuring coupling could not find any such commonly accepted
    standard.

    Ok. I just looked into url provided. And it indeed is very helpful.

    regards,
    Lavanya M.
     
    , Nov 29, 2008
    #6
  7. <> wrote in message
    news:...
    > Hi All,
    >
    > What is the today best metric standard available to measure coupling
    > of JAVA code?
    >
    > regards,
    > Lavanya M.


    Typical coupling metrics are (and no single one is the "best"):

    1) Coupling Between Objects (CBO): this is the number of classes to which
    the class being measured is coupled, by accessing a method or instance
    variable of the other class(es). Include all classes to which the call could
    go because of polymorphism. Treat inheritance as regular coupling for CBO
    purposes (** some definitions say exclude these - it's up to you). If the
    method call is simply an implementation of an interface this doesn't count;

    2) Data Abstraction Coupling (DAC): the number of attributes in your
    measured class that have another class as their type. DACd is the number of
    different other classes used as types by your class. This does not include
    interfaces (since using them is a good thing), and use your judgment as to
    classes external to your project. Strictly speaking what you're looking for
    is the number of different instantiations of other classes in the measured
    class, so locals are included;

    3) Number of Foreign Methods Accessed (NFMA): for a method, how many methods
    does it invoke that belong to other classes? For a class, the sum of the
    previous. Note that in both cases multiple occurrences are counted once.
    Inherited method calls may or may not be counted - just document which one
    you do;

    4) Method Invocation Coupling (MIC): the relative number of classes that
    receive messages from your measured class. A ratio in other words.

    There is also the COF, Coupling Factor, which is another relative
    coefficient.

    It's the interpretation of any of the above that is key. For example, data
    abstraction is good...to an extent. I've seen projects where the developers
    went apeshit creating classes for every logical data type, and all that
    added was dozens of different String types and the like. That would get
    dinged by a DAC metric, and IMHO rightfully so. But in another situation
    exactly the same number might be OK, if the classes referenced genuinely had
    a decent purpose.

    You might also be interested in reading about the Law of Demeter. I can see
    the argument - if you're going to invoke a method on an object you should
    have a direct reference to it, rather than getting it through a method call
    on yet another object, but in practise this is not followed much.

    AHS
     
    Arved Sandstrom, Nov 29, 2008
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Metric tool for Java

    , Jul 8, 2006, in forum: Java
    Replies:
    6
    Views:
    4,280
    Andrew T.
    Jul 12, 2006
  2. Miguel Lopez

    Metric Tool for Python

    Miguel Lopez, Jul 5, 2004, in forum: Python
    Replies:
    1
    Views:
    391
    Sylvain Thenault
    Jul 5, 2004
  3. Replies:
    0
    Views:
    639
  4. Ben Giddings
    Replies:
    10
    Views:
    238
    Adrian Howard
    Apr 1, 2005
  5. piaseckiac

    standard to metric converter program

    piaseckiac, Oct 27, 2003, in forum: Javascript
    Replies:
    47
    Views:
    430
Loading...

Share This Page