If you're instantiating a class inside another class, using a factory is a great way to gain more control over being able to unit test that class
unit vs integration test: unit is a more isolated testing environment where all dependencies are stubbed/mocked, and integration tests, by definition, is any test where not all dependencies are stubbed/mocked
Drafting up architecture first can really help prevent having to constantly think about design decisions down the road Similar take away from the inverted pendulum project (a CAD model up front would have significantly reduced time and stress trying to constantly on the fly make parts work with each other)