Rails Tesing Strategy
UnitTest
-
모델
- DB를 사용하지 않는다. UnitRecord
-
컨트롤러
- Model에 의존하지 않는다. UnitController
- View를 렌더링하지 않는다.
FunctionTest
- 여러 모델
- 모델과 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.
-
- 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)