A method for software design and development and a terminal
By generating detailed design documents and core class diagrams corresponding to the architecture design documents, and automating the review of project code, the problem of discrepancies between design and development in software development is solved, achieving consistency between design and development and the reliability of documents.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-10
- Publication Date
- 2026-03-17
AI Technical Summary
In existing technologies, design component diagrams and class diagrams during software development require manual conversion and document updates, making it difficult to determine whether the design scheme can be truly implemented. As the iteration time increases, serious discrepancies between the software design and the actual development code can easily occur, leading to maintenance difficulties.
By generating detailed design documents and core class diagrams corresponding to the architecture design documents, it is determined whether the project code matches the detailed design documents. If they do not match, the core class diagrams and corresponding design documents are regenerated. Gerrit is used to intercept submitted code and perform automated review to ensure consistency between design and development.
It improves the consistency between software design and development, ensures the correct and reliable implementation of design documents during the development phase, reduces design-code discrepancies caused by long-term iterations, and lowers the difficulty of later maintenance.
Smart Images

Figure CN115469832B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of software engineering technology, and in particular to a method and terminal for software design and development. Background Technology
[0002] In software development, to ensure project reliability and on-time delivery, architects conduct architectural design before development to clarify the responsibilities and dependencies of project modules. During development, software engineers follow the module divisions and dependencies in the architecture design document to produce detailed design documents, and finally proceed with business development. When discrepancies arise between development details and the architecture design, software developers need to modify the code structure based on the actual situation and manually notify the software designers to update the iteration documents.
[0003] Currently, with existing technology, architects mainly use UML (Unified Modeling Language) to describe module division and dependencies in software and write architecture design documents, with component diagrams as the core output; software engineers output detailed summary design documents based on the architecture design documents, with class diagrams as the core output; and software engineers develop based on the design documents.
[0004] Although component diagrams and class diagrams can be converted into code with one click during software development, and code structures can also be converted into UML diagrams with one click, manual conversion and notification of document updates are still required. It is impossible to determine whether the design solution has been truly implemented. As the iteration time increases, serious discrepancies between software design and actual development code may occur, leading to maintenance difficulties. Summary of the Invention
[0005] The technical problem to be solved by the present invention is to provide a method and terminal for software design and development, which can improve the consistency between software design and software development.
[0006] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:
[0007] A software design and development method, comprising the following steps:
[0008] Generate an architecture design document based on the software requirements, and then generate a corresponding detailed design document based on the architecture design document.
[0009] Based on the core class diagram in the detailed design document, generate the corresponding core class code, and develop the project code based on the core class code;
[0010] Determine whether the project code matches the core classes in the detailed design document. If so, submit the project code to the code repository; otherwise, regenerate the core class diagram and the corresponding detailed design document and architecture design document.
[0011] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is as follows:
[0012] A software design and development terminal includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs the following steps:
[0013] Generate an architecture design document based on the software requirements, and then generate a corresponding detailed design document based on the architecture design document.
[0014] Based on the core class diagram in the detailed design document, generate the corresponding core class code, and develop the project code based on the core class code;
[0015] Determine whether the project code matches the core classes in the detailed design document. If so, submit the project code to the code repository; otherwise, regenerate the core class diagram and the corresponding detailed design document and architecture design document.
[0016] The beneficial effects of this invention are as follows: It generates detailed design documents corresponding to the architecture design documents based on software requirements, and generates corresponding core class code based on the core class diagrams in the detailed design documents. Developers can directly develop the project code based on the core class code. If the core classes in the project code do not match those in the detailed design documents, the core class diagrams and corresponding design documents are regenerated, greatly improving the consistency between software design and software development. If the project code matches the core classes in the detailed design documents, the project code is submitted to the code repository, ensuring that the submitted documents are correct and reliable, and guaranteeing the effective implementation of the design documents during the development phase. Attached Figure Description
[0017] Figure 1 A flowchart illustrating a software design and development method according to an embodiment of the present invention;
[0018] Figure 2 This is a schematic diagram of a terminal for software design and development according to an embodiment of the present invention;
[0019] Figure 3 This is a flowchart illustrating the specific steps of a software design and development method according to an embodiment of the present invention. Detailed Implementation
[0020] To explain in detail the technical content, objectives, and effects of the present invention, the following description is provided in conjunction with the embodiments and accompanying drawings.
[0021] Please refer to Figure 1 and Figure 3 This invention provides a method for software design and development, including the following steps:
[0022] Generate an architecture design document based on the software requirements, and then generate a corresponding detailed design document based on the architecture design document.
[0023] Based on the core class diagram in the detailed design document, generate the corresponding core class code, and develop the project code based on the core class code;
[0024] Determine whether the project code matches the core classes in the detailed design document. If so, submit the project code to the code repository; otherwise, regenerate the core class diagram and the corresponding detailed design document and architecture design document.
[0025] As can be seen from the above description, the beneficial effects of the present invention are as follows: A detailed design document corresponding to the architecture design document is generated based on the software requirements; corresponding core class code is generated based on the core class diagram of the detailed design document; developers can directly develop the project code based on the core class code; if the core classes in the project code do not match those in the detailed design document, the core class diagram and the corresponding design document are regenerated, greatly improving the consistency between software design and software development; if the project code matches the core classes in the detailed design document, the project code is submitted to the code repository, ensuring that the submitted documents are correct and reliable, and guaranteeing the successful implementation of the design document during the development phase.
[0026] Furthermore, generating corresponding detailed design documents based on the aforementioned architecture design document includes:
[0027] Generate core class diagrams corresponding to the components in the architecture design document;
[0028] The detailed design document is designed based on the core class diagram.
[0029] As described above, by generating core class diagrams corresponding to the components in the architecture design document, and then designing corresponding detailed design documents based on the core class diagrams, the consistency between the architecture design and the detailed design can be guaranteed.
[0030] Furthermore, determining whether the project code matches the core classes in the detailed design document includes:
[0031] Intercept the project code submitted to the code repository;
[0032] Determine whether the core class in the detailed design document exists in the project code and whether the dependency relationship of the core class matches that of the detailed design document.
[0033] As described above, intercepting the project code submitted to the code repository and then judging whether the project code matches the core class ensures that the project code submitted to the code repository matches the core class in the design document, thus guaranteeing the consistency between the design document and the code development.
[0034] Furthermore, the process of regenerating the core class diagram and the corresponding detailed design document and architecture design document includes:
[0035] Determine whether the regenerated detailed design document and architecture design document can pass the review. If so, update and synchronize the regenerated detailed design document and architecture design document; otherwise, issue an anomaly alarm.
[0036] As described above, by further reviewing the regenerated design documents, an anomaly alert can be issued if the review fails, ensuring the reliability of the updated design documents.
[0037] Furthermore, the process of issuing the anomaly alarm includes:
[0038] Determine whether the abnormal alarm is due to inconsistent naming or the addition of intermediate dependencies to the original dependency relationship. If so, sort out the names and associations of the core classes; otherwise, modify the project code according to the detailed design document and architecture design document.
[0039] As described above, if the exception alarm is due to inconsistent naming of the core class or the addition of intermediate dependencies in the original dependency relationship, the core class names and associations can be sorted out to redirect the code, thus ensuring flexibility when there are minor differences between the actual code and the design.
[0040] Please refer to Figure 2 Another embodiment of the present invention provides a terminal for software design and development, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs the following steps:
[0041] Generate an architecture design document based on the software requirements, and then generate a corresponding detailed design document based on the architecture design document.
[0042] Based on the core class diagram in the detailed design document, generate the corresponding core class code, and develop the project code based on the core class code;
[0043] Determine whether the project code matches the core classes in the detailed design document. If so, submit the project code to the code repository; otherwise, regenerate the core class diagram and the corresponding detailed design document and architecture design document.
[0044] As described above, the system generates detailed design documents corresponding to the architecture design documents based on software requirements, and generates corresponding core class code based on the core class diagrams in the detailed design documents. Developers can directly develop the project code based on the core class code. If the core classes in the project code do not match those in the detailed design documents, the core class diagrams and corresponding design documents are regenerated, greatly improving the consistency between software design and software development. If the project code matches the core classes in the detailed design documents, the project code is submitted to the code repository, ensuring that the submitted documents are correct and reliable, and guaranteeing the effective implementation of the design documents during the development phase.
[0045] Furthermore, generating corresponding detailed design documents based on the aforementioned architecture design document includes:
[0046] Generate core class diagrams corresponding to the components in the architecture design document;
[0047] The detailed design document is designed based on the core class diagram.
[0048] As described above, by generating core class diagrams corresponding to the components in the architecture design document, and then designing corresponding detailed design documents based on the core class diagrams, the consistency between the architecture design and the detailed design can be guaranteed.
[0049] Furthermore, determining whether the project code matches the core classes in the detailed design document includes:
[0050] Intercept the project code submitted to the code repository;
[0051] Determine whether the core class in the detailed design document exists in the project code and whether the dependency relationship of the core class matches that of the detailed design document.
[0052] As described above, intercepting the project code submitted to the code repository and then judging whether the project code matches the core class ensures that the project code submitted to the code repository matches the core class in the design document, thus guaranteeing the consistency between the design document and the code development.
[0053] Furthermore, the process of regenerating the core class diagram and the corresponding detailed design document and architecture design document includes:
[0054] Determine whether the regenerated detailed design document and architecture design document can pass the review. If so, update and synchronize the regenerated detailed design document and architecture design document; otherwise, issue an anomaly alarm.
[0055] As described above, by further reviewing the regenerated design documents, an anomaly alert can be issued if the review fails, ensuring the reliability of the updated design documents.
[0056] Furthermore, the process of issuing the anomaly alarm includes:
[0057] Determine whether the abnormal alarm is due to inconsistent naming or the addition of intermediate dependencies to the original dependency relationship. If so, sort out the names and associations of the core classes; otherwise, modify the project code according to the detailed design document and architecture design document.
[0058] As described above, if the exception alarm is due to inconsistent naming of the core class or the addition of intermediate dependencies in the original dependency relationship, the core class names and associations can be sorted out to redirect the code, thus ensuring flexibility when there are minor differences between the actual code and the design.
[0059] The software design and development method and terminal described above are applicable to bidirectional synchronization of software design documents and software development code, ensuring strong consistency between design and development. The following detailed embodiments illustrate this method:
[0060] Example 1
[0061] Please refer to Figure 1 and Figure 3 A software design and development method, comprising the following steps:
[0062] S1. Generate an architecture design document based on the software requirements, and generate a corresponding detailed design document based on the architecture design document.
[0063] The generation of corresponding detailed design documents based on the architecture design document includes:
[0064] Generate core class diagrams corresponding to the components in the architecture design document;
[0065] The detailed design document is designed based on the core class diagram.
[0066] Specifically, in this embodiment, the architect designs the core component diagrams using an online electronic document UML tool, and implements drawing tools and expands capabilities using a topology diagram editor, web GraphEditor:
[0067] The standard defines the standard graphics of components, classes, packages, interfaces, and relationship arrows. When saving the design document, it parses the data of the saved file, identifies the components, classes, interfaces and their corresponding relationships in the design diagram, generates a JSON description structure for these graphics, and uploads and saves the design structure and relationships.
[0068] The JSON description structure is as follows:
[0069] [{
[0070] name:'Name'
[0071] type: 'Type (class, interface, package, component)',
[0072] dependency: ['dependency relationships (dependencies, inheritance, implementations)'],
[0073] target: {the name of the target that depends on it}
[0074] alias: 'alias nickname'
[0075] package:'package name'
[0076] language: 'target language'
[0077] git; 'target git project name'
[0078] }).
[0079] When software designers perform detailed design, they select the associated architecture design document, and the core class diagram is automatically generated based on the component names in the component diagram of the architecture design document. The core class diagram contains the module entry class corresponding to the component and the relationships between the classes. After obtaining the core class diagram, a preliminary design or detailed design is performed, thereby ensuring the consistency between the architecture design and the detailed design.
[0080] S2. Generate the corresponding core class code based on the core class diagram in the detailed design document, and develop the project code based on the core class code.
[0081] Specifically, in this embodiment, after the software designer outputs the preliminary design or detailed design, the Java code corresponding to the core class diagram can be generated with one click, thereby ensuring the consistency between the detailed design document and the actual code.
[0082] The one-click generation of Java code corresponding to the core class diagram is as follows: After saving the class structure and relationships of the generated design during the high-level design, the document service triggers a task to dynamically generate class files for the specified language Java / TS based on the above JSON structure data. The language corresponding to the core class and the Git project to which the class belongs are selected to generate Java / JS core classes and the relationship information between classes, and generate an extended configuration file. The system automatically generates the initialization code of the core class to the code repository Gerrit Git.
[0083] Software development engineers will use the generated core class code to develop business logic, resulting in project code.
[0084] S3. Determine whether the project code matches the core class in the detailed design document. If yes, submit the project code to the code repository; otherwise, regenerate the core class diagram and the corresponding detailed design document and architecture design document.
[0085] The determination of whether the project code matches the core class in the detailed design document includes:
[0086] Intercept the project code submitted to the code repository;
[0087] Determine whether the core class in the detailed design document exists in the project code and whether the dependency relationship of the core class matches that of the detailed design document.
[0088] Specifically, if the project code modifies the structure of the original design document, a scan is triggered after each code commit to the Git repository. In this embodiment, Gerrit is used as a commit intermediary and for code review. When a file is committed to Gerrit, it is intercepted in a specified Gerrit ref to trigger a scan of the project source code. The scan determines whether it matches the class information generated during the design phase. That is, all classes are scanned to see if there are classes with corresponding package names, class names, and inheritance and implementation relationships that match. The class information is then analyzed in detail to determine whether the dependencies are consistent. If the source code does not match the class information generated during the design phase, the actual information of the current class is read through the Java / TS reflection mechanism, and the data of the new design drawing is reconstructed. The software design electronic document system is then notified to generate a new version of the design document. When the scanned information is completely consistent, the Gerrit interception module automatically commits the code to the actual Git repository.
[0089] Example 2
[0090] Please refer to Figure 3 The difference between this embodiment and Embodiment 1 is that it further specifies how to handle the regenerated core class diagram and the corresponding detailed design document and architecture design document. Specifically:
[0091] After regenerating the core class diagram and the corresponding detailed design document and architecture design document, the following is included:
[0092] Determine whether the regenerated detailed design document and architecture design document can pass the review. If so, update and synchronize the regenerated detailed design document and architecture design document; otherwise, issue an anomaly alarm.
[0093] In this embodiment, the generated new class diagram and the new version of the design document are submitted to the designers for review and confirmation. If the review is approved, the regenerated detailed design document and the architecture design document are updated and synchronized. If the review is not approved, an exception alarm is triggered to notify the software development engineer and architect for processing, thereby ensuring that the difference between the specific implementation and the design can automatically generate new documents to trigger the review.
[0094] The process of issuing an anomaly alarm includes:
[0095] Determine whether the abnormal alarm is due to inconsistent naming or the addition of intermediate dependencies to the original dependency relationship. If so, sort out the names and associations of the core classes; otherwise, modify the project code according to the detailed design document and architecture design document.
[0096] Specifically, after receiving an exception alert, if the discrepancy between the design document and the actual implementation is not an error, such as inconsistent naming or intermediate dependencies, the configuration file can be used for redirection to reorganize the relationships between core classes, thereby ensuring flexibility when there are minor differences between the actual implementation and the design.
[0097] If the abnormal alarm is not a false alarm, the software development engineer needs to modify the code according to the design document.
[0098] Example 3
[0099] Please refer to Figure 2 A software design and development terminal includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the various steps of the software design and development method of Embodiment 1 or Embodiment 2.
[0100] In summary, the software design and development method and terminal provided by this invention generate detailed design documents corresponding to the architecture design document based on software requirements, and generate corresponding core class code based on the core class diagram of the detailed design document. Developers can directly develop the project code based on the core class code. If the core classes in the project code do not match those in the detailed design document, the core class diagram and the corresponding design document are regenerated, greatly improving the consistency between software design and software development. If the project code matches the core classes in the detailed design document, the project code is submitted to the code repository, ensuring the accuracy and reliability of the submitted documents. After regenerating the core class diagram and the corresponding design document, it is submitted to the designers for review. If the review fails, it is necessary to determine whether there is a deviation between the design document and the actual implementation, rather than an error, thus ensuring flexibility when there are small differences between the actual implementation and the design. Therefore, the combination of an electronic design document system and Gerrit, and the automated mapping of the document's core diagram and core classes for bidirectional synchronization, can greatly improve the consistency between software design and software development, ensuring the good implementation of the design during the development phase. It also ensures the accuracy and reliability of the documents, solving the problems of large deviations caused by long-term iterations and untimely updates to design and code, and the difficulties in later maintenance caused by personnel turnover.
[0101] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A method of software design and development, characterized by, The method comprises the steps of: generating an architecture design document according to software requirements, generating a corresponding detailed design document based on the architecture design document, the detailed design document comprising a core class diagram defined in structured data form; generating corresponding core class code according to the core class diagram of the detailed design document, and developing engineering code based on the core class code; judging whether the engineering code matches the core class in the detailed design document, if yes, submitting the engineering code to a code repository, otherwise, re-generating a core class diagram and corresponding detailed design document and architecture design document based on the engineering code; the step of judging whether the engineering code matches the core class in the detailed design document comprises: intercepting the engineering code submitted to the code repository; judging whether the core class in the detailed design document exists in the engineering code and whether the dependency relationship of the core class matches the detailed design document; the step of re-generating the core class diagram and corresponding detailed design document and architecture design document comprises: judging whether the re-generated detailed design document and architecture design document can pass the audit, if yes, updating and synchronizing the re-generated detailed design document and architecture design document, otherwise, performing abnormal alarm; the step of performing abnormal alarm comprises: judging whether the abnormal alarm is inconsistent naming or adding intermediate dependency in the original dependency relationship, if yes, sorting the name and association relationship of the core class, otherwise, modifying the engineering code according to the detailed design document and architecture design document.
2. The method of claim 1, wherein, The method comprises the steps of: generating a core class diagram corresponding to a component in the architecture design document; designing a corresponding detailed design document based on the core class diagram.
3. A terminal for software design and development, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the following steps: generating an architecture design document according to software requirements, generating a corresponding detailed design document based on the architecture design document, the detailed design document comprising a core class diagram defined in structured data form; generating corresponding core class code according to the core class diagram of the detailed design document, and developing engineering code based on the core class code; judging whether the engineering code matches the core class in the detailed design document, if yes, submitting the engineering code to a code repository, otherwise, re-generating a core class diagram and corresponding detailed design document and architecture design document based on the engineering code; the step of judging whether the engineering code matches the core class in the detailed design document comprises: intercepting the engineering code submitted to the code repository; judging whether the core class in the detailed design document exists in the engineering code and whether the dependency relationship of the core class matches the detailed design document; the step of re-generating the core class diagram and corresponding detailed design document and architecture design document comprises: judging whether the re-generated detailed design document and architecture design document can pass the audit, if yes, updating and synchronizing the re-generated detailed design document and architecture design document, otherwise, performing abnormal alarm; The performing of the abnormal alarm comprises: determining whether the abnormal alarm is a naming inconsistency or an intermediate dependency is added in the original dependency relationship, if yes, then the name and the association relationship of the core class are sorted out, otherwise, the engineering code is modified according to the detailed design document and the architecture design document.
4. The software design and development terminal of claim 3, wherein, The generating of the corresponding detailed design document based on the architecture design document comprises: generating a core class diagram corresponding to the components in the architecture design document; designing the corresponding detailed design document based on the core class diagram.
Citation Information
Patent Citations
Design-mode-guided Java code reviewing method
CN103279631A
Method and apparatus for generating code framework
CN106528168A
Method, device and system for generating code documents in continuous integration
CN107256160A