Mocking is a technique that can be used when writing unit tests to stub out dependencies on external components (such as databases or web services). This allows you to focus on testing the functionality of the unit under test without having to worry about the behavior of its dependencies.