profile picture

6 pages tagged with "design"

How to test private methods?

October 20, 2023

blog-cover

This is a question that I have encountered with some frequency for a long time. So I thought I would put together my thoughts on the subject here.

This is a question that I have encountered with some frequency for a long time. So I thought I would put together my thoughts on the subject here. Short answer Never. Long answer Never ever. What if…? If you really want to test a private method, consider extracting that private method logic into a…

Recipes for Decoupling

November 28, 2022
What is coupling, and why is it bad? What is decoupling, and how to do it efficiently? This book is a compilation of strategies to decouple your domain code from those infrastructure details, so you can enjoy a healthier system in the long run. This book will teach you how to create PHPStan rules …

To mock or not to mock

January 11, 2021

blog-cover

Mocking is useful, but “what to mock” usually turns out to be a bit more complicated than expected if you don’t treat this carefully.

Mocking is useful, but “what to mock” usually turns out to be a bit more complicated than expected if you don’t treat this carefully. How to escape the mocking hell What is actually happening when we create a mock? Which types of mocks are there? Is mocking good or bad? Well, as always, everything …

Principles of package design

November 12, 2020
Apply design principles to your classes, preparing them for reuse. You will use package design principles to create packages that are just right in terms of cohesion and coupling, and are user- and maintainer-friendly at the same time. The first part of this book walks you through the five SOLID p…

Object design style guide

October 10, 2020

Objects are the central concept of languages like Java, Python, C#. Applying best practices for object design means that your code will be easy to read, write, and maintain.

This book captures dozens of techniques for creating pro-quality OO code that can stand the test of time.

Objects are the central concept of languages like Java, Python, C#. Applying best practices for object design means that your code will be easy to read, write, and maintain. This book captures dozens of techniques for creating pro-quality OO code that can stand the test of time. Examples are in an…

The art of testing: where design meets quality

April 07, 2020

blog-cover

Why you should consider testing as part of your daily development habit and how it’s directly linked to the software quality.

Why you should consider testing as part of your daily development habit and how it’s directly linked to the software quality. This post intends not to explain the different testing techniques that we can use. I’m not going to tell you the differences between unit, integration, feature, or end-to-e…