Stubs are used in top-down integration testing to simulate functionality of undeveloped modules. Drivers are used in bottom-up testing to test modules by calling them and returning values. Stubs provide dummy code to allow testing of dependent modules before completion. Drivers act as the caller for modules under test, allowing testing without complete dependencies. Stubs and drivers allow testing modules in isolation before full system development.