Using Docker for testing can help address many of the common pain points in testing such as inconsistent environments, complex integration testing, and failed tests polluting environments. Docker allows each component like the web server, application server, and database to be containerized so that the full application and environment can be quickly deployed for testing purposes. Integration tests can also be containerized in Docker images and run as part of an automated nightly build pipeline using tools like Jenkins to help ensure continuous integration of the tests and application.