Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions 14장/최호.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Part 14: 점진적인 개선


## 내용

14-8 코드를 보면 코드가 엉망이라고 한다.
- 인스턴스 변수의 개수
- TILT와 같은 이상한 문자열
- HashSets, TreeSets, try-catch-catch 블록 등

Boolean 인수만 지원하던 초기버전은 괜찮았는데
여러 타입의 인수들을 추가로 받으면서 코드가 복잡하고 지저분해졌다. 하나의 인수를 추가할 때마다 여러 곳의 코드를 수정해야 하는 등 확장성이 모자랐다.

TDD는 언제 어느 때라도 시스템이 돌아가야 한다는 원칙을 따른다.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저자가 약간 TDD 만능론자 같은 느낌이 들어요


새로운 인수 유형을 추가할 때 코드가 중복되는 문제점을 해결하기 위해 ArgumentMarshaler라는 새로운 개념을 도입했다.

에러 메시지 생성 책임을 ArgsException 클래스로 이전한다.

코드가 더 나빠지기 전에 기능을 추가하는 것을 멈추고 리팩터링을 한다.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


## 느낀 점
- 사실 지금 프로젝트 리팩토링들을 멈추고 있는건 테스트 코드가 없어서 문제가 많이 일어나서가 아닐까..?
- 테스트 코드를 공부해봐야겠다.
Comment on lines +23 to +24
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저도 이번 장을 읽으며 테스트 코드를 하루빨리 공부하여 도입해 봐야겠다는 생각을 했습니다!!

- 여러 백엔드 중 nest를 공부하는 이유도 jest로 테스트를 하기 때문에 좀 더 도움이 되지 않을까라는 생각도 있다.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nest 공부하는거 어떤지 궁금하네요 ㅎㅎㅎ 내일 알려주세요.