Monday, June 9, 2014
Check out this very interesting talk by Mishio Katu about how technology will revoluzionize our lifes.
Saturday, May 17, 2014
Nice talk about unit testing and smells by Gerard Meszaros.
Wednesday, July 17, 2013
Global state (and singletons) is a big problem for testing because the global state cannot be controlled by the tests.
Dependency injection enforces the order of initialization at compile time. No magic behind the scene, that singletons get initialized and method talk to each other without the programmer knowing it.
Sunday, July 7, 2013
The constructor should have the objects you need as arguments. Don't use locator (object through which you get the object you actually need). In a test like this it is a lot easier to construct! You can just construct the objects needed. You don't need to construct the locator first and then reach in the locator to get the object you actually need.
--> This is law of demeter. Don't pass around objects you don't need. You don't want to know about objects you don't need.
DO this:public House(Door door, Window window)
_door = door;
_window = window;
NOT this:public House(Locator locator)
_door = locator.getDoor();
_window = locator.getWindow();
Wednesday, July 3, 2013
He says something brilliant:
There is no secret to writing tests...
... there are only secrets to writing testable code!
Unit Tests require a separation of instantiation of the object graph from the business logic.
- do not use new(...) in the business logic. Use Factories.
- do not use global variables/state
- no static methods
Sunday, June 23, 2013
Recently I found these videos about writing testable code and found them very helpful.
Sunday, March 31, 2013
Saturday, March 30, 2013
Nice presentation he had at google:
Wednesday, March 27, 2013
Thursday, February 28, 2013