Project

General

Profile

Design Doc Template » History » Version 1

Misha Zatsman, 09/22/2014 06:06 PM

1 1 Misha Zatsman
{{>toc}}
2
3
_The first time you use this template, read through the entire document to understand how to use it._
4
5
_When designing a new system or component, copy this template and then replace the contents of each section with information about your project. Some sections may not be relevant to your project, in which case you should delete them._
6
7
_Each section contains italicized instructions explaining what belongs in that section. Many sections also contain example content in_ roman typeface.
8
9
_This introduction should be deleted (but not the table of contents markup above it)._
10
11
h1=. Design Doc Template
12
13
_Replace the previous line with the the title of your project or component and replace the following lines with your name(s), email and the date._
14
15
p>. *"Misha Zatsman":mailto:misha@curoverse.com
16
Last Updated: September 22, 2014*
17
18
h2. Overview
19
20
_Nothing goes here; all the content belongs in the subsections._
21
22
_You should complete these high-level sections first. If your design is elaborate, you may want to pause after these sections to wait for review comments before investing time into planning details that may get changed in the review._
23
24
h3. Objective
25
26
_In the objective section you should include a succinct 1-3 sentence statement of the objective of your project. It is also useful to state non-goals. Finally state who the intended audience for the document is._
27
28
A design document introduces a system or component to a fellow engineer. It should be written *before* implementing the system to aid in planning and to facilitate discussions about design decisions. After implementation, the design doc will serve as a reference for users, maintainers and anyone else interested in the system (and for that reason it is still useful to write design docs for systems that have already been written).
29
30
A design document is not a press release, a vision statement, a research report or a business plan.
31
32
The intended audience for this document is software engineers, but it should make sense to anyone familiar with software development.
33
34
h3. Background
35
36
_The background section should contain information the reader needs to know to understand the problem being solved. This can be a combination of text and links to other documents._
37
38
At Curoverse, we would like to do a better job documenting our software components. Our current documentation is located in:
39
* "our public wiki":https://arvados.org/projects/arvados/wiki/
40
* "our private wiki":https://arvados.org/projects/orvos-private/wiki/
41
* "other documents":http://doc.arvados.org/
42
43
Some Design Docs we've written are:
44
* [[Keep Design Doc]]
45
* [[Data Manger Design Doc]]
46
47
h3. Alternatives
48
49
_This section contains alternative solutions to the stated objective, as well as explanations for why they weren't used. In the planning stage, this section is useful for understanding the value added by the proposed solution. Once the system has been implemented, this section will inform readers of alternative solutions so they can find the best system to address their needs._
50
51
Some existing resources are available online:
52
53
* Guides to writing design docs:
54
** http://www.bitformation.com/art/writing_design_docs.html - This is a great guide which I think would complement this template well.
55
** http://blog.slickedit.com/2007/05/how-to-write-an-effective-design-document/ - Not quite as good (a little too focused on the author's template) but still makes some good points.
56
* Alternative doc templates:
57
** http://openacs.org/doc/filename.html - A great template, too specific to OpenACS for us, but still has some great ideas.
58
** http://www.bitformation.com/art/sample_sw_design_doc.html - Another good template, but more detailed than we're looking for.
59
* Examples of design docs:
60
** https://code.google.com/p/google-api-python-client/wiki/ClientDesignDocument
61
** http://www.chromium.org/developers/design-documents
62
63
h3. Tradeoffs
64
65
_What tradeoffs were made in this design and *why*. Types of tradeoffs can include: different approaches that could have been taken (e.g. storing data in memory/on disk/on network), or design decisions such as optimizing for latency vs throughput. The important part is to explain your reasoning for making the choice you did (or admitting if you felt the choice was arbitrary)._
66
67
Although a design doc takes time to write well, we believe the net result will save time for both the author and fellow engineers. Through writing a design doc, the author is forced to think through and receive feedback on design decisions, thus saving wasted implementation effort. Additionally, once the project is in use, the design doc serves as an overview to new users and a reference to all, reducing the time required for a user or maintainer to familiarize themselves with the system.
68
69
We have opted for a shorter format, with fewer sections than other templates, to reduce the pain to authors. In particular, to reduce the pain of redesigns, we have split our template into an [[Design_Doc_template#Overview|Overview]] section to reduce the amount of design required before an initial design review of larger systems.
70
71
h3. High Level Design
72
73
_A high-level description of the system. This is the most valuable section of the document and will probably receive the most attention. You should explain, at a high level, how your system will work. Don't get bogged down with details, those belong later in the document._
74
75
_A diagram showing how the major components communicate is very useful and a great way to start this section. If this system is intended to be a component in a larger system, a diagram showing how it fits in to the larger system will also be appreciated by your readers._
76
77
_Most diagrams will need to be updated over time as the design evolves, so please create your diagrams with a program that is easily (and freely) available and attach the diagram source to the document to make it easy for a future maintainer (who could be you) to update the diagrams along with the document._
78
79
h2. Specifics
80
81
_Nothing goes here; all the content belongs in the subsections._
82
83
h3. Detailed Design
84
85
_Designs that are too detailed for the above [[Design_Doc_Template#High-Level-Design|High Level Design]] section belong here. Anything that will require a day or more of work to implement, should be described here._
86
87
_This is a great place to put APIs, communication protocols, file formats and the like._
88
89
_It is important to include assumptions about what external systems will provide. For example if this system has a method that takes a user id as input, will your implementation assume that the user id is valid? Or if a method has a string parameter, does it assume that the parameter has been sanitized against injection attacks? Having such assumptions explicitly spelled out here before you start implementing increases the chances that misunderstandings will be caught by a reviewer before they lead to bugs or vulnerabilities. Please reference the external system's documentation justifying your assumption whenever possible (and if such documentation doesn't exist, ask the external system's author to document the behavior or at least confirm it in an email)._
90
91
_Here's an easy rule of thumb for deciding what to write here: Think of anything that would be a pain to change if you were requested to do so in a code review. If you put that implementation detail in here, you'll be less likely to be asked to change it once you've written all the code._
92
93
h3. Code Location
94
95
_The path of the source code in the repository._
96
97
h3. Testing Plan
98
99
_How you will verify the behavior of your system. Once the system is written, this section should be updated to reflect the current state of testing and future aspirations._
100
101
h3. Logging
102
103
_What your system will record and how._
104
105
h3. Debugging
106
107
_How users can debug interactions with your system. When designing a system it's important to think about what tools you can provide to make debugging problems easier. Sometimes it's unclear whether the problem is in your system at all, so a mechanism for isolating a particular interaction and examining it to see if your system behaved as expected is very valuable. Once a system is in use, this is a great place to put tips and recipes for debugging. If this section grows too large, the mechanisms can be summarized here and individual tips can be moved to another document._
108
109
h3. Caveats
110
111
_Gotchas, differences between the design and implementation, other potential stumbling blocks for users or maintainers, and their implications and workarounds. Unless something is known to be tricky ahead of time, this section will probably start out empty._
112
113
_Rather than deleting it, it's recommended that you keep this section with a simple place holder, since caveats will almost certainly appear down the road._
114
115
To be determined.
116
117
h3. Security Concerns
118
119
_This section should describe possible threats (denial of service, malicious requests, etc) and what, if anything, is being done to protect against them. Be sure to list concerns for which you don't have a solution or you believe don't need a solution. Security concerns that we don't need to worry about also belong here (e.g. we don't need to worry about denial of service attacks for this system because it only receives requests from the api server which already has DOS attack protections)._
120
121
h3. Open Questions and Risks
122
123
_This section should describe design questions that have not been decided yet, research that needs to be done and potential risks that could make make this system less effective or more difficult to implement._
124
125
_Some examples are: Should we communicate using TCP or UDP? How often do we expect our users to interrupt running jobs? This relies on an undocumented third-party API which may be turned off at any point._
126
127
_For each question you should include any relevant information you know. For risks you should include estimates of likelihood, cost if they occur and ideas for possible workarounds._
128
129
h3. Work Estimates
130
131
_Split the work into milestones that can be delivered, put them in the order that you think they should be done, and estimate roughly how much time you expect it each milestone to take. Ideally each milestone will take one week or less._
132
133
h3. Future Work
134
135
_Features you'd like to (or will need to) add but aren't required for the current release. This is a great place to speculate on potential features and performance improvements._
136
137
h3. Revision History
138
139
_The table below should record the major changes to this document. You don't need to add an entry for typo fixes, other small changes or changes before finishing the initial draft._
140
141
|_.Date            |_.Revisions Made |_.Author            |_.Reviewed By     |
142
| June 5, 2014 | Initial Draft         | Misha Zatsman |=. ----              |
143
| June 9, 2014 | Updated after comments         | Misha Zatsman | Tom Clegg, Tim Pierce              |