Software Engineering—Chapter 5 Overall Design Knowledge Points Arrangement

This column is the blogger's personal notes, the main purpose is to use the fragmented time to memorize the knowledge points of soft engineering, hereby declare!

Article directory

1. What is the basic purpose of the overall design?

2. The overall design task?

3. What are the two phases of the overall design process?

4. The steps of the overall design?

5. Write a document to record the results of the overall design. What is the content of the document?

6. What is the data flow-oriented design method?

7. What principles does the overall design follow?

8. What is modularity?

9. What are the benefits of modularization?

10. What is abstraction? How does it relate to the software engineering process?

11. What is stepwise refinement?

12. What is module independence?

13. Why is module independence important?

14. What is coupling?

15. What is cohesion?

16. What is the criterion for the pursuit of coupling and cohesion in software development?

17. Sort the degree of coupling from low to high? and give examples

18. Sort the degree of cohesion from high to low? And give examples respectively?

19. What are the heuristic rules?

20. What are the scope and control domain of a module?

21. What are depth, width, fan-in, and fan-out?

22. What is the difference between the meanings represented by the lines in the hierarchical diagram and the hierarchical block diagram?

23. Which design software is suitable for hierarchical diagrams to be used in the process?

24. What is the meaning of the symbols in the structure diagram?

25. Can hierarchical diagrams and structural diagrams represent the calling order between modules?

26. What is the goal of the data flow-oriented design method? What does the information flow include?

27. Is developing a test plan the same as designing test cases? Why

28. The necessity of overall design?

Summary at the end of the chapter


1. What is the basic purpose of the overall design?

The overall design is also called the outline design or preliminary design , which mainly answers the question of " in a nutshell, how should the system be implemented "

2. The overall design task?

  1. Through this phase of work, the physical elements that make up the system are demarcated
  2. Design the structure of the software , determine which modules each program in the system is composed of, and the relationship between modules

3. What are the two phases of the overall design process?

System design phase, structure design phase

4. The steps of the overall design?

  1. imagine alternatives
  2. choose a reasonable solution
  3. Recommend the best solution
  4. Functional decomposition
  5. Design software structure
  6. design database
  7. Create a test plan
  8. write documents
  9. review and review

5. Write a document to record the results of the overall design. What is the content of the document?

  1. instructions
  2. user manual
  3. Test Plan
  4. detailed implementation plan
  5. Database Design Results

6. What is the data flow-oriented design method?

        The data flow diagram obtained in the requirements analysis stage is an excellent starting point for the overall design . If the data flow diagram has been refined to an appropriate level, the software structure can be mapped directly from the data flow diagram . This is the data flow-oriented design method.

7. What principles does the overall design follow?

  1. Modular
  2. abstract
  3. progressive refinement
  4. Information Hiding and Localization
  5. module independent

8. What is modularity?

        Modularization is to divide the program into independently named and independently accessible modules, each module completes a sub-function , and these modules are integrated to form a whole, which can complete the specified functions to meet the needs of users.

9. What are the benefits of modularization?

  1. Using the principle of modularization can make the software structure clearer , not only easy to design but also easy to read and understand
  2. Make software easy to test and debug
  3. Helps improve software reliability
  4. Helps improve software modifiability
  5. Contributes to organizational management of development projects

10. What is abstraction? How does it relate to the software engineering process?

Abstraction refers to extracting the essential characteristics of things without considering their details for the time being

Each step in the software engineering process is a refinement of the abstraction level of the software solution

11. What is stepwise refinement?

        Gradual refinement refers to "delaying the consideration of the details of the problem as much as possible in order to concentrate on solving the main problem ". It is the basic method used by human beings to solve complex problems, and it is also the basis of many software engineering techniques. Refinement is actually a process of refinement , and abstraction and refinement are a pair of complementary concepts.

[Note] Stepwise solving can be thought of as a technique for prioritizing the various problems that must be solved in a period of time

12. What is module independence?

The concept of module independence is a direct consequence of the concepts of modularity, abstraction, information hiding, and localization

13. Why is module independence important?

  1. Effective modular software is relatively easy to develop
  2. Independent modules are easier to test and maintain

14. What is coupling?

        Coupling is a measure of how closely different modules depend on each other . The strength of the coupling depends on the complexity of the interfaces between modules , the points of entry or access to a module, and the data passing through the interfaces.

15. What is cohesion?

Cohesion is a measure of how closely the elements of a module are combined with each other

16. What is the criterion for the pursuit of coupling and cohesion in software development?

The development of software pursues the principle of " low coupling and high cohesion ". Practice shows that cohesion is more important

17. Sort the degree of coupling from low to high? and give examples

  1. Data coupling : Two modules exchange information through parameters, and the exchanged information is only data. For example: two modules, the operation result of module A is passed as a parameter to module B to participate in the calculation
  2. Control coupling : There is control information in the transmission information, and the proper decomposition of modules by control coupling can be replaced by data coupling. For example: the coupling between the air conditioner remote control module and the air conditioner external unit module
  3. Feature coupling : pass the entire data structure as a parameter, and the called module only uses some of its elements. For example: one system needs ID card information, and the other only needs name information, but if the entire user information is passed in, feature coupling will occur
  4. Common Environment Coupling : Two or more modules interact through a common data environment. For example: Multiple modules share a global array, which can be read and written by different modules
  5. Content coupling : If a module is related to the internal properties of another module, directly using the program code or internal data of another module without calling is called content coupling. To resolutely avoid, such as GOTO statement.

[Note 1] No connection coupling has the lowest degree of coupling, but it is almost impossible to achieve

[Note 2] Design principles: Use data coupling as much as possible, use less control coupling and feature coupling, limit the scope of announcement environment coupling, and completely avoid content coupling

18. Sort the degree of cohesion from high to low? And give examples respectively?

  1. Functional cohesion : All processing elements in a module belong to a whole and complete a single function. For example: all operations in a module are to calculate a person's age
  2. Sequential cohesion : The processing elements in a module are closely related to the same function, and the processing must be executed sequentially. For example: To calculate the average score of grades, you must first enter all the grades, calculate the total score, and then do division to calculate the average score. The output of the calculation of the total score is used as the input of the calculation of the average score, and there is necessary data transmission, which limits the sequence relationship.
  3. Communication cohesion : All elements in a module use the same input data and/or produce the same output data. For example: There is a subroutine responsible for processing the input information to produce reports, and at the same time updating the existing data with the input data, and the two operations use the same data source.
  4. Process cohesion : Processing elements within a module are related and must be executed in a specific order. For example: To calculate the average grades of each class, it is required to output the grades of class 123 in order.
  5. Temporal aggregation : tasks contained in a module must be executed within the same period of time. For example: put the initialization of multiple variables in the same module.
  6. Logical cohesion : The tasks accomplished by a module logically belong to the same or similar category. For example: a module produces various types of output, printing numbers, printing names, printing arrays, etc., their functions are all printing output information, and the functions are the same.
  7. Accidental cohesion : A module completes a set of tasks, and even if the tasks are related to each other, the relationship is very loose. For example: there are n statements in module A, but these statements have no relationship with each other.

19. What are the heuristic rules?

  1. Improve software structure and improve module independence
  2. Module size should be moderate
  3. Depth, width, fan-in, fan-out should all be appropriate
  4. Module scope should be within the control scope
  5. Strive to reduce the complexity of the module interface
  6. Design single-entry and single-exit modules
  7. Module functionality should be predictable

20. What are the scope and control domain of a module?

Scope : the set of all modules affected by a predicate within that module

Control domain : the module itself and the collection of all modules directly or subordinate to it

 [Note] The above figure is an example, the control domain of module A is A, B, C, D, E, F

21. What are depth, width, fan-in, and fan-out?

  1. Depth: Indicates the number of layers of control in the software structure , which often roughly indicates the size and complexity of a system
  2. Width: Indicates the maximum value of the total number of modules on the same level within the software structure . In general, the larger the width, the more complex the system. The factor that most affects the width is the fan-out of the module
  3. Fan-out: Indicates the number of modules that a module directly controls (calls) . The average fan-out of a good system is 3~4
  4. Fan-in: Indicates how many upper-level modules call it , fan-in multi-surface, the module is called more times, it is better

22. What is the difference between the meanings represented by the lines in the hierarchical diagram and the hierarchical block diagram?

The connection line in the hierarchical diagram represents the call relationship , while the connection line in the hierarchical block diagram represents the composition relationship

 

 [Note] The second picture is a hierarchical block diagram, which is analyzed from the perspective of entities , while the hierarchical diagram is analyzed from the perspective of functions

23. Which design software is suitable for hierarchical diagrams to be used in the process?

top down

24. What is the meaning of the symbols in the structure diagram?

Structure diagrams are another powerful tool for software design

A box represents a module, the arrows between them represent the module calling relationship , and the annotated arrows represent the messages passed back and forth during the module calling process

25. Can hierarchical diagrams and structural diagrams represent the calling order between modules?

        Hierarchical diagrams and structural diagrams cannot strictly represent the calling order between modules. They do not indicate when to call the lower-level modules, but only indicate which modules a module calls.

26. What is the goal of the data flow-oriented design method? What does the information flow include?

The goal of a dataflow-oriented design approach is to give a systematic approach to designing software structures

Information flow includes transformation flow and transaction flow

27. Is developing a test plan the same as designing test cases? Why

        The two are different , because the test plan is formulated in the overall design stage, but there is no specific code implementation at this time , so it is impossible to write each test case specifically.

28. The necessity of overall design?

        It is possible to stand at a global level , spend less cost, analyze and compare multiple possible system implementation schemes and software structures from a more abstract level, and select the best scheme and the most reasonable software structure from them , so as to use a relatively low cost Develop a higher quality software system.

Summary at the end of the chapter

        The basic purpose of the overall design phase is to determine how the system completes the predetermined tasks in a more abstract and general way , that is to say: the physical configuration scheme of the system should be determined, and then the structure of each program that makes up the system should be determined. Therefore, the overall design phase is mainly composed of two small phases. First of all, it is necessary to carry out system design . Starting from the data flow diagram, imagine several reasonable physical schemes to complete the system functions. Analysts should carefully analyze and compare these schemes, and jointly select an optimal scheme with users. Then, the software structure design is carried out to determine which modules the software consists of and the dynamic calling relationship between these modules. Hierarchy diagrams and structure diagrams are common tools for depicting software structures. The most important principle
        that should be followed in the design of software structure is the principle of module independence , that is to say, the software should be composed of a group of modules that complete relatively independent sub-functions, and the interface relationship between these modules should be as simple as possible.         Abstraction and refinement are a pair of complementary concepts, and they are also the most commonly used and effective methods for human beings to solve complex problems. An effective method in software structure design is to construct a software hierarchy from abstraction to concrete.

        Software engineers have accumulated a wealth of experience in the long-term practice of developing software, summing up these experiences to draw some very valuable heuristic rules, which can often give valuable hints on how to improve software design. In the process of software development, we should not only pay full attention to and make use of these heuristic rules, but also avoid copying them mechanically from the actual situation .

        Top-down step-by-step refinement is a common approach to software structure design; however, if you already have a detailed data flow diagram, you can also use the data flow-oriented design method to map out the software from the data flow diagram in a formalized way. structure . It should be remembered that what is mapped out in this way is only the preliminary structure  of the software, and the preliminary structure of the software must be carefully analyzed and improved based on the design principles and referring to the heuristic rules to obtain higher quality modules and a more reasonable software structure.
        Before carrying out detailed process design and programming, the advantage of structural design is that the software structure can be optimized at a global level in the early stage of software development. Optimizing during this period is inexpensive and can result in significant improvements in software quality .

Next chapter: Software Engineering—Chapter 6 Detailed Design Knowledge Points Arrangement

 Repeatedly, down-to-earth; never forgetting, there will be echoes!

Guess you like

Origin blog.csdn.net/qq_52487066/article/details/131362367