Posts tagged "cleancode"

Found 3 posts tagged cleancode
2020-11-25
In a sentence: Anything about your code and development environment that slows you down.
2020-11-06
This is a short summary of my experience while writing a simple HackerNews scraper. As a pure exercise or kata if you want, I tried to apply Clean code, Refactoring and Testing priciples for this small npm module. The task is simple: Get the posts on the front page of https://news.ycombinator.com and parse them.
2020-05-20

Iā€™m going to outline an example to make the concept clearer:

You need to send a recurring email to some users (a newsletter for example), based on some business logic.

The business logic / user story could say:

"As a user

I want to receive an email every week

So that I can stay up to date with the latest news."

This is intentionally a contrived example to reduce the scope of the exercise.

Topics, Approaches and Tools

Concepts discussed below are

  • SOLID principles
    • Single Responsibility Principle
    • Open-Closed Principle
    • Dependency Inversion Principle
  • Reason for a software component to change
  • Test doubles like Spies and Stubs
  • Collaborators in tests
  • User Acceptance tests
  • Unit tests

On the technical side, I am going to use the following tools

  • sinon for easy Test Doubles
  • ava for running the tests
  • MongoDB as an example, but of course the persistence can be changed at your liking
  • no real email API service, to keep it simple