generated from muhandojeon/study-template
-
Notifications
You must be signed in to change notification settings - Fork 0
[한상호] 15장,16장,17장 : JUnit 들여다보기, SerialDate 리팩터링, 냄새와 휴리스틱 #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
The head ref may contain hidden characters: "15,16,17\uC7A5/\uD55C\uC0C1\uD638"
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # 🔖 Ch15. JUnit 들여다보기 | ||
|
|
||
| > 작성 일자 : 2025.08.24 / 작성자 : 한상호 | ||
|
|
||
| ## 💫 기억에 남는 문구 | ||
|
|
||
| - `p.331` : 의도를 명확히 표현하려면 조건문을 캡슐화해야 한다. 즉, 조건문을 메서드로 뽑아내 적절한 이름을 붙인다. | ||
| - `p.332` : 부정문은 긍정문보다 이해하기 약간 더 어렵다. | ||
| - `p.341` : 코드를 리팩터링 하다 보면 원래 했던 변경을 되돌리는 경우가 흔하다. 리팩터링을 코드가 어느 수준에 이를 떄까지 수많은 시행착오를 반복하는 작업이기 때문이다. | ||
|
|
||
| ## 💡 느낀 점 | ||
|
|
||
| 1. 이번 장에서는 저자가 Junit 모듈을 리팩터링 하는 과정을 보여주었다. 여기서 느낀 점은, 아래와 같다. | ||
| 2. 변수명 & 메서드명을 가독성 좋게 만드는 것이 가장 기본이고 가장 중요하다. 이 부분만 많이 고민해 봐도 코드의 퀄리티가 많이 올라간다고 생각한다. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이게 가장 기본인 것 같아요!!! |
||
| 3. 부정문 보다는 긍정문이 이해하기가 쉽다. "~ 해라" 가 "~ 하지 마는 것을 하지 마라" 보다는 이해하기가 훨씬 쉬울 것이다. 예를 들면 `isEmpty() == !isNotEmpty()` 같은 경우이다. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # 🔖 Ch16. SerialDate 리팩터링 | ||
|
|
||
| > 작성 일자 : 2025.08.24 / 작성자 : 한상호 | ||
|
|
||
| ## 💫 기억에 남는 문구 | ||
|
|
||
| - `p. ` | ||
|
|
||
| ## 💡 느낀 점 | ||
|
|
||
| 1. 솔직히 제대로 못 읽었습니다.. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # 🔖 Ch17. 냄새와 휴리스틱 | ||
|
|
||
| > 작성 일자 : 2025.08.24 / 작성자 : 한상호 | ||
|
|
||
| ## 💫 기억에 남는 문구 | ||
|
|
||
| - `p.368` : 일반적으로 작성자, 최종 수정일, SPR 번호 등과 같은 메타 정보만 주석으로 넣는다. | ||
| - `p.369` : 주석으로 처리된 코드를 발견하면 즉각 지워버려라! | ||
| - `p.371` : 아무도 호출하지 않는 함수는 삭제한다. 죽은 코드는 낭비다. 과감히 삭제하라. | ||
| - `p.376` : 죽은 코드는 시간이 지나면 악취를 풍기기 시작한다. | ||
| - `p.377` : 함수, 상수, 변수를 선언할 때는 시간을 들여 올바른 위치를 고민한다. 그저 당장 편한 곳에 선언하고 내버려두면 안 된다. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 저는 이걸 잘 못하는 것 같아요... |
||
|
|
||
| ## 💡 느낀 점 | ||
|
|
||
| 1. 이번 챕터에서는 지금까지 책에서 나온 저자의 코드 관리 방법론에 대한 총 정리본이 나왔다. 때문에 해당 챕터는 두고두고 보며 내 코드를 리팩터링할 때 참고하면 좋을 듯하다. | ||
| 2. 책에서 저자가 원하는 만큼 많은 것을 얻어가지는 못 했지만, 중복 코드를 최대한 제거하고 / 최소 놀람의 원칙을 위해 일관성 유지와 가독성에 신경 쓰고 / 변수 & 함수 네이밍을 할 때 많은 신경을 쓰고 / 변수 & 상수 & 함수 등을 만들 때는 위치를 고민하라 등은 기억에 잘 남는 것 같다. 이 부분들은 명심하며 앞으로 코드를 짜 보려고 한다. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
공감합니다.