In TDD , what don’t you have to test?
“
The simple answer, supplied by Phlip is, “Write tests until fear is transformed into boredom.” … Try this list. You should test:
Conditionals
Loops
Operations
Polymorphism
But only those that you write. Unless you have reason to distrust it, don’t test code from others.
목차
See also
Characterization test : 테스트가 없는 레거시 코드를 수정하기 전에, 레거시 코드의 현재 동작을 기록하기 위한 테스트. 이 경우에는 남이 만든 코드에 테스트를 붙인다. 하지만 생각해보면 단위 테스트 에서 쓰는 것과 같은 도구와 기술을 쓸 뿐, 엄밀한 의미에서의 테스트는 아니다.
목차 관련 글 두려움을 깨진 테스트로 이 글을 인용: “What not to test: 두려움이 지루함으로 바뀔 때까지 테스트를 작성하기.” 격리된 테스트 “We aren’t striving for perfection. --Chapter 4, Test-driven development: by example” Test and type-driven development “단위 테스트는 테스트 케이스에 명시된 단언들만 검증할 수 있지만 정적 타입 언어의 타입 검사기는 코드에 타입 오류가 없음을 보장해준다.” 테스트 악취 “(The equivalent of is the ten-minute test suite.” 레거시 코드에서의 에이전트 기반 코딩 “예: 일부러 중복을 만들기(Reconcile differences), 버그가 있기 때문에 통과하는 테스트 만들기(Characterization test)” Mocks aren't stubs “Usually they are just used to fill parameter lists.” TDD와 XP “You get another test working and the duplication removed, and you check in.” 테스트 커버리지 “플립의 말을 빌자면 "모든 입력의 경우를 따져서 테스트 커버리지를 높이는 대신에, 우리는 테스트는 그대로 두고 코드를 줄여서 동일한 테스트가 다양한 경우를 다루게 한다." --p157, Test-dr…” 에이전틱 엔지니어링 다음 “뮤테이션 테스트: 코드를 임의로 바꿨는데 테스트가 안 깨지면 테스트에 틈이 있다는 뜻.” 테스트를 언제 지울까 “Never delete a test if it reduces your confidence in the behavior of the system.” TDD 주기의 보폭 관련 절: Awareness and control Model-driven testing “The model is your test oracle—it tells you not just what to test, but what the expected behavior should be.” Framework for integrated test “MS-Word로 요구사항(인수 테스트 문서)을 작성하는데, 문서 중간에 표 형태로 예시를 넣어주면 이게 실행되어 현재 개발 중인 소프트웨어가 명세에 맞는지 쉽게 확인할 수 있는 방식이다.” 애자일 디자인에 대한 일반적 오해들 관련 절: 가장 작은 스케일의 TDD가 TDD의 전부다 AI 시대의 소프트웨어 자산 “Working effectively with legacy code에서는 이런 종류의 테스트를 Characterization test라고 부른다.” TDD 주기 “Think about how you would like the operation in your mind to appear in your code.” 레거시 코드 “What do tests have to do with whether code is bad?” 의존과 중복 “The problem is the dependency between the code and the test - you can't change one without changing the other.” Dependency inversion principle “리팩토링을 일반화한 다른 프랙티스를 통해 단위 테스트를 하기 용이한 코드를 얻어내는 것.” Test set “For instance, a single example shouldn't belong to both the training set and the test set.”