A method for planning components in software engineering

By using the function-operation-interface form to describe classes in an object-oriented software engineering environment and analyzing the relationship between classes through a modular method, the problem of poor component planning in the existing technology is solved, the clarity of the software structure and loose coupling between modules are achieved, and the maintainability and scalability of the software are improved.

CN115794041BActive Publication Date: 2025-06-27NO 719 RES INST CHINA SHIPBUILDING IND
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211445327.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-18
Publication Date
2025-06-27
Estimated Expiration
2042-11-18

AI Technical Summary

Technical Problem

In an object-oriented software engineering environment, it is difficult for the prior art to effectively analyze and plan the relationship between components, resulting in unclear software structure and tight coupling between modules, which affects the maintainability and scalability of the software.

Method used

The class is described in the form of function-operation-interface, and the relationship between classes is analyzed through a modular method to form the modular results of the class, and ultimately realize the planning of components. Specific steps include identifying classes, establishing class units, describing class collaboration relationships, calculating call and function correlations, defining correlation degrees, establishing correlation diagrams, and calculating modularity parameters.

Benefits of technology

Through this method, effective planning of software components is achieved, clarity of software structure and loose coupling between modules are improved, and maintainability and scalability of software are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115794041B_ABST
    Figure CN115794041B_ABST
Patent Text Reader

Abstract

The present invention provides a component planning method for an object-oriented software engineering environment, belonging to the fields of object-oriented software engineering and modularization methods; the division of components provided by the present invention is a key link in software modularization. Component-based design makes the software structure clearer, enabling each component to complete a relatively independent specific sub-function, and the relationship between modules is as loosely coupled as possible.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the fields of object-oriented software engineering and modularization methods, and specifically provides a component planning method for an object-oriented software engineering environment. Background Art

[0002] A component is a modular building block in computer software, which is a modular, deployable, and reusable part in a software system. This part encapsulates methods and provides a set of interfaces externally. Components play an important role in fulfilling the requirements and goals of the built system, and components must communicate and cooperate with other components to achieve the functions of the software.

[0003] In an object-oriented software engineering environment, a component is regarded as a collection of collaborating classes or a single class. Each class in the component is elaborated in detail, including all attributes and related operations implemented by it. As part of the detailed design, all interfaces for communicating and collaborating with other design classes must be defined. For this purpose, it is necessary to describe in detail the analysis classes and base classes in the software.

[0004] The present invention takes classes in the software design process as individual analysis elements, describes them in the form of function - operation - interface, and uses a modular method to analyze the relationships between classes, forming a modular result of classes, and finally realizing the planning of components. Specifically, it can be applied to the control systems of various power stations. Summary of the Invention

[0005] In view of one or more of the above defects or improvement requirements of the prior art, the present invention provides a component planning method in software engineering. The method includes the following steps:

[0006] Step S1: In the software engineering, identify all classes corresponding to the requirement description;

[0007] Step S2: For all classes obtained in Step S1, establish units of classes in the form of function - method;

[0008] Step S3: Describe in detail the collaboration relationships between the classes in each operation and the relationship of method calls between the classes, forming a collaboration diagram of classes, where the number of classes to be allocated is n, and i and j are any two different classes;

[0009] Step S4: According to the result of Step S3, perform cumulative calculation of relevance according to the pre - set calculation method of the call relevance between classes, and obtain the call relevance α c (i,j);

[0010] Step S5: According to the pre - set function relevance table, calculate the function relevance α f(i, j) and the function relevance matrix;

[0011] Step S6: According to the call relevance α c (i, j) and the function relevance α f (i, j) defines the relevance between any two functions i and j of n classes:

[0012] , where if i = j, then Γ(i, j) = 1. According to the relevance, the following correlation matrix can be established:

[0013]

[0014] Step S7: Establish a correlation graph according to the correlation matrix;

[0015] Step S8: Select a certain partition in the correlation graph obtained in Step S7, calculate the modularity parameter λ and its average value and minimum value, where the calculation formula of λ is:

[0016]

[0017] In the formula, Γ min (in) refers to the minimum value of the relevance between the same module classes in the correlation graph, and Γ max (out) refers to the maximum value of the relevance between the modules in the correlation graph. When the module is a single class, the value of Γ min (in) takes 1;

[0018] Step S9: Select the average value λ and the minimum value λ of the modularity with as large a value as possible min as the final module partition.

[0019] Preferably, in Step S1, the classes include function implementation classes, graphical user interface classes, and data management classes.

[0020] Preferably, in Step S3, the method calls between the classes are divided into 3 types:

[0021] (1) Feedback call: Call a method with a return value. The called method can perform operations such as arithmetic and analysis and return an actual result value for use by the calling class;

[0022] (2) Execution call: Call a method without a return value. The method can perform operations such as arithmetic and analysis;

[0023] (3) Basic call: Call a method that only queries, accesses, and stores.

[0024] Preferably, in Step S4, the calculation method of the call relevance α c (i, j) is as follows:

[0025]

[0026] where i≠j and i, j ∈ {1, 2, …, n}; i and j represent any two different classes, and the numbers of feedback, execution, and basic calls of the two are f, e, and b respectively.

[0027] Preferably, in step S7, the steps of establishing the association graph are as follows: find the maximum association degree of all vertices in sequence, connect the vertex with the corresponding vertex to generate an associated subgraph, then find the maximum association degree between the vertices in the associated subgraph and the vertices in other associated subgraphs, and connect the two vertices until all associated subgraphs are connected into an association graph.

[0028] Generally speaking, compared with the prior art, the beneficial effects of the above technical solutions conceived by the present invention include:

[0029] (1) A component planning method for an object-oriented software engineering environment, which is used for software component-level design. The division of components is a key link in software modularization. Component-based design makes the software structure clearer, enables each component to complete a relatively independent specific sub-function, and makes the relationship between modules as loosely coupled as possible;

[0030] (2) The present invention takes classes in the software design process as individual analysis elements, describes them in the form of functional operation interfaces, and for a specific class, its function can be abstracted into attributes and operations. Connections are established between multiple objects in a system through interfaces. If a certain object implements a certain operation, messages should be passed through the interface, and the calls between classes are realized through the interface, that is, objects are defined by classes, and operations in the classes are called through objects. Description of the Drawings

[0031] Figure 1 is the structure diagram of the class in the embodiment of the present invention;

[0032] Figure 2 is the collaboration diagram of the class in the embodiment of the present invention;

[0033] Figure 3 is the association diagram of the class in the embodiment of the present invention. Detailed Embodiment

[0034] In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0035] Embodiment:

[0036] A component planning method for an object - oriented software engineering environment, specifically including the following steps:

[0037] Step 1: For the software system to be studied, identify all design classes corresponding to the requirements description, including function - implementation classes, graphical user interface classes, data - management classes, etc. And clarify the defined methods in each class.

[0038] Step 2: For the class set obtained in Step 1, establish units of classes in the way of function - method, as Figure 1 shown.

[0039] Step 3: Describe the behavior of the system in the software, and detail the collaboration relationship between classes and the relationship of method calls between classes in each operation to form a class collaboration diagram. Here, assume the number of classes to be allocated is n, and i and j are any two different classes.

[0040] As Figure 2 shown, the method calls between classes in the figure are divided into 3 types:

[0041] (1) Feedback call: Call a method with a return value. The called method can perform operations such as calculation and analysis and return an actual result value for the calling class to use.

[0042] (2) Execution call: Call a method without a return value. The method can perform operations such as calculation and analysis.

[0043] (3) Basic call: Call a method that only queries, accesses, and stores.

[0044] Step 4: According to the result of Step 3, calculate the cumulative correlation according to the single - call correlation table between classes as shown below to obtain the call correlation between classes.

[0045]

[0046]

[0047] For any two different classes i and j, assume the numbers of their feedback, execution, and basic calls are f, e, and b respectively. Then the call correlation α c (i, j) is calculated as follows:

[0048] First, calculate m(i, j)=0.3f + 0.2e + 0.1b,

[0049] Then calculate

[0050] where i≠j and i, j∈{1, 2, …, n}

[0051] Step 5, calculate the function relevance matrix. Calculate the function relevance α between each function of n classes according to the function relevance table shown as follows f (i,j).

[0052]

[0053] Step 6, define the association degree between any two functions i and j of n classes according to the call relevance α c (i,j) and the function relevance α f (i,j):

[0054] where if i = j, then Γ(i,j) = 1. An association matrix as shown in the following formula can be established according to the association degree:

[0055]

[0056] Step 7, to facilitate further module division of components, an association graph can be established according to the association matrix. The basic steps for establishing the association graph are as follows: find the maximum association degree of all vertices in sequence, and connect this vertex with the corresponding vertex to generate the following association subgraph, then find the maximum association degree between the vertices in the association subgraph and the vertices of other association subgraphs, and connect these two vertices until all association subgraphs are connected into an association graph. The association graph is as Figure 3 shown.

[0057] Step 8, select a certain division in the association graph in Step 7, calculate the modularity parameter λ and its average value and minimum value. The calculation formula of λ is:

[0058]

[0059] In the formula, Γ min (in) refers to the minimum value of the association degree between the same module classes in the association graph, and Γ max (out) refers to the maximum value of the association degree between modules in the association graph. When the module is a single class, the value of Γ min (in) takes 1. When a node is not divided, its modularity is determined by the minimum association degree between classes. Therefore, define the minimum association degree between components in the association graph as its modularity.

[0060] Step 9, select the average value with as large a modularity as possible min and the minimum value λ

[0061] Those skilled in the art can easily understand that the above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, and improvements made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.

Claims

1. A method for planning components in software engineering, characterized in that: The method includes the following steps: Step S1: In the software engineering, identify all classes corresponding to those in the requirement description; Step S2: For all the classes obtained in Step S1, establish units of the classes in a function-method manner; Step S3: Describe in detail the collaboration relationships of the classes in each operation and the relationship of method calls between the classes to form a collaboration graph of the classes, where the number of classes to be allocated is n, and i and j are any two different classes; Step S4: According to the result of step S3, perform cumulative calculation of relevance according to the pre-set calculation method of the call relevance between classes, and obtain the call relevance α between classes c (i,j); Step S5: Calculate the functional correlation α between the functions of each of the n classes and the functional correlation matrix according to the pre-set functional correlation table. f (i, j) and the functional correlation matrix; Step S6: According to the call relevance α c (i, j) and the function relevance α f Define the association degree between any two functions i and j of n classes: , where if i = j, then Γ(i,j) = 1, and according to the degree of association, the following association matrix can be established: Step S7: Establish an association graph according to the association matrix; Step S8: Select a certain partition in the association graph obtained in Step S7, and calculate the modularity parameter λ and its average value and minimum value, where the calculation formula of λ is: where Γ min (in) refers to the minimum association degree between the same module classes in the association graph, and Γ max (out) refers to the maximum association degree between the modules in the association graph. When the module is a single class, the value of Γ min (in) is taken as 1; Step S9: Select the average value of modularity with the largest possible value and the minimum value λ min as the final module partition.

2. The method according to claim 1, characterized in that: In Step S1, the classes include function implementation classes, graphical user interface classes, and data management classes.

3. The method according to claim 1, wherein: In Step S3, the method calls between the classes are divided into three types: (1) Feedback call: Call a method with a return value. The called method can perform operations such as calculation and analysis and return an actual result value for the calling class to use; (2) Execution call: Call a method without a return value. The method can perform operations such as calculation and analysis; (3) Basic call: Call a method that only queries, accesses, and stores.

4. The method according to claim 1, characterized in that: In step S4, the call relevance α c (i,j) is calculated as follows: First calculate m(i,j) = 0.3f + 0.2e + 0.1b, Calculate the call relevance between two classes again where i ≠ j and i, j ∈ {1, 2, …, n}; i and j represent any two different classes, and the numbers of their feedback, execution, and basic calls are f, e, and b respectively.

5. The method according to claim 1, wherein: In Step S7, the steps for establishing the association graph are as follows: Find the maximum association degree of all vertices in sequence and connect the vertex with the corresponding vertex to generate an associated subgraph. Then find the maximum association degree of the vertices within the associated subgraph and the vertices of other associated subgraphs and connect the two vertices until all the associated subgraphs are connected into an association graph.

Citation Information

Patent Citations

  • Component technology-based product modeling method

    CN102087679A

  • Object-oriented unified-process software development method

    CN106502694A