Sign in
Log inSign up

Separation of Concerns and Unit Testing

Ben Goosman's photo
Ben Goosman
·Mar 24, 2020

Keeping related code together and unrelated code in other classes makes writing unit tests much easier. This is called SoC, or Separation of Concerns. By following SoC, one has more opportunity to mock class dependencies and simply verify the right functions are called, trusting that the dependency has its own unit tests.