Practical shift-left on testing

What should be the SUT in tests when you do shift-left on testing?

If you find the opinions I express in this post to be radical, you will find the follow-up outrageous.

If you have not yet read Andrew Lock’s post Should you unit-test API/MVC controllers in ASP.NET Core? then I suggest you read it without undue delay. In this post, Andrew brilliantly argues that you should not unit test controller classes.

The astute reader will notice that the title of my post is an abbreviation of the title of Andrew’s post. …


Manage test fixtures for fast and reliable in-memory tests

Martin Fowler’s Object Mother Pattern Revisited

This will be clear once you have read this post.

Many developers and testers think they are doing behaviour driven development when they use Gherkin tools, such as Cucumber, SpecFlow or BDDfy. But a tool alone does not do the trick. Why do you think the inventors of BDD stopped using Cucumber and Jbehave?

I claim that BDD is not so much about the tools, it is about a way of thinking. In this post, I will focus on one aspect of BDD which I believe the BDD community is not taking seriously enough — the initial context which is declared in one or more Given statements.

The set of…


PRACTICAL SHIFT-LEFT ON TESTING

Scratched ice
Scratched ice
This post will only scratch the surface of a very large topic.

First, I would like to thank Vladimir Khorikov for his comments on a draft of this article. You would expect the author of Unit Testing Principles, Practices, and Patterns to disagree with the opinions expressed in this post, but Vlad and I very much agree about using larger units in unit tests, as they allow us to cover units of behaviour instead of units of code.

For as long as I remember, at least when it comes to my professional life as a software developer, I have been obsessed with correctness.

So I have meticulously unit tested all my code.


When I promised to write about how to reduce friction from developers’ work day, I am sure that most expected me to focus on what non-developers ought to do in order to improve the working lives of developers.

But let’s face it, the major cause of friction, crappy legacy code, is our own fault. Developers wrote that crappy code, after all. So let’s focus on what we can do about that.

Software developers have a natural tendency to keep the hands off code that already works. …


A LeanTest driven test — more details will follow (non-blurred).

It has been my plan for a while to start writing about all the things that make a software developer happy and active — or loyal and productive, if you prefer to see it from a manager’s perspective.

When I am asked about my opinion on the topic, I usually mention that I need the right challenges, good colleagues, a decent work/life balance — and a fair compensation.

But if you have all that and you still feel frustrated every work-day, it might be because of what I intend to write about in future blog posts — too much friction.

Brian Elgaard Bennett

I write about life, universe and software development. Before Medium, I used to post here: https://elgaard.blog/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store