Archive

Posts Tagged ‘Test Driven Development’

No more development, TDD begins with MoreUnit

December 25th, 2011
Adrian Elsener

Do you program or do you already TDD? :)
If you prefer to do TDD you will love the eclipse plug-in called MoreUnit. It is as simple as powerful. All it does is executing tests from corresponding productive class and makes it very simple to change between them.
Just press Ctrl-J (like Jump) to jump from test to implementing class and the other way. Or press Ctrl-R (like Run) to run the test regardless if you are in the test or the implementation class. read more

 

Agile, Java, Test Driven Development , , , , , , , ,

Mockito – ArgumentMatcher vs ArgumentCaptor

November 25th, 2011
Adrian Elsener

Since a few weeks the new mockito release candidate is available. So I think it is the right time to place a new post. Here I will show the differences between ArgumentMatcher and ArgumentCaptor. Most developer will first see the ArgumentMatcher and use it. What can be done with ArgumentCaptor is often not seen. With the sample I will show that an ArgumentMatcher should not be used to fetch arguments. For this work there is the ArgumentCaptor. The Matcher should really be used to check if an argument matches or not.
read more

 

Java, Test Driven Development , , ,

Refactoring in Test Driven Development

August 23rd, 2011
Urs Enzler

cross-post from www.bbv.ch/blog

In the last two years I gave over a dozen courses and presentations about test driven development (TDD). One question, I get asked almost every time, is how to refactor code while keeping up the TDD rules:

  • write only production code if there is a failing test requesting it
  • have no more that one failing test at once

read more

 

Test Driven Development ,

Clean Code and Clean TDD Cheat Sheets

January 4th, 2011
Urs Enzler

Updated: new version available!

I have compiled two cheat sheets about clean code (the ones mentioned in my post about Code Quality!).

The first covers clean code – code that is easy readable and keeps changeable. The second is about Test Driven Development. Both cheat sheets list principles, patterns, practices and smells.

You can download them here – Clean Code Cheat Sheet V1.3, Clean TDD Cheat Sheet V1.2.

Take a look!

I’d like to read your feedback in the comments section…

Clean Code

(just an unreadable preview :-)    – click on link in text above)

 

.NET, Agile, Test Driven Development , , , , , ,

Mockito – Answer vs. Return

July 20th, 2010
Adrian Elsener

Did you had the problem your mock must act like a bean? And you could not create the object with the real implementation? And the interface was too large, so you would not create a innerclass for the test? I had this problem too. I solved it with the answer in mockito.

read more

 

Java, Test Driven Development, Testing , , , , , ,

Speaking at BASTA! in Mainz (Germany) on September 21st 2010

July 1st, 2010
Urs Enzler

I’m going to speak about code quality (see my short version of the presentation) at the conference BASTA!

BASTA! is mainly focused on .NET technology and gives you the opportunity to see and speak with a wide range of technology experts.

If you have any feedback of what you are missing in my short presentation, please write a comment here or on the post with the presentation. The short version takes about 30 minutes and my speak at BASTA! is scheduled for 1 hour and 15 minutes.  I will mainly show real life examples of the theory shown in the short version. But if you want to here something specific, ask for it :-)

I’ll probably will publish the long version on this blog, too – for all of you not joining the conference.

So long…

 

.NET, Agile, Announcement , , , ,

Create mocks with mockito

June 25th, 2010
Adrian Elsener

This is a small summarization what the differences are between the different variations creating mocks with mockito.

Null values (default)

Per default, after creating a mock, every method will return null. Just create your mock with:

Sample sample = Mockito.mock(ISample.class);

I think, this is very useful and straight forward. (And based by mockito developers idea, to create very fast a mock for testing). Sometimes it is very difficult to determine an error which was produced through such a null value. For this case it is very practicable to tell mockito, returning SmartNullValues.

read more

 

Agile, Java, Test Driven Development, Testing , , , , ,

Code Quality! Building code you won’t curse tomorrow.

June 17th, 2010
Urs Enzler

These are the slides and comments of a presentation I held for bbv Software services AG.

The presentation is about how we get quality into our code.

Buzzwords: Fokus, frequent measurements, strong team, clean code, pair programming, test driven development, acceptance tests, continuous integration, collective code ownership, team learning.

image

Urs Enzler
Senior Software Architect
bbv Software Services AG

urs.enzler _at_ bbv.ch  (replace _at_ with @)
www.bbv.ch

Copyright © 2010 bbv Software Services AG

image

How to get quality into source code – that’s the question I’ll try to answer in this document.

You’ll see what we do at bbv Software Services to get code that is built with inherent quality and why it is important to think about quality throughout the whole development process.

read more

 

Agile, Presentation, Test Driven Development , , , , , , , , , , , , ,

Mocking Kata – Copier (.NET)

March 31st, 2010
Urs Enzler

To continue my series on Mocking Katas (see Mocking Kata – Instrument Processor for the last Kata), I’ll show you a very simple Kata that I normally use in my Test Driven Development training courses to introduce mocks (created manually or dynamically with the use of a mocking framework): the CharacterCopier.

read more

 

Test Driven Development , , ,

Mocking Kata – Instrument Processor (.NET)

March 28th, 2010
Urs Enzler

We use Coding Katas in Coding Dojos to improve our programming skills. This includes skills in software design, refactoring, Test Driven Development, Mocking, tool usage and a lot of other tiny stuff.

However, I found only a few Katas, especially Katas including the need for mocks (see for example http://codingkata.org/). Most Katas are very algorithmic, which is good for learning TDD. But its bad for learning how to use mocks.

Therefore, I started to invent my own Mocking Katas. I use these in my training courses on Test Driven Development.

read more

 

.NET, Test Driven Development , , ,