×

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 C⇒ 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

Java String Interview Questions

Java String Interview Questions String is the most common and important discussed topics in a Java interview. In Java interview interviewer generally asked three to four questions based on String concept....

16 minutes read.

Java If Keyword

Definition: The if statement specifies a section of Java code that will run if an if statement's condition is false. The following conditional statements can be used in Java: To provide a block...

3 minutes read.

Java protected vs private

Java : Java is a pure object oriented language. It was introduced by James Gosling in the year 1995. The first public implementation of java was done by sun micro systems...

3 minutes read.

Java Garbage Collection Interview Questions

One of the key areas of Java is garbage collection. Garbage collection enables apps to manage memory automatically. Interviewers frequently ask inquiries about garbage collection. Q1: What is the purpose of...

6 minutes read.

How to Convert String to Integer in Java

How to convert String to int in Java You need to convert String into int if you want to perform a mathematical operation on string which contains digits. To do so,...

3 minutes read.

Sparse Numbers in Java

In this section, we will be very well acknowledged about the sparse numbers in Java, how a number can be verified if it is a sparse number or not. Sparse Numbers Any...

3 minutes read.

Features of Java

The objective of the Java programming language is to provide portability, security, and simplicity. In spite of this, Java has a number of features that makes it a popular language...

5 minutes read.

Even Odd Program in Java

Even Odd Program in Java The number that are completely divisible by 2 are even and the number that leaves remainder are odd numbers. For example, the numbers 2, 0, 4,...

5 minutes read.

Java Char Keyword

The java char keyword is a data type which is defined as character data type.Char keyword belongs to a primitive data type where the data types are classified into primitive...

4 minutes read.

Java Boolean Keyword

Boolean keyword In java programming language we basically have two types of primitive data types, Boolean and Numeric (integer and floating-point data types). In this article we are going to learn...

4 minutes read.

How to check the Java version in cmd

To make programs that can run on our systems, we need to install programming language-related software in our systems. Different programming languages require different types of software, aka IDEs (Integrated...

5 minutes read.

Java String Inbuilt functions

There are different types of inbuilt functions available in the Java String class, all of them are listed below. Char chat At (int index)It outputs the character indicated by the index....

5 minutes read.

How to check version of java in Linux

Java is one of the most famous and thoroughly utilized programming tongues from one side of the world to the other. On the off chance that you are a Java...

2 minutes read.

Virtual Function in Java

In the Operated Oriented Programming language, a virtual function or virtual method is a collection of functions that overrides the functionality of a function in an inheriting class with the same...

4 minutes read.

Counting sort in Java

An array's elements are sorted using the counting sort method, which counts how many times each distinct element appears in the array. The count is kept in an auxiliary array,...

3 minutes read.

Exception Handling in Java

Before looking at how exceptions are handled in java, it is necessary to see what an exception is. What is Exception? Whenever a program is written, errors are encountered. Some of these...

6 minutes read.

Java Output Formatting

Sometimes we want a program's output to be displayed in a specific format. The printf () function in the C programming language can be used to achieve this. We will...

4 minutes read.

Nested Enum in Java

A class that can be defined within another class is called a nested class in Java. You can logically group classes that are used onlyin one place. This makes encapsulation...

3 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.

Java ArraylistRemove() Time Complexity

In this tutorial, we will learn about how we can remove time complexity in Java ArrayList. But unless we will not learn what is ArrayList, we don’t understand this process....

7 minutes read.