How to make code testable

In this post, we created a shopping application which is available on console and refactored it. It has only one class ...

How to become a better programmer

I hadn't been decent programmer for a long time because I hadn't written unit test. Decent programmer should at least ...

Dependency injection in Typescript. Constructor? Setter? Factory method?

Decoupling class relationships is important for unit testing. Less cohesion makes writing unit tests easier. This post shows 3 ways to do it. Constructor injection, setter injection, and using the factory method to inject the desired instance.
Copied title and URL