38: J.B. Rainsberger - Unit Testability and the Universal Architecture

why you don’t want to mock stuff you don’t own

example: ResultSet, so many methods :o

or HttpSession or ServletRequest: getParameter and getParameterMap

reason to do TDD: not because we want to test, but because we want to use tests to give feedback on the quality of our design.

why do we want feedback on quality of our design? because we want to improve our design.

if we get feedback, we are better prepared to change our design in response on that feedback

and also thanks to those tests, we can change the design

we’re not able to change ResultSet or HttpSession

only when building little adapters/bridges and change it to smthing we want to use, we can do this

not testing the very last layer of our stuff to the very first layer of their stuff!

arrows never out of happy zone!!!

related: Matteo Vaccari - How I learned to love mocks