## Unit Testing Unit testing is a method of testing where individual units of source code—such as functions, methods, or classes—are tested to determine if they work correctly. Unit tests are usually written and maintained by developers and are meant to ensure that individual sections of code are working as expected. Unit testing is a part of the Test-Driven Development (TDD) process, but it can also be used independently. In TDD, tests are written before the code and drive the design of the code. In unit testing (outside of TDD), tests are often written after the code to ensure that the code works as expected.