How to Write Effective Technical Documentation

adhi tanjung
6 min readDec 30, 2022

--

Photo by Henry & Co. on Unsplash

Introduction

A crucial component of any software project is technical documentation. It assists engineers, project managers, and other stakeholders in comprehending how the system functions and how to resolve potential problems. In this article, we’ll go over the essential elements of technical documentation and offer advice on how to create straightforward, succinct writing that’s simple to read and follow.

Stakeholders

  1. Engineers are the target audience for technical documentation because they are the main system designers and maintainers. It is crucial to give them thorough instructions on how the system operates and how to resolve any potential problems.
  2. Project managers, product owners, and system analysts are in charge of the general management and direction of the project. To make wise decisions and prioritize features, they must be aware of the technical specifics of the system. They can better understand the system and make defensible decisions with the assistance of technical documentation.

URL

In order to make it easy for stakeholders to access the system and its documentation, the system’s URL should be listed in the documentation.

System Overview

The documentation should contain a high-level overview of the system. This should outline the main elements and features of the system as well as its function. Users can create and manage their online stores using, for instance, the web-based XYZ system. Inventory management, order tracking, and product management are all included.

Getting Started

Installation and running the app should be clearly explained in the documentation. This should include step-by-step instructions for installing the system, as well as any necessary dependencies or configurations.

For example, to install the XYZ system, follow these steps:

  1. Download the latest version of the XYZ installer from the URL provided.
  2. Run the installer and follow the on-screen instructions to complete the installation.
  3. Once the installation is complete, launch the XYZ app from the start menu or desktop shortcut.

Code Formatter

Information on the system’s code formatter, including any applicable formatting options or parameters, should be included in the documentation.

For example, the XYZ system uses the JSON format for API requests and responses. The following options are available for formatting the data:

  • indent: specifies the number of spaces to use for indentation (default is 4).
  • sort_keys: specifies whether to sort the keys in the JSON data (default is False).

API Specification

A list of available endpoints and any relevant parameters or authentication requirements for the system’s API should be included in the documentation.

For example, the XYZ system has the following API endpoints available:

/products: returns a list of all products in the system.

Parameters:

  • limit: specifies the maximum number of products to return (default is 10).
  • offset: specifies the number of products to skip before returning results (default is 0).

/orders: returns a list of all orders in the system.

Parameters:

  • limit: specifies the maximum number of orders to return (default is 10).
  • offset: specifies the number of orders to skip before returning results (default is 0).
  • Authentication: requires a valid API key to access.

Database Schemas

Details on the system’s database(s), including a description of the schema(s) and any important data relationships, should be included in the documentation.

For example, the XYZ system uses a MySQL database to store product and order information. The following tables are included in the database:

Products: information on each product, including its name, price, and description.

Products table:

+------------+-----------------------------------+-------------+----------------+
| Column | Description | Data type | Example |
+------------+-----------------------------------+-------------+----------------+
| product_id | Unique identifier for the product.| int | 1 |
| name | Name of the product. | varchar(255)| "Product 1" |
| price | Price of the product. | decimal | 10.99 |
| description| Description of the product. | text | "This is a..." |
+------------+-----------------------------------+-------------+----------------+
Orders: stores information on each order, including the customer's name and shipping address.

Orders table:

+------------------+-----------------------------------------------+------------------+
| Column | Description | Data type |
+------------------+-----------------------------------------------+------------------+
| order_id | Unique identifier for the order. | int |
| customer_name | Name of the customer who placed the order. | varchar(255) |
| shipping_address | Address where the order will be shipped. | text |
+------------------+-----------------------------------------------+------------------+
Order Items: stores information on each item in an order, including the product_id and quantity.
Order_items table:

+----------------+---------------------------------------------------+-------------+
| Column | Description | Data type |
+----------------+---------------------------------------------------+-------------+
| order_item_id | Unique identifier for the ordered item. | int |
| order_id | Identifier for the order that the item belongs to.| int |
| product_id | Identifier for the product that is being ordered. | int |
| quantity | Number of units of the product being ordered. | int |
+----------------+---------------------------------------------------+-------------+

Code Examples

Code examples can be useful for illustrating key concepts or functionality in the documentation.

For example, the following code snippet shows how to retrieve a list of products from the XYZ API using the Go programming language:

package mainimport (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
apiKey := "abcdefghijklmnopqrstuvwxyz"
url := "https://api.xyz.com/v1/products?limit=10&offset=0"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", apiKey))
res, _ := http.DefaultClient.Do(req) defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(string(body))
}

This code snippet sends a GET request to the /products endpoint of the XYZ API with the limit and offset parameters specified. It also includes the API key in the Authorization header for authentication. The response from the API is then printed to the console.

Workflow

Information on the system’s workflow, including any relevant processes or steps, should be included in the documentation.

For example, the XYZ system has the following workflow for processing orders:

  1. A customer places an order through the website or API.
  2. The order is added to the orders table in the database.
  3. The order is sent to the fulfillment center for processing.
  4. The fulfillment center ships the order to the customer’s address.
  5. The order is marked as “shipped” in the database.

Techniques

The system’s use of any specialized methods or tools, such as machine learning or data analysis, should be documented.

For instance, the XYZ system analyzes customer data and suggests goods that customers might be interested in using machine learning algorithms. Details on how the algorithms function as well as how the data is prepared for analysis should be included in the documentation.

Deployment

The documentation must contain instructions for deploying the system, along with any dependencies or configurations that are required.

The XYZ system, for instance, could be set up with a cloud service like Amazon Web Services (AWS). Instructions on how to create an AWS account, a virtual machine instance, and the required dependencies and configuration for the system should all be included in the documentation.

Maintenance and Troubleshooting

Information on how to maintain and troubleshoot the system, including any common issues and their resolutions, should be included in the documentation. This can help engineers and other stakeholders resolve issues quickly and keep the system running smoothly.

The XYZ system, for instance, might have performance issues if the database grows too big or if there are too many concurrent users. The documentation should outline how to scale the system to handle increased traffic and improve database performance.

In the event of an error, the documentation should also include a list of common error messages and their potential causes, as well as steps for troubleshooting and resolving the issue.

Conclusion

Technical documentation that is up to par is crucial to any software project. It can reduce the time and effort spent on maintenance and troubleshooting while assisting stakeholders in understanding the system and making knowledgeable decisions. You can write succinct, clear documentation that is simple to understand by adhering to the tips provided in this article.

--

--