On Automappers
This post is about some bad practices in using automappers.
REST API response codes: 400 vs 500
Today, I’d like to talk about the (sometimes subtle) difference between 4xx and 5xx response codes when programming a RESTful API. I’ll try to show when to return what code (400 or 500) and introduce a simple way to implement this logic on the server side.
How long should a single method be?
This topic might seem trivial, especially if you look at all other articles that have beaten it to death already. But I would still like to make a couple of important points here. So, how long should a single method be?
2016 retrospective
I already did this thing last year, so I thought I would do it again. Below is an overview of the articles I posted this year and a little bit of reflection on them. Retrospective It’s interesting to look at the progression of blogging topics throughout the whole year. They mostly followed the Pluralsight courses I was working on at the time. While writing a course, I remember finding lots of ideas that were worth extracting into a separate self-contained blog post.
Custom exception types
Today’s topic is about custom exception types. That is whether or not you should write your own exception types to throw in different situations.
OCP vs YAGNI
In this post, I want to cover the topic of OCP vs YAGNI - contradictions between the Open/Closed Principle and the You aren’t gonna need it one. OCP Let’s start with a refresher for what OCP is. The Open/Closed principle states that: Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification. It was first introduced by Bertrand Meyer in his canonical Object-Oriented Software Construction book.
When to include external systems in testing scope
Should you always mock out your database? Or should you include it in the unit/integration testing scope? What about other external systems? This post is based on my Pluralsight course about Pragmatic Unit Testing. Two types of external dependencies When it comes to external dependencies (dependencies outside the process that hosts your application, such as a database, a 3rd party system, etc.), there’s no single guideline regarding how to work with them in tests.
OOP, FP, and object-relational impedance mismatch
Today’s topic is gonna be about OOP, FP, and object-relational impedance mismatch. The goal of this article is to show how object-oriented and functional paradigms deal with relational data stores.
Verifying collaborations at the system edges
Last week I wrote about when to use mocks. In this post, I’d like to outline a specific guideline which comes into play when you start working with mocks: verifying collaborations at the system edges. This article is based on my recent Pluralsight course about Pragmatic Unit Testing. Verifying collaborations at the system edges The use of mocks goes hand in hand with the style of unit testing which I call collaboration verification.
Pragmatic Unit Testing Pluralsight course
My new course Building a Pragmatic Unit Test Suite for Pluralsight went live. Building a Pragmatic Unit Test Suite Unit testing can be applied differently. Like many other things in programming, there are a lot of ways to mess up with it. It’s important to differentiate unit testing techniques that help bring confidence in your code base correctness from techniques that can potentially have a devastating effect on your entire test suite.