- Test-Driven Java Development(Second Edition)
- Alex Garcia Viktor Farcic
- 236字
- 2021-06-24 18:31:50
Red-Green-Refactor – From Failure Through Success until Perfection
The Red-Green-Refactor technique is the basis of test-driven development (TDD). It is a game of ping pong in which we are switching between tests and implementation code at great speed. We'll fail, then we'll succeed, and, finally, we'll improve.
We'll develop a Tic-Tac-Toe game by going through each requirement one at a time. We'll write a test and see if it fails. Then, we'll write code that implements that test, run all the tests, and see them succeed. Finally, we'll refactor the code and try to make it better. This process will be repeated many times until all the requirements are successfully implemented.
We'll start by setting up the environment with Gradle and JUnit. Then, we'll go a bit deeper into the Red-Green-Refactor process. Once we're ready with the setup and theory, we'll go through the high-level requirements of the application.
With everything set, we'll dive right into the code—one requirement at a time. Once everything is done, we'll take a look at the code coverage and decide whether it is acceptable or whether more tests need to be added.
The following topics will be covered in this chapter:
- Setting up the environment with Gradle and JUnit
- The Red-Green-Refactor process
- Tic-Tac-Toe's requirements
- Developing Tic-Tac-Toe
- Code coverage
- More exercises
- 程序員面試筆試寶典(第3版)
- Python 3.7網絡爬蟲快速入門
- 自制編譯器
- PaaS程序設計
- C語言程序設計基礎與實驗指導
- Dependency Injection in .NET Core 2.0
- Visual Basic程序設計上機實驗教程
- 深入實踐Kotlin元編程
- 機器學習微積分一本通(Python版)
- Visual Basic程序設計基礎
- Python編程基礎教程
- Hands-On Dependency Injection in Go
- Web前端測試與集成:Jasmine/Selenium/Protractor/Jenkins的最佳實踐
- Java EE實用教程
- Mastering R for Quantitative Finance