Home / Posts tagged "Testing"

Presentation: Agile Quality Assurance

This is the presentation I gave at the conference Basta! in September 2012.


Before we can talk about Agile quality assurance, we have to make a step back and take a look …


… at the goals of Agile software development. Our Agile quality assurance strategy should support these goals:

Continue reading

Create your own hamcrest matcher

If you are familiar with hamcrest and JUnit the time will come when you have
the need to create your own matchers.
Creating your own matcher can be as simple as useful. One reason for
creating your own matcher could be that your object is not a default object
like a String or a Collection. And if you would like to get a more readable
version of the assert for the next developer who has to read your
test. Let’s make an example. If you have an object with two methods;
getName” and “getNumber” and you would like to check whether the resulting object
has the correct values.
In my opinion the best way to verify this is to create two matchers and
combine them. Before we can combine these two matchers let’s see how to
create them. Continue reading

No more development, TDD begins with MoreUnit

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. Continue reading

Create mocks with mockito

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.

Continue reading

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

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.


Urs Enzler
Senior Software Architect
bbv Software Services AG

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

Copyright © 2010 bbv Software Services AG


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.

Continue reading

Moq suggestions: SetupSequentials

I must say I’m really a huge fan of Moq. Moq is steady growing and the developer community is quite impressive in inventing new features and extensions. I recently ran over a nice feature suggestion placed in a private branch from moq. The branch belongs to Brian J. Cardiff. I suggest you check also his blog out! The feature brain suggested is an extension method which allows to do sequential setups. The sequential setup allows to specify in a fluent way for example different return types on a mock for each call. Let’s have an example!

Continue reading

How to find a concurrency bug with java?

How to find a concurrency bug – this was the question I asked myself some time ago.
It is always very hard to find a concurrency bug. Mostly you have no idea when it happens or if it is really a concurrency issue or some nasty bit of code. If it is a concurrency issue the question is if the bug is in your code or in a supplied library? Will the problem happen only on multicore processors or on any machine? Besides the technical problem the customer is eager to get a solution and management… we’ll i guess you know the story.
I won’t be able to tell you everything there is to know about concurrency testing – but I’ll show you a way that worked for me in most cases.
Continue reading