Maintainable test setup and cleaner tests

The need to constantly update your tests whenever you change production code is one of the arguments against unit testing. Sure, when you do a big refactoring tests will need to change, but smaller changes should not make you change all the tests. I will try to help you with this issue. Specifically I will try to help you make your setup code easier to maintain.

Czytaj dalej »

Cleaner constructors with throw expressions in C# 7

When creating classes it’s important to create constructors that don’t allow creating objects in an invalid state. I blogged about this in the past (in polish – Czy programiści .NET zapomnieli o konstruktorach?). To prevent this we add validations in constructors. One of the most common is validating if object passed to constructor isn’t null. This is boooring code that you just have to type in (Resharper helps here) and before C# 7 and throw expressions it introduces it was taking a lot of space in constructor.

Czytaj dalej »

How to find great IT books?

In my opinion if you’re trying to be the best possible software developer you can ever be reading books is the best way to achieve this (other than writing code :)). In no other way you will be able to learn from one of the best, incredibly clever and most respected developers on this planet. Some of you may be lucky enough to work with them but most of us are not.

Czytaj dalej »

Top mentioned books on

Stackoverflow analysed more than 40 million questions and answers to find books mentioned the most. And No. 1 is one of my personal TOP 3 books on software development ever written – „Working with legacy code” by Michael Feathers.

In case you are interested in two other books from my personal TOP 3:
No. 1 – „Agile Principles, Patterns, and Practices in C#” by my favorite author Robert C. „Uncle Bob” Martin and Micah Martin.
No. 3 – „xUnit Test Patterns: Refactoring Test Code” by Gerard Meszaros.

I really believe that if you don’t like to read a lot of books (not me, I lost count how many I have read) those three will give you extremely high return on time invested in reading (and understanding!) them.

I would also like to mention my No. 4 too because it’s close call with No. 3. It’s „Growing Object-Oriented Software, Guided by Tests” by Steve Freeman. It’s not No. 3 only because I think it’s good to read „xUnit Test Patterns: Refactoring Test Code” first.

Oh, and I almost forgot. Here is the site where you can check the results of Stackoverflow analysis –