리팩터링 내성
-
단위 테스트 정리 2 - 좋은 단위 테스트의 4대 요소책책책 책을 읽읍시다/프로그래밍 2022. 7. 4. 23:16
좋은 단위 테스트의 4대 요소 회귀 방지, 리팩터링 내성, 빠른 피드백, 유지 보수성 회귀 방지 회귀 발생 가능성이 높은 코드 측정 지표 테스트 중에 실행되는 코드의 양 코드 복잡도 코드의 도메인 유의성 단순한 코드를 테스트하는 것은 가치가 거의 없다. 이러한 코드는 짧고, 비즈니스 로직을 많이 담고 있지도 않다. 단순한 코드를 다루는 테스트는 실수할 여지가 많지 않기 때문에 회귀 오류가 많이 생기지 않는다. 우리가 작성하지 않은 코드(라이브러리, 프레임워크 그리고 프로젝트에서 쓰는 외부 시스템)도 중요하다. 이 코드는 작성한 코드만큼이나 소프트웨어 작동에 영향을 미친다. 최상의 보호를 위해서는 테스트가 해당 라이브러리, 프레임워크, 외부 시스템을 테스트 범주에 포함시켜서 소프트웨어가 이러한 의존성에 대..