We use tests to verify that a function behaves as expected. When a function has side effects, it means that it depends on something external. This happens when we test a unit of code and we need another unit of code as a dependency. …

Definition

‘Adapter’ pattern is a structural design pattern that is useful for composing classes and objects into a larger system.

The ‘Adapter’ pattern allows two objects, with related functionalities, to work together, even when they have incompatible interfaces.

When should we use this pattern?

This pattern should be used when we need two objects to work together…

Definition

‘Composite’ pattern is a structural design pattern that is useful for composing classes and objects into a larger system.

The ‘Composite’ pattern defines an interface for dealing with structures of objects uniformly. Structures are in the form of trees that contains individual objects and composition of objects.

When should we use this pattern?

This pattern should…

Definition

‘Factory Method’ pattern is a creational design pattern that abstracts the instantiation process. Creational pattern controls who creates an object and what/how/when it gets created.

The ‘Factory Method’ pattern defines an interface for creating an object and delegates the object creation to subclasses.

When should we use this pattern?

This pattern should be used when we…

Definition

F.I.R.S.T. stands for Fast, Independent, Repeatable, Self-Validating and Timely. These principles help to write well-crafted unit tests and will make testing easier. Testing can be hard when the production code is not designed to be testable. These principles will show practices which improve testability.

The purpose of these principles is…

Romain Brunie

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store