開發流程心得

遵守規則

  • Clean Architecture
  • CQRS
  • TDD

Clean Architecture

如何將開發流程分成四層的設計由內而外依序創造

  • domain
  • application
  • adapter
  • framework & denpendecy injection
  • CQRS

CQRS

Command Query Responsibility Segregation

  • API -> Query-QueryHandler -> DB
  • API -> Command-CommandHandler ->DB

ATDD建立測試類別

Controller測試開始建立
Request 資料開始建立
Adapter 依賴抽象的建立 透過Mock的方式 注入Mock interface
Assert 結果正確
scenario positve test
scenario negative test

用TDD開始開發

測試驅動開發

  • 紅燈
  • 綠燈
  • 重構
  • just enough
  • given when then

tdd 測試方向

  • 物件的功能
  • 物件拋錯的情境
  • 物件可以正常執行