Archive for the ‘TDD’ Category

Difference between Stubs ‘n’ Mocks

November 12th, 2010 by Magnus Ekstrand

As Martin Fowler states in his article Mocks Aren’t Stubs, mocks are often confused with stubs (or vice versa). It is understandable but there are some distinctions. A common interpretation is that stubs are static classes and mocks are dynamically generated classes by using some mocking framework. But the real difference between them is in the [...]

Posted in Java, TDD | No Comments »

My write-up on Software Craftsmanship 2010

October 8th, 2010 by Johannes Carlén

Yesterday I attended the Software Craftsmanshop 2010 conference held at the Bletchley Park Mansion. If you don’t know it already Bletchley Park is claimed to be the birthplace of modern computing with machines such as the Colossus decoder as well as the Turing-Welchman Bombe machine which cracked a massive amount of enigma codes during WW2. Really cool [...]

Posted in Agile, Software Craftsmanship, TDD | No Comments »

Mock an autowired bean

September 20th, 2010 by Annica Sunnman

Imagine a service implementation having autowired dependencies like:

@Service
@Transactional(rollbackFor=ServiceException.class)
public class ManageDrugServiceImpl implements ManageDrugService {
@Autowired
private DrugPrescriptionManager drugPrescriptionManager;
@Autowired
private UserDAO userDao;
@Autowired
private DrugDAO drugDao;
@Override
public List getNewDrugsForUser() throws ServiceException {…

To test this above service in isolation and mock each dependency is not hard. Create a setter method for each dependency [...]

Posted in Java EE, Open Source, TDD | 4 Comments »

Metamorphosis – The screwdriver turns into a nuclear plant

September 10th, 2009 by Björn Beskow

Continuous Integration servers have been around for quite a number of years. Mostly out of slentrian, I have stuck to CruiseControl since the alternatives (AntHill, Continuum, Hudsun, …) just haven’t been that much better to motivate me to switch.
I just attended Kuhsuke Kawaguchi’s Hudson presentation at JavaZone, and got quite a surprise. When I looked [...]

Posted in TDD | No Comments »

Grails Unit Testing in Eclipse

September 4th, 2009 by Björn Beskow

Groovy and Grails support have long been a sad story in Eclipse. Most notable, running and debugging Grails Unit tests in Eclipse has been quite painful, partly due to the fact that the Groovy eclipse plugin didn’t recognize the tests as being Unit tests (and hence the “Run as | Unit Test” has not been [...]

Posted in Dynamic languages, TDD | No Comments »

Yet another Mock framework

April 20th, 2008 by Björn Beskow

I have used EasyMock for Mock Object creation since version 1.0 in 2001. It has never been perfect, but good enough. The need to explicitly work with a separate Control object for every Mock object created was a pain, but that was changed in version 2.0. EasyMock is a decent Mock Object framework.
Still, in lectures [...]

Posted in Open Source, TDD | No Comments »

Unit Test Utilities for developers in a hurry

January 29th, 2008 by Björn Beskow

What do you get when you try to say “Unit Test” and “Utilities” very fast? Unitils, of course! This new Open Source project gathers most of the productivity utilities and refactorings of typical JUnit/DbUnit/EasyMock code that most projects develop for internal use, over and over again (Jan reported on some of them in his Cadec [...]

Posted in Open Source, TDD | No Comments »

Kodtäckning i Eclipse med EclEmma-pluginen (open source)

January 14th, 2007 by Håkan Dahl

EclEmma är en open-source plugin till Eclipse (>=3.1) som ger dig en snabb uppfattning om vilken kodtäckning din testkod ger.
EclEmma integrerar med JUnit-testrunnern i Eclipse och körs via “Coverage”-knappen i toolbaren eller från Run-menyns “Coverage”. Efter exekvering av ett test markeras kodrader i editorn med grönt (exekverad kod), gult (delvis exekverade kodrader) eller rött (ej [...]

Posted in TDD | No Comments »

Ant 1.7 och JUnit

January 10th, 2007 by Håkan Dahl

Ant 1.7 har släppts och noterbart är att JUnit-tasken har fått en välbehövlig uppryckning.
Till att börja med stödjs nu JUnit4 (som nu är snart ett år gammal) vilket gör att den tidigare stoppklossen som förhindrat uppgradering från JUnit 3.8.x är borta.
Till stor glädje har nu även ett stort irritationsmoment försvunnit:

junit.jar behöver inte längre ligga i [...]

Posted in Build automation, TDD | No Comments »

Automatiserade byggen med Pulse

December 18th, 2006 by Ola Deibitsch

Inom ramen för kontinuerlig integration så tampas flera aktörer om CM-ansvarigas hjärtan, från Continuum och CruiseControl till IBM’s senaste inköp, BuildForge. Skillnaderna är stora, inte bara rent funktionellt utan också kostnaden tenderar att variera. Frågan är vad man kan att erhålla däremellan? Har Continuum som open source tappat gnistan? Eller är BuildForge helt enkelt för [...]

Posted in Quality, TDD | No Comments »