Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introduction Repository, DDD And Unit Test

Introduction Repository, DDD And Unit Test

case study on laravel 5, implement repository patter, a little about ddd and unit tests

Hiraq Citra M

May 27, 2015
Tweet

More Decks by Hiraq Citra M

Other Decks in Programming

Transcript

  1. Stories - I want to test the data logic but

    i dont care the data engine (database) - I want to test the data engine (database) but i dont care the data logic automated tests...
  2. Real problem? As programmer we have to make sure every

    single unit should be working properly.. the keyword is -> every single unit of our code
  3. Benefit? - We can test logic without engine - We

    can test engine without logic - We can test the repository it self easy to mocking… separation of concerns...
  4. Example Users data that contain their credentials like email, username

    and password. In DDD: User is an entity, password can be a ValueObject.
  5. Unit Test 1 class 1 responsibility We should can test

    each of 1 class without thinking the dependency complexity (replace all dependency with mock)