Causes and Measures for spaghettifying codes and models

This post describes the causes and remedies for spaghettifying codes and models.

Causes

Recently, I have been asked more and more for advice on spaghetti codes and spaghetti models.

The main cause of spaghetti code and spaghetti models is that software designers design their code and models to match software requirement specifications, and then code and create models as is. Software requirement specifications are sometimes created without considering software architecture and inter-component interface variables (interface variables across components: global variables), resulting in spaghetti code and spaghetti models.

To prevent this problem, it is necessary to clearly stipulate as a design rule that either the requirements specification publisher or the software designer is responsible for considering software architecture and inter-component interface variables. However, leaving this to the discretion of the person in charge has resulted in many cases of spaghetti code and spaghetti models.

Spaghetti code and spaghetti models not only reduce maintainability and portability, but also reduce design efficiency and quality.

Causes:

  1. Lack of architectural design for software architecture and inter-component interface variables.
  2. Lack of design rules for software requirement specifications for inter-component interface variables.
  3. Lack of design rules for software design of inter-component interface variables.
  4. Lack of education on software architecture and inter-component interface variables.

Countermeasure plan

I would like to suggest the following countermeasures. There are other countermeasures that you may consider as well.

Countermeasure plan:

  1. Provide a component Receive and Send sections as shown in the figure below.
    Receive section: Copy from an intercomponent interface variable to a local variable within a component.
    Send section: Copy local variables within a component to intercomponent interface variables
    All components are processed in local variables within the component.
  2. Software requirements specification specifies inter-component interface variables.
  3. Software design is designed using the №1 component Receive and Send sections.
  4. Educate about the Receive and Send parts of the №1 component.

The figure below shows an example of measures taken with measures №1 and №3.

OSS-ECAL English
error: Content is protected !!