[drf | tdd] Build a Backend REST API - 3

Hyeseong·2021년 2월 22일
0
post-custom-banner

Unit Tests

  • Code to Check your works

  • Isolate specific code to test

    • Classes
    • Functions
    • API Endpoints
  • Takes practice


Test stages

Setup

  • Create sample database objects
  • Decide on inputs

Execution

  • Call the code

Assertions

  • Confirm expected output

Why write tests?

  • Expected in most professional dev teams
  • Makes it easier to change code
  • Increased confidence
  • Saves time
  • Better quality code

Test Driven Development

Traditional development

  • Implement feature -> Write tests

(TDD)Test driven developemnt

  • Write tests -> Implement feature

Why use TDD?

  • Increase test coverage
  • Ensure tests work
  • Encourage good quality code
  • Staty focused
profile
어제보다 오늘 그리고 오늘 보다 내일...
post-custom-banner

0개의 댓글