by Carlos Ble | Jul 23, 2015 | Clean code, Test Driven Development, Testing
Among other qualities good tests should be easy to read, quick to understand. When the test requires complex data structures to be sent to the SUT or to be part of a stubbed answer, it takes longer to read. Moreover those structures use to evolve as the production...
by Carlos Ble | Jun 19, 2014 | JavaScript, Software Development, Testing
I am starting to work on a new project for a new customer, I’ll join the team for a couple of days or perhaps weeks. They have been spiking and eventually have decided they want to develop the front-end using Marionette.js a library on top of Backbone.js...
by Carlos Ble | Nov 24, 2013 | JavaScript, Test Driven Development, Testing
Many frameworks use the word “mock” for what in reality are “spies”. But that’s OK, the work “mock” in English covers actually all the possible test double types… However according to G. Meszaros, a mock object is a...
by Carlos Ble | Nov 14, 2013 | Testing
In general I prefer to wrap up system functions so that I can inject test doubles and test drive my designs easily. In general is not a good idea to mock objects you don’t own. But this time I was doing some research, preparing one edition of my Online Training...
by Carlos Ble | Oct 21, 2013 | Test Driven Development, Testing
No long ago in the Spanish TDD mailing list, some friends said they were struggling with test doubles. A typical question is how to use them to design collaboration a la test-first. Test doubles are something people find hard to understand in my TDD training courses....
by Carlos Ble | Oct 11, 2013 | JavaScript, pyDoubles, Test Driven Development, Testing
There are several good frameworks out there to create test doubles with JavaScript. Jasmine and Sinon provide test spies and stubs. JsMockito looks good too. However, creating your own API for test stubs is very easy. I’ve created mine as an exercise....