R&D Management 15 min read

How DTDD Transformed API Documentation and Testing at DeWu: A Deep Dive

This article analyzes the challenges of fragmented API documentation workflows at DeWu, introduces the Document‑&‑Test‑Driven Development (DTDD) model, and details the architectural and procedural improvements—including data asset consolidation, multi‑level classification, mock services, and automated testing—that boosted documentation utilization and reduced development friction.

DeWu Technology
DeWu Technology
DeWu Technology
How DTDD Transformed API Documentation and Testing at DeWu: A Deep Dive

Current Situation

API documentation is a critical data asset for the company, carrying core business logic. As the business grew, the architecture became micro‑service‑oriented and digitalization advanced, making API development management the most important R&D link. DeWu currently uses two platforms: YApi for basic API management and Mooncake for zero‑intrusion, scenario‑based mock services.

Problems

Low utilization of API documentation resources due to over‑control, complex interactions, and chaotic categorization in YApi.

Inability to guarantee documentation quality because YApi lacks a final testing stage, causing mismatches after interface changes.

Fragmented development workflow: design, development/mock, integration, and acceptance involve backend, frontend/client, and testing teams across YApi, Mooncake, and test platforms.

Business Thinking

High‑quality APIs can dramatically improve team efficiency and reduce costs. To solve internal API flow and improve documentation usage and quality, two core principles were proposed: a document‑driven approach (servers publish specs and test cases, front‑end/client consume them) and a test‑driven approach (each iteration’s API docs must pass automated tests).

Solution: Document & Test Driven Development (DTDD)

The DTDD model closes the development loop by linking documentation, testing, and mock generation. Its main responsibilities are:

Consolidate API data assets : Classify and store API docs by business domain to create scalable value.

Test‑driven development : Sync automated test cases with the documentation platform to raise API delivery quality.

Data mock : Generate mock data from API definitions to speed up front‑end and client development.

Enrich documentation capabilities : Provide type conversion, interactive debugging, and scenario‑based mock features.

Reduce communication cost : Use message notifications and subscription mechanisms to lower noise.

Data Classification Governance

Original YApi project grouping and classification were chaotic. The team abandoned the old scheme and re‑grouped projects by stable business domains (RDC). Projects were assigned to the domain with the highest weighted presence, calculated from recent interface ownership.

// Business line a
weight_a = (80+60)/2 = 70
// Business line b
weight_b = (60+30)/2 = 45
// Business line c
weight_c = (10+0)/2 = 5
// Business line d
weight_d = (5+0)/2 = 2.5
// Business line e
weight_e = (10+0)/2 = 5

weight_a > weight_b > weight_c = weight_e > weight_d

This re‑classification yields clearer business attributes for each project and automatically selects the user's domain to reduce lookup cost.

Interface Classification Upgrade

YApi’s weak classification caused poor maintainability as the number of interfaces grew. The new solution provides multi‑level classification, batch re‑classification of existing data, and a flexible UI that lets users understand business capabilities of each API.

Improving Documentation Utilization

Document‑driven mock : One‑click mock generation based on field types (image, time, name, city, etc.).

Mock space isolation : Private and public mock scenes ensure data safety and isolation.

Multi‑scenario mock : Users can define custom scenarios (e.g., 404, payment success) and switch instantly.

Zero‑intrusion mock plugin : Chrome extension provides mock services without code changes.

Document‑driven debugging : Automatic generation of request URLs and parameters, multi‑environment configuration, token auto‑login, shared headers, and remote/local debugging modes.

Document conversion : Supports Schema, JSON, Raw types; converts required fields to optional in TypeScript; generates declarations for Java, Swift, Go, Kotlin, Dart, etc.

These enhancements doubled per‑person page views and increased usage duration by 23× compared with the legacy YApi.

Enhancing Interface Delivery Quality

DTDD’s test‑driven core syncs API docs to an automated test platform. Developers can view and run test cases directly in Mooncake, ensuring that interfaces meet quality standards before delivery.

Reducing Communication Overhead

Interface subscription : Users receive real‑time change notifications for subscribed APIs.

Version history : Historical versions are recorded for easy diff.

Group message notifications : Webhook‑based robot alerts on any doc change.

Lowering Platform Usage Difficulty

To make the platform more approachable, a toolchain was built:

Front‑end tools : Proxy SDKs and plugins for Webpack, Vite, Umi, and a Chrome extension.

Back‑end tools : IDEA plugin for non‑intrusive classification enforcement, Go CLI for uploading YAML docs, and a local debugging Chrome plugin to solve CORS issues.

Conclusion & Future Outlook

The DTDD exploration resulted in DeWu’s one‑stop documentation collaboration platform, Mooncake. The platform now supports basic API functions, testing, mock, and offers solutions for workflow management, rapid API generation, orchestration, and change tracking, aiming to reduce costs and drive business growth. Future plans include Dubbo protocol support, automated doc updates via code scanning, richer upstream dependency information, and API orchestration for business data assembly.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

testingMockDocumentationAPI ManagementR&D ProcessPlatform Integration
DeWu Technology
Written by

DeWu Technology

A platform for sharing and discussing tech knowledge, guiding you toward the cloud of technology.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.