TDD was created by Kent Beck in 2003 as part of Extreme Programming. There are three rules of TDD: 1) you cannot write production code without failing a unit test, 2) unit tests should only contain the minimum code to fail, and 3) only write enough production code to pass a single failing test. TDD improves code quality by promoting principles like YAGNI, KISS, and SOLID. It also provides a safety net for refactoring and fast feedback. TDD helps improve testability by making all code testable by default and creating granular, predictable, and easy to read unit tests.