Peter Morlion logo

Which Automated Tests Do I Need?

In my previous post, I explained why you need automated tests. It’s cheaper, and more fail-safe. But not all tests are equal. And there is a place for each type of test. In this post, I will try to explain the basic types of automated tests in software development and lay out their use cases […]

Why Do I Need Automated Tests?

Automated tests come in all shapes and sizes, but the main idea behind it is that you can run a suite of tests on your software by clicking a button. This suite of tests then provides certain input to pieces of your software and verifies that the output is what it should be. It serves […]

Fixing My Legacy Application: NDepend

In my series of fixing a real-world legacy application, I’ve already improved the code in some big blocks: updated Bootstrap introduced dependency injection removed unnecessary cruft added logging But fixing legacy applications often means making many smaller improvements. Many of these are often a matter of personal opinion. And when multiple developers do agree on […]

A Blog For Your Manager

I’ve written multiple posts about legacy code and automated tests. I believed both are closely connected in that one can help solve the other. I also enjoy working on legacy code, improving software development practices and improving code quality. But this blog has always been geared towards developers, and it seems managers don’t always follow. […]

What Is Technical Debt?

Have your developers ever mentioned technical debt? Or are you wondering if you have technical debt? Are you interested in doing something about it? Is it even necessary to do something about it? Let’s first have a look at what technical debt is. Wikipedia defines technical debt as: Technical debt (also known as design debt […]

Fixing My Legacy Application: Adding Logging

This application contains absolutely no logging. In many legacy enterprise application, there usually is some logging, but it’s often not very useful. In some cases, there is no logging at all. This makes it hard to troubleshoot when things go wrong. In .NET, the first logging frameworks that come to many developer’s minds is log4net […]

Fixing My Legacy Application: Dependency Injection

Continuing my series on fixing my real-world legacy application, I will now introduce dependency injection. First, I simply installed the Autofac.Mvc5,¬†Autofac.Mvc5.Owin¬†and Autofac.WebApi2.Owin NuGet packages. This changes nothing of course. So next, we tell ASP.NET to let Autofac handle the creation of the controllers. In our Startup class, we add: This is basically what’s in the […]

Fixing My Legacy Application: Removing Unused Components

When I first started writing this app, I wanted to move fast. I found a JavaScript library that promised to connect my client-side code to my Entity Framework context very easily: Breeze. For some reason that I can’t remember now, I never ended up using very much of it, if anything at all. But I […]

Fixing My Legacy Application: Updating Bootstrap

This is a first step in my series on fixing a real-world legacy application. It focusses on updating Bootstrap, but the broader issue here is that you should update the components you are using. The application was using Bootstrap 3. Updating to version 4 was fairly easy. I first uninstalled the NuGet packages bootstrap.less, Twitter.Bootstrap […]

What Is Legacy Code?

Do you often hear your developers talking about legacy code? Most likely in a negative fashion? Let’s take a moment to look at what legacy code is and what developers mean when they mention it. Definition There is no “official” definition of legacy code. Michael Feathers defines it as “code without tests” in his book […]