smallest unit in OOP is the class • use test doubles (mocks, stubs, spies, …) to replace dependencies note: • interfaces can’t be unit tested • abstract classes are difficult to test
something • test suite is a living behavior specification of the code • test suite is a living example of the usage of the code • the red-green-refactor flow tends to take you into the zone
id * * @param int $cartId * * @return Cart */ public function getById($cartId); /** * Persist a cart * * @param Cart $cart */ public function persist(Cart $cart); }
tests • access to the whole engagor setup • ran by Jenkins tests • mixture of unit tests and integration tests • access to the whole engagor setup • ran manually