|
所在平台: Udemy |
课程主页: https://www.udemy.com/course/building-apis-doing-outside-in-tdd-in-node-and-typescript/
课程评论:没有评论
课程名称:使用 Node 和 TypeScript 进行外部驱动的 API 构建 摘要: 本课程将指导您使用 Node.js、Express 和 TypeScript 构建一个 RESTful API。数据将通过 Mongoose 存储在 MongoDB 数据库中。课程的核心是利用 OpenAPI Specification (OAS) 文件作为蓝图来设计和实现 API。 课程将模拟“一次性秘密”网站的功能,创建一个可以存储秘密并提供一次性访问 URL 的应用程序。再次访问同一 URL 将会产生错误。 课程采用“外部驱动开发”(Outside-In TDD),也称为 Mockist 方法或伦敦学派 TDD。教学将从编写验收标准测试开始(处于失败状态),然后通过单元测试逐步构建内部组件,以满足验收标准。这种方式将从应用外部开始,一层一层地向内开发,直到最终实现验收测试全部通过。 在开发过程中,虽然有清晰的应用设计方向,但课程还将借鉴领域驱动设计 (DDD)、六边形架构 (Hexagonal Architecture) 和命令查询责任分离 (CQRS) 等设计理念。 特别鸣谢:感谢 @Panos 提供的宝贵反馈,使本课程更加完善。
In this course we will implement a REST API in Node with express and typescript. We will store data in a mongodb database using mongoose. In order to implement this REST API, we will receive an OpenAPI Specification (OAS) file that will be the base to design and build our application.The API we are going to build is a clone of the One Time Secret site. We will create an application that stores our secrets and provides us a URL to access them later, but with the condition that we can access that URL one time only. Whenever we attempt to retrieve the same secret again, hitting the same URL for a second time, we will receive an error.Given that we already know how the public interface would look like with the OpenAPI Specification file provided, we will be using Test Driven Development (TDD) but following an Outside-In approach, also known as mockist approach or London School TDD. We will start writing the acceptance criteria tests, keeping them in red, we will start the double cycle and write unit tests for the inner components. That way we will build our way inside the application, one level at a time until we can make the acceptance test completely pass. While coding, even though we already have a quite clear direction of our application design, we will try to get inspired with DDD, Hexagonal Architecture and CQRS.Kudos to @Panos for the constructive feedback that helped to make this course better.