por Carlos Ble | Apr 7, 2013 | Agile, Clean code, DDD
Value objects can contain methods. Otherwise they are just anemic models. Those methods prevent the feature envy code smell and ease refactoring. They manipulate object internals promoting cohesion and low coupling. But don’t forget about the Open/Closed...
por Carlos Ble | Apr 7, 2013 | Agile, Clean code, DDD, Test Driven Development
Writing quality code is about satisfying the expectations of the reader. And the reader might be yourself a couple of months later. Let me tell you a mistake a made recently. I was test-driving a few classes and one collaborator was a stack. But I only needed the...
por Carlos Ble | Apr 7, 2013 | Agile, JavaScript, Test Driven Development
JavaScript object literals are very handy, they are just key-value pairs. Very convenient to implement dictionaries and also a very simple implementation of the Singleton pattern: var message = {sender: ‘bob’, body: ‘hello’}; Duck typing is a...
por Carlos Ble | Apr 5, 2013 | Agile, Test Driven Development, Testing
It’s been my first time attending to an event at Skills Matter and it’s been awesome 😀 Cukeup! is the annual conference about BDD and Cucumber. This was the third edition. Let me share with you the ideas I listened yesterday. The ideas and sentences...
por Carlos Ble | Mar 22, 2013 | JavaScript, Test Driven Development
Promises are a nice solution to write readable asynchronous code in JavaScript. If you understand Spanish, I highly recommend this great talk on Promises by Enrique Amodeo. But, is the code with promises easy to unit test? It’s not very difficult, you have to...