Header

  1. View current page

    딥뿔이 자라나는 노트

Profile_image?t=1225424611&type=big
나를 바꾼 똑똑한 생활 습관, 스프링노트 - 여러분도 지금 시작해보세요!
71

Rails Tesing Strategy

UnitTest

Fast,_Sexy,_and_Svelte__Our_Kind_of_Rails_Testing_Presentation.pdf(8_75_페이지)-1.jpg

  • 모델

    • DB를 사용하지 않는다. UnitRecord
  • 컨트롤러

    • Model에 의존하지 않는다. UnitController
    • View를 렌더링하지 않는다.

 

FunctionTest

Fast,_Sexy,_and_Svelte__Our_Kind_of_Rails_Testing_Presentation.pdf(32_75_페이지).jpg

  • 여러 모델
  • 모델과 DB
  • 모델과 컨트롤러
  • 느린 속도가 문제. deepTest를 이용한 병렬 처리

 

UnitTest or FunctionalTest

  • Testing: Unit Test or Functional Test

    • UnitTest와 FunctionalTest가 모두 필요한가요?라는 질문에 대한 답변. UnitTest로 할 수 있는 부분은 모두 UnitTest하고, 최소한의 FunctionalTest를 갖는 것이 효과적이다.
    • In general, there are far more unit tests than functional tests. This is a result of testing permutations, edge cases, etc within the unit test suite. If a format class contains 10 logical code paths, there should be at least 10 unit tests to verify that it works correctly; however, you may only need 1 functional test to verify that the format class works correctly with the other objects it interacts with.

  • When are Unit tests enough?

    • it's when the method under test executes entirely in isolation.
    • Any time you are interacting with dependencies it's important to verify the integration between classes.

 

AutoTest

History

Last edited on 06/26/2008 14:17 by deepblue

Comments (0)

You must log in to leave a comment. Please sign in.