Home » Tag Archives: Testing (page 7)

Tag Archives: Testing

Understanding JUnit’s Runner architecture

junit-logo

Some weeks ago I started creating a small JUnit Runner (Oleaster) that allows you to use the Jasmine way of writing unit tests in JUnit. I learned that creating custom JUnit Runners is actually quite simple. In this post I want to show you how JUnit Runners work internally and how you can use custom Runners to modify the test ...

Read More »

Test Attribute #9 – Deterministic

software-development-2-logo

I keep hammering on trust and how it’s crucial that we trust our tests. If a test is deterministic, it raises the level of our trust.  If it isn’t, we may question its result, which will be followed by questioning other tests as well. Let’s start with a simple example. What’s wrong with this picture?           ...

Read More »

Writing Clean Tests – To Verify Or Not To Verify

java-interview-questions-answers

When we write unit tests that use mock objects, we follow these steps:                     Configure the behavior of our mock objects. Invoke the tested method. Verify that the correct methods of our mock objects were invoked. The description of the third step is actually a bit misleading, because often we end ...

Read More »

Test Attribute #8 – Truthiness

software-development-2-logo

I want to thank Steven Colbert for coining a word I can use in my title. Without him, all this would still be possible, had I not given up looking for a better word after a few minutes. Tests are about trust. We expect them to be reliable. Reliable tests tell us everything is ok when they pass, and that ...

Read More »

Test Attribute #7 – Footprint

software-development-2-logo

When we talk footprint, we’re really talking about isolation. Isolation is key to trust. Wait, What? The “checking” part of testing, is really about trust. We check, because we want to make sure our system works as we anticipated. Therefore, we build a suite of tests that confirm our assumptions about the system. And every time we look at the ...

Read More »

Clean JUnit Throwable-Tests with Java 8 Lambdas

junit-logo

Recently I was involved in a short online discussion on twitter and google+ which concerned the question why the arrival of Java 8 Lambda expressions makes the catch-exception library1 obsolete. This was triggered by a brief announcement that the library won’t be longer maintained as lambdas will make it redundant. The answer I came up with at that time has ...

Read More »

Test Attribute #6 – Maintenance

software-development-2-logo

I always hated the word “maintainability” in the context of tests. Tests, like any other code are maintainable. Unless there comes a time, where we decide we can’t take it anymore, and the code needs a rewrite, the code is maintainable. We can go and change it, edit or replace it. The same goes for tests. Once we’ve written them, ...

Read More »

Test your Dependencies with Degraph

scala-logo

I wrote before about (anti)patterns in package dependencies. And of course the regular reader of my blog knows about Degraph, my private project to provide a visualization for package dependencies which can help a lot when you try to identify and fix such antipatterns. But instead of fixing a problem we all probably prefer preventing the problem in the first place. Therefore in the latest ...

Read More »

A JUnit Rule to Run a Test in Its Own Thread

junit-logo

Occasionally it would be helpful to be able to run a JUnit test in a separate thread. In particular when writing integration tests that interact with encapsulated ThreadLocals or the like this could come in handy. A separate thread would implicitly ensure that the thread related reference of the threadlocal is uninitialized for each test run. This post introduces a ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close