> For the complete documentation index, see [llms.txt](https://jimmylv.gitbook.io/tdd-frontend/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jimmylv.gitbook.io/tdd-frontend/coding/00-project-fizzbuzz/03-project-analysis.md).

# FizzBuzz 项目剖析

的确，FizzBuzz 是一个非常简单的题目。看完这道题，有工作经验的程序员恐怕会露出鄙夷的神情 ─━ \_ ─━✧。“这种编程初级班的题目，还能玩出什么花？”

关键在**速度**上。你能用多快的速度完成这道题？

* 据我们的观察，行业里平均水平大约需要 1 小时。很多优秀的程序员能在 15 分钟内完成。
* Michael Feathers（他是《修改代码的艺术》一书的作者）和 Emily Bache 在 Agile2008 大会上用了 4 分钟完成。
* 翻译《重构》第二版的林从羽老师，在写 FizzBuzz 的计算逻辑部分的时候，只用了 1 分 15 秒。

你可以赏析一下，他快在什么地方吧？

[![](/files/-M1ictY2f7L0K7RG4aPk)](https://github.com/JimmyLv/tdd-frontend/tree/d820c2162f278476e9d5f0543895a35cd6efd73d/articles/fizzbuzz/videos/lcy-tdd-fizzbuzz.mp4)

提问：从这个短短的视频，除了速度，你还看到了些什么？

达到这样的编程速度，需要对自己使用的工具非常熟悉、对自己要解决的问题想得非常清楚。

这就是我们要练的基本功。

![](/files/-M1kJRNTKphhHRGEkoTr)

## 技能要求

让我们重申一下这个项目的要求，这就是你练习的目标：

1. 熟悉 IDE 的快捷键操作
2. 使用 Jest 编写单元测试
3. 使用 Testing Library 编写组件测试
4. 编写失败的测试，驱动出产品代码
5. 充分利用代码生成 (live template)
6. 刻意练习的节奏！

## 任务拆解

本项目分为个任务：

1. TDD 初体验
2. 利其器，整理工作环境
3. 刻意练习，再撸一遍


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://jimmylv.gitbook.io/tdd-frontend/coding/00-project-fizzbuzz/03-project-analysis.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
