×

MOOD Factors to Assess a Java Program

In this tutorial, we will comprehendthe meaning of mood factors in Java.

For the development of any software system,the quality of anapplication is important. It is more important to maintain large-scale software. The cost of the software would get reduced and the potential of the software will get enhanced if high-quality software is being used.

For the measurement of the software quality in a more quantitative way, MOOD factors are being.

MOOD is an acronym for Matrices for Object Oriented Design. It defines the features of an object-oriented application or program. This has been developed to enhance the level of java. It is taken into account to estimate a mark of Java program.Here are the six software quality indicators or metrics that are included in MOOD factors:

  1. Method Hiding Factor (MHF)
  2. Attribute Hiding Factor (AHF)
  3. Method Inheritance Factor (MIF)
  4. Attribute Inheritance Factor (AIF)
  5. Coupling Factor (COF)
  6. Polymorphism Factor (POF)

Information Hiding Factors

It includes the first twofactorsi.eMHF and AHF. It is a measure of the usage of the information-hiding notion supported by the encapsulation mechanism. Information hiding is used to:

  1. Handle the complexities by observing the composite components such as black boxes.
  2. Decrease "side-effects" triggered by modification of an application.
  3. Support a top-down method.
  4. Examine and join the systems.

Method Hiding Factor (MHF)

The following mathematical formula is taken into account to calculate the MHF:

MOOD Factors to Assess a Java Program

here,

  • Mh(Ci) = concealed Methods in class Ci
  • Md(Ci) = Mv(Ci) + Mh(Ci): Methods clear in Ci
  • Mv(Ci): observable Methods in class Ci
  • TC: Total number of Classes

The visible methods examine the functionality of the class. The MHF gets reduced if the overall classfunctionality gets enhanced. To implement this functionality, Atop-down approach is applied to implement this functionality. It means that the class implementation must be a stepwisebreakdown process so thatmore details could be added in hidden methods that result in incremented MHF.

The adequate range of MHF values lies within an interval 2,3 and 4. Too low values denote inadequately abstracted methods whereas higher MHFs denote lesser functionalities.

Attribute Hiding Factors (AHF)

AHF can be calculated by taking into account the following mathematical formula:

MOOD Factors to Assess a Java Program

here,

  • Ah(Ci) = concealed attributes in class Ci
  • Ad(Ci) = Av(Ci) + Ah(Ci): attributes well-defined in Ci
  • Av(Ci): observable attributes in class Ci
  • TC: Overall number of classes

The usage of the information-hidingnotionmaintained by the encapsulation mechanism is measured by AHF. Information hiding letshandling the complexity by converting complex components into black boxes. AHF should be used as much as probable. Preferablywholecharacteristics would be hidden;hence they could only be accessed by the equivalent class methods. The designers' attention should be triggered by very low values of AHF. The complexity of the program and the value of AHF are inversely proportional to each other.

Inheritance Factors

The third and fourth factors i.e MIF and AIF are measures of inheritance.

This mechanism is taken into account to express the similarity among classes allowing for the description of simplification and specialty relations, and an interpretation of the meaning of inheriting another class through reuse.

Method Inheritance Factor (MIF)

MIF can be computed by using the following mathematical formula:

MOOD Factors to Assess a Java Program

here,

  • Mi: inherited methods
  • Ma(Ci) = Md(Ci) + Mi(Ci): characteristicswell-defined in Ci
  • Md(Ci): well-defined methods
  • TC: Overall number of classes

Inheritance is not necessarily used but, the alignment of many inheritance relations together forms a directed acyclic graph, whose thickness and penetration allow easy understanding.

Attribute Inheritance Factor (AIF)

AIF can be computed through the following mathematical formula:

MOOD Factors to Assess a Java Program

here,

  • Ah(Ci) = hidden characteristics in class Ci
  • Ad(Ci) = Av(Ci) + Ah(Ci): characteristics defined in Ci
  • Av(Ci): visible characteristics in class Ci
  • TC: Overall number of classes

Coupling Factor (COF)

It is taken into account to measure the coupling between classes.

COF can be computed by using the below mathematical formula:

MOOD Factors to Assess a Java Program

here,

is_client(Cc,Cs) =| 1 if (Cc⇒Cs)^(Cc≠Cs) , 0 otherwise

TC: It signifies the entire number of classes.

The client-supplier relation, represented by Cc ⇒ Cs, means that Cc (client class) consists of at least one non-inheritance reference to a characteristic of class Cs (supplier class). The numeratorof COF denotes the actual number of couplings not referable to inheritance 2, 3, 4, and 6.

It is needed that classes interconnect with as few other classes as possible and that they exchange as little data as possible. Coupling relations risecomplications, lessen encapsulation and potential reuse and limit understandability and maintainability. In addition to this, coupling in software systems has a strong negative impact on software quality, and therefore should be kept to thelowest during the design phase. However, the classes must cooperate to carry some kind of functionality for a given application. Hence, the value of COF is expected to be lower bound 2, 3, and 4.

Polymorphism Factor (POF)

By the term Polymorphism, we understand that it is the ability to have so many forms.It is a very important concept in object-oriented programming

MOOD Factors to Assess a Java Program

here,

  • Mo(Ci): overriding Methods in class Ci
  • Mn(Ci): new Methods in class Ci
  • DC(Ci): quantity of Descendants of Class Ci (derived classes)
  • TC: Entireamount of Classes

The numerator of POF signifies the realamount of probable different polymorphic circumstances. Thespecifiednote sent to class Ci can be destined, statistically or dynamically, to a termed method application which may acquire any number of shapes as many times this method gets overridden.


Related Topics

Packages Program in java

Let us know what package is in the Java programming language, and later we will learn about types of packages and how to define a package. How to import Java...

4 minutes read.

Java copy constructor Example

Java provides the copy constructor much like C++ does. However, it is produced by default in C++. While we define our own copy constructor in Java. With an example, we will...

3 minutes read.

Collection Interfaces in Java with Examples

In this tutorial, we will discuss collection interfaces in Java with Examples. Introduction The Collection Interface is an individual from the Java Collections Framework. It is a root point of interaction of...

4 minutes read.

Java Integer toBinaryString() method

The toBinaryString() method of Java Integer class returns a string representing the specified int argument as an unsigned integer in base 2. Syntax public static String toBinaryString (int  i)  Parameters The parameter ‘i’ represents...

1 minute read.

Lambda expressions in Java

A brief introduction to Lambda expression in java In this topic, we will discuss the lambda expression in java. A lambda expression in Java is an enhanced version of an anonymous...

13 minutes read.

Java Thread Dump Analyzer

Thread: A thread is a PC program that is stacked into the PC's memory and is under execution. It tends to be executed by a processor or a bunch of processors....

15 minutes read.

Java Delete File

There are two techniques to erase a record in Java: Utilizing File.delete() technique.Utilizing File.deleteOnExit() technique. Using File.delete() technique: In Java, we can erase a document by utilizing the File.delete() technique for File class....

2 minutes read.

Difference Between Java and PHP

The two most used programming languages are PHP and Java. Both of them have a lot of similarities and distinctions. Let's first grasp each of them individually before examining their...

3 minutes read.

Java Password Generator

Generally, we must create a strong password for security reasons. In Java, there are numerous strategies for creating secure passwords. We will learn how to create a strong password in...

4 minutes read.

Dutch National Flag Problem in Java

Dutch National Flag (DNF) is a programming issue that Edsger Dijkstra put up. The white, red, and blue hues make up the Dutch flag. The goal is to haphazardly set...

6 minutes read.

Uses of Java

Java is used in many real-world Java applications, including technologies and tools. This Java programming language has become the backbone for developing many applications. In areas like embedded systems and...

3 minutes read.

Java Integer decode() method

The decode() method of Integer class decodes a String into an Integer. It can accept decimal, hexadecimal and octal numbers. Syntax public static Integer decode(String nm) throws NumberFormatException Parameters The parameter ‘nm’ represents the...

2 minutes read.

Prime Points in Java

The points that divide an integer into two halves containing a prime number are known as prime points. Printing every prime point of a specific number is the task. Let's...

6 minutes read.

How to set timer in Java

In this article, you will be very well equipped with the knowledge to set timer in java. The timer in java can be set by using timer class provided by...

3 minutes read.

How to override toString() method in Java?

Java is an object-oriented language. It only works with classes and objects. Thus, whenever we need to calculate, we need an object or objects that belong to the class. The Java method...

2 minutes read.

Repdigit Numbers in Java

A combination of repeated and digit, the term is. A repdigit, also known as a monodigit or a positional number system, is a natural number in recreational mathematics made up...

3 minutes read.

HttpURLConnection

HttpURLConnection Protocol It is a standard set of rules that allow electronic devices to communicate with each other. The http protocol The http protocol is for data communication, distributing, collaborating, hypermedia information systems, on the World Wide...

5 minutes read.

Time Class Operation in Java

The Java SQL package includes the time class. This class is merely a lightweight wrapper for java. util. THANKS TO THE recognize BC API can recognize this as a SQL...

3 minutes read.

Java Session

Session indicates interval of time. A session is a simple  time interval in which servers and client interacts. To maintain the state of the client or user we use technologies...

5 minutes read.

AES 256 Encryption in Java

Now a days, security has grown in importance. Java programming supports a variety of encryption and hashing methods, which offers security for data transport and communication among various nodes. In...

4 minutes read.