Skip to content

Testing

Do Not Mix Test Code With Production Code

A few months back I reviewed an application. It was sad to see in how little time you could create a mess that is not only hard to work with, but that can only be changed with a lot of effort. In this post we focus on one tiny little detail that can help you as a warning sign early on: having test code directly in the production code.

5 Things to Test With List Parameters

Whenever we have a method that accepts a list as a parameter, we should test these 5 cases to see if the method handles the input correctly:

  1. Null
  2. Empty
  3. One
  4. A few
  5. Many

Let us take a closer look at each of those inputs and what they can check for us. The list is not my invention, but so far, I was unable to attribute it correctly. If you know who the source was, please let me know.

Parting Thoughts on Performance Testing

After spending the last four months diving into performance testing and hunting down memory leaks, this series comes to an end. Let’s take a moment to reflect on the key insights and explore some ideas you can try on your own.

Reduce Infrastructure Costs Guided by Performance Testing

When we talk about performance tests, we usually do it with the goal of making our applications faster. However, we can also focus on the reduction of resources we need to deliver the same performance. If we do not want to blindly meddle with our infrastructure, we need to run our performance tests to guide the optimisation. Let us explore our options.

The Strange Memory Leak in .Net 8

Last year we moved our applications from .Net 6 to .Net 8. It was much less work that it was to move from .Net 4.8 to .Net 6. The migration itself was straightforward, and we could put our updated application into production without any issues. That was until a week later when we got this strange error:

Application '/LM/W3SVC/11/ROOT' with physical root '...'

hit unexpected managed exception, exception code = '0xe0434352'.

First 30KB characters of captured stdout and stderr logs:

Out of memory.