Why does this test fail?

Why does this test fail?

Why does this test fail?

A developer in my team asked me a question last week: “Why does this test fail?” I was puzzled by this question. I wrote the test with the cucumber framework. The description in the feature file is crystal clear for me.

The scenario itself is not difficult at all. The failing step, that jenkins shows in the test report, tells that there is something wrong since that day. The origin of the failing test is due to refactoring the day before. Another developer started to refactor. He mentioned that the day before in the standup meeting. He told us that tests could fail.

The fact that the developer raises that question is interesting for me. The first (bad) reaction that comes to my mind is a kind of frustration. Did the developer not listen in the standup? Why does he not understand this simple test? Do I have to explain it again?

The explanation of what the test does is not good enough. Is this a problem of the messenger instead of a problem of the person who does not understand it? How can a tester explain better what a test is doing? Everybody should know this. In case a test is performing well, nobody cares about it. As soon as they fail, better documentation of the test is necessary.

I will not give a solution to this problem in this article. I am still learning how I can explain something better. This article is a part of my journey.

What is an explanation?

The wikipedia page shows the following:

An explanation is a set of statements usually constructed to describe a set of facts which clarifies the causes, context, and consequences of those facts.

Wikipedia

To explain something is describing it so that it is clear. The purpose of explaining is to make it comprehensible.

You can do that by living in the person who receives the message. A person who can bring over a message in a clear way is able to place his mind in the mind of the audience. Facts and data are everywhere. In most cases, they are present without any context. By giving the context, you can give the facts a frame. An explanation answers the question: Why? The trick is to put the facts in such a way that it answers this question. It should answer why the facts make sense. By answering this question, you make it easier to understand the facts.

Why does explaining fails?

Assumptions are the cause of faults

It is easier to see if a person understands what you explain if you explain it only to him. If there are more people involved, this is more difficult. You can not know what everybody in that group already knows. You have to make an assumption of what the group knows. This assumption is not always the reality.

Why do we make wrong assumptions? This is the result of the curse of knowledge. It is difficult as an expert to imagine how it is that you do not know anything about it. An expert is a good explainer if he can place himself in the footsteps of a person that knows nothing about the subject.

New employees have the same problem. They can be experts, but in the new company, they are newbies. The culture of communication is new for them. The business language is different. Every company is different. In the beginning, it is difficult to adapt.

Words can hurt

Explaining something is not simple. When one word in the explanation is not clear to the audience, the audience can lose attention. The curse of knowledge is the cause of this. You think everybody knows the words. It is not like that.

If you use words that the audience does not know, you lose their trust. Once the trust is gone, it is very difficult to get it back. To explain, you need that trust. So be careful with your words.

We do not understand

If we explain something we do not understand well, we have a problem. Einstein knew this too. He said the following:

“If you can’t explain it simply, you don’t understend it well enough.”

– Albert Einstein

We all know this when some people are interviewed on TV. When the interviewee does not understand the matter he or she explains, you hear strange things in the answer. This is bad for the reputation of this person. It is for sure when it is wrong. Then the credibility of that person is completely gone.

I think it is better to say in that case that you do not know it well enough and that you are making assumptions. People know that no person knows everything. They will appreciate that you are honest.

Context matters

We are explaining something. Then there comes a question from a person in the audience. We answer that question. The answer is most of the time only focused on the question itself. This is a very efficient way of answering. But is this also the correct way to answer a question? It happens that the person misses a part of the story. He misses some context.

We are explaining something. Then there comes a question from a person in the audience. We answer that question. The answer is most of the time only focused on the question itself. This is a very efficient way of answering. But is this also the correct way to answer a question? It happens that the person misses a part of the story. He misses some context.

Suppose you have to give a presentation about new technology. You tell something about blogs and wiki pages. Then you mention a few times the word RSS. You do not explain it. You do not tell why this is important in your story. You assume that everybody knows RSS.

Then you got that question: “What is RSS?”. You explain that it is an XML format that is located on the webserver. Afterward, you continue with your story. In the strict sense, your answer is correct. The person who asked the question has still questions. He still doesn’t understand it. He wants also to know why that is important in your story.

A good explainer sees the purpose of the question. He can rephrase the question and askes if he is correct with that question. Now it becomes clear that the real question is a lot broader. Now the explanation can be given with more and better context.

Conclusion

Let’s go back to the original story. A developer asking to me: “Why does this test fail”?

This article is a short summary of some chapters in the book: The art of explanation. The test that caused the problem was written long before the person joined the team. We did explain it in the first weeks. The first weeks are always overwhelming. I assume that the context of that test was missing. I made an assumption that he did understand everything we told him before. Probably there are still some gaps in his knowledge.

How can we prevent gaps in knowledge? We understand something if we can explain it simply. Each time we discuss a story, the story should be told again. And again, and again. We should not do this only from the developer’s point of view. The point of view of the end-user is important too.

In that way, we see better what the tests of a story are doing.

Thanks to