TDD (Test-Driven Development) is a development methodology in which tests are written before implementation code, repeating a short cycle of test failure (RED) → implementation (GREEN) → refactoring (Refactor).
## RED → GREEN → Refactor The TDD process is extremely simple. First, write a test that describes the expected behavior of the feature you are about to implement. The test will naturally fail (RED). Next, write the minimum amount of code needed to make the test pass (GREEN). Finally, clean up the code without changing its behavior (Refactor). Repeat these three steps in short cycles of a few to several tens of minutes. ## Tests as a Design Tool Viewing TDD as a "testing methodology" misses the point. By writing tests first, the interface of a function—its arguments and return values—is determined before implementation begins. Because the API is designed from the caller's perspective, poorly usable interfaces are less likely to emerge. Kent Beck's motivation for advocating TDD was not to improve test coverage, but to improve design quality. ## Distinguishing TDD from Unit Testing The majority of tests written in TDD are unit tests. However, TDD is a methodology about *when* to write tests, while unit testing is about the *scope* of what to test. Within a TDD cycle, you may write tests equivalent to functional tests, and you can also write unit tests without using TDD. ## Complementary Relationship with ATDD While ATDD verifies the correctness of business requirements from the outside, TDD builds up the correctness of internal implementation from the inside. For an overall project, the ideal is a two-layer structure in which ATDD defines the acceptance criteria, and TDD is used to implement the individual functions that satisfy those criteria.


ATDD (Acceptance Test-Driven Development) is a development methodology in which the entire team defines acceptance test criteria before development begins, automates those tests, and then proceeds with implementation.

Unit testing is a testing method that individually verifies the smallest units of a program, such as functions and methods. By replacing external dependencies with mocks, it allows for rapid validation of the target logic in isolation.

An evaluation method that systematically tests AI system vulnerabilities from an attacker's perspective to proactively identify safety risks.

What is PoC Development? From the Basics of Proof of Concept to Costs, Process, and How to Choose the Right Outsourcing Partner

Acceptance testing is a testing method that verifies whether developed features meet business requirements and user stories, from the perspective of the product owner and stakeholders.