Entries Tagged as 'Uncategorized'

Yet Another JavaScript Testing Framework

May 22nd, 2009 · 34 Comments

by Miško Hevery & Jeremie Lenfant-engelmann Did you notice that there are a lot of JavaScript testing frameworks out there? Why has the JavaScript community not consolidated on a single JavaScript framework the way Java has on JUnit. My feeling is that all of these frameworks are good at something but none solve the complete package. Here [...]

Tags: Uncategorized

How do you convince your boss to TDD

May 16th, 2009 · 11 Comments

A reader asks: My boss knows about TDD but won’t allow us to use it because he thinks that it is just a passing hype that everyone talks about but no serious, big projects actually use it on daily basis. How could I convince him that it is not so? This is an excellent question [...]

Tags: Uncategorized

Configure your IDE to run your tests automatically

May 7th, 2009 · 19 Comments

When I develop code I write test first and always run my tests. But it can get rather tedious to run the tests manually every so often. Here is a common scenario. Your tests are green and you start doing whole bunch of refactorings which you think are trivial and safe. When you are done [...]

Tags: Uncategorized

The Problem With Active Record

May 5th, 2009 · 21 Comments

By John Januszczak The Active Record pattern has gained a lot of attention lately, particularly because of it’s use in the wildly popular Ruby On Rails (“RoR’) framework. Other frameworks which employ the Active Record pattern include the Castle Project, which aims to simplify the creation of enterprise and web applications for .NET developers. If you are new to [...]

Tags: Uncategorized

Managing Object Lifetimes

April 15th, 2009 · 13 Comments

There is a myth out there that creating objects is expensive. The result of this is that a lot of applications have objects whose lifetime is too long. Let’s take a web app for example. Most web-apps I have seen have too many long lived objects and not enough request scope objects, which has implication [...]

Tags: Uncategorized

How to do Everything Wrong with Servlets

April 8th, 2009 · 9 Comments

When I interview people I often ask them what an evil developer would do to make his code hard to test. Servlets are a great example of what to do if you want it to be hard to test Lets start with constructor. Constructor is the first thing I look at since it tells me [...]

Tags: Uncategorized

Collaborator vs. the Factory

March 30th, 2009 · 11 Comments

by Miško Hevery I have already hinted that your code should either be in the business of doing business logic or in the business of instantiating and wiring other objects together. What this effectively means is that your either have classes with ifs and loops (your business logic) or you have classes with new operators (your [...]

Tags: Uncategorized

Design for Testability and “Domain-Driven Design”

March 16th, 2009 · 5 Comments

Dave Gladfelter has written a great question which I think a lot of people may be asking an therefore I am sharing the letter with the answers here… Misko,Thanks for all your interesting posts on testability.  I’ve been using DI and other techniques for some time for both testability and for maintainability and readability, but you’ve helped [...]

Tags: Uncategorized

Guide to testability is now downloadable

March 9th, 2009 · 5 Comments

Guide to testability is now downloadable thanks to Blaine R Southam who has turned it into a pdf book. Permanent link can be found from this page: http://misko.hevery.com/code-reviewers-guide/

Tags: Uncategorized

Constructor Injection vs. Setter Injection

February 19th, 2009 · 31 Comments

by Miško Hevery There seems to be two camps in dependency-injection: (1) The constructor-injection camp and (2) the setter-injection camp. Historically the setter-injection camp come from spring, whereas constructor-injection camp are from pico-container and GUICE. But lets leave the history behind and explore the differences in the strategies. Setter-Injection The basic-ideas is that you have a no argument-constructor which creates [...]

Tags: Uncategorized