Home » Tag Archives: Testing (page 11)

Tag Archives: Testing

Test Attribute #10 – Isolation

software-development-2-logo

This is last, final, and 10th entry in the ten commandments of test attributes that started here. And you should read all of them. We usually talk about isolation in terms of mocking. Meaning, when we want to test our code, and the code has dependencies, we use mocking to fake those dependencies, and allow us to test the code ...

Read More »

JUnit in a Nutshell: Hello World

junit-logo

JUnit seems to be the most popular testing tool for developers within the Java world. So it is no wonder that there have been written some good books about this topic. But by earning a living as consultant I still meet quite often programmers, who at most have a vague understanding of the tool and its proper usage. Hence I ...

Read More »

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 »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Advanced Java Guide
  • Java Design Patterns
  • JMeter Tutorial
  • Java 8 Features Tutorial
  • JUnit Tutorial
  • JSF Programming Cookbook
  • Java Concurrency Essentials