Detailed design is an important part of V model or waterfall development. This stage is responsible for refining the outline design andCodeWrite instructions. It can be said that it is an important link to link up and down.
But is the actual situation true? Let's review:
(1) how close is the detailed design and code?
In the project, if the detailed design is not modified after the code is modified and submitted after the test, the detailed design does not match the code, and the matching degree is very low to a large extent.
If the detailed design does not match the final code, such a detailed design will not be helpful for future maintenance.
If the detailed design does not help the future, why should we write it?
Because -- the detailed design is used to guide code writing.
(2) What is the guiding significance of detailed design for code?
A detailed class diagram is used to define the relationship between class frameworks. The sequence diagram (sometimes using a flowchart) is used to define the call relationship between methods.
If the detailed design is defined in this way, why not use ide to write code directly?
Because the detailed design process requires a document for future reference.
(3) How is the detailed design reviewed and modified?
The detailed design review is performed by reading and reviewing the detailed design documents that have been written, and identifying possible errors and omissions.
Then, modify the question until the modification is completed.
Why should we review and modify it like this? Because the quality improvement of detailed design helps to identify problems in the early stage.
(4) Since the detailed design is used to guide code writing, why do we need further tests?
In other words, the detailed design cannot be 100% correct.
This does not require that the detailed design 100% be correctly written-because this is an impossible task.
The detailed design is a process of conjecture, and its review and modification are also completed in speculation.
What exactly is the detailed design designed to guide code writing more effectively?
(5) How is the completion of the detailed design defined?
The detailed design completion indicator is: the detailed design page number reaches several pages, each page review found the number of problems.
The detailed design is used to guide code writing. Why not define indicators from the aspect of guiding code writing?
How can I start code writing when there are issues with detailed design?
The reality is that the completion of the detailed design is determined by the preference of the Project Manager, which is often determined by the time pressure. If there is time to continue writing, it can be completed if there is no time.
(6) Why do you think detailed design is a necessary process?
Because it is required. Because everyone else does this. Isn't that the answer?
So how should we write the detailed design? The answer is: no! The reasons are as follows:
(1) Unclear responsibilities of the detailed design
The detailed design name outlines the detailed design and guides the code writing. On the other hand, the end time of the stage is unclear, and the criteria for determining the end of the stage are not defined on how to guide code writing, it is hard to say whether the detailed design is used to guide code writing or refine the outline design.
(2) Detailed design does not produce valuable products.
According to statistics, the detailed design consumes half of the coding and unit testing time in the project development process. However, the product-UML diagram can be generated by Directly Writing code and exporting it from ide. This process takes only a few seconds.
But the detailed design still needs to be done. Isn't that a conflict with the previous one? No!
The above isWriteIn this exampleDo.
There are many processing conditions, which are not clear in a few words. At this time, we need to design them in detail.
For example, a processing rule is determined by two sets of conditions. From the perspective of demand, you can clearly describe the behavior under the combination of conditions by drawing a two‑dimensional table.
A B C
1 A1 B1 C1
2 A2 B2 C2
3 A3 B3 C3
In this case, if you write a flowchart, the code will also be written according to the flowchart, and the code will become very lengthy. Therefore, the flowchart is not suitable for detailed design. In this case, you can write the class.
Assume that the row condition is a time range (timescript), representing the past (past), present (present), and future (future), respectively)
The column conditions are state, which respectively indicate apply, approval, and decline)
In the design of the class, the time range is used as the main axis, and the status is used as the auxiliary axis. The class is defined:
Interface timescript {
Public void apply ();
Public void approval ();
Public voi decline ();
}
Then, past, present, and future implement the corresponding methods respectively to implement the matrix defined above.
This method is called Bridge pattern)
This process does not need to be documented.
In most cases, code can be directly generated as needed.
The detailed design is a process that can be simplified to just a few minutes. In addition, there is no loss in terms of quality.
Imagine how much savings a project can save if it can omit the detailed design process.
What if the customer has to ask for a detailed design?
Employ document engineers who are cheaper than software engineers to reverse-write detailed designs based on code-Because class diagrams can be generated using tools-so there are very few people who need documents and work hours.