-
Notifications
You must be signed in to change notification settings - Fork 43
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
[5기] 3주차 Wordle 과제 제출 - 호아 #39
base: main
Are you sure you want to change the base?
Conversation
- 위치에 대한 책임을 가진 클래스
- 알파벳과 위치를 가진 클래스
- List<Letter> 를 가지는 클래스
- Tile, Position 을 가지는 클래스
- isSameAlphabet로 간결하게 변경 - 해당 메서드가 너무 많은 컨텍스트를 알고있음
- Result 일급컬렉션 클래스
- resource 밑에 있는 파일을 읽어온다
- resource 밑에 있는 파일을 읽어온다
- index로 사용되는 용도이므로 변경
- 단어장 책임을 가진 클래스
- 알파벳을 소문자로 저장하는 클래스
# Conflicts: # src/main/java/wordle/infra/FileReader.java # src/test/java/wordle/infra/FileReaderTest.java
- 게임 비정상적 종료 처리 추가
- resource 밑에 있는 파일을 읽어온다
- 안쓰는 메서드 정리 및 포맷 맞추기
- final 변수 생성 및 메서드 정리
- 용어 사전 수정 및 클래스 다이어그램 수정
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.
역시 ddd 잘알(?) 호아님! 코드 보면서 많이 배우고갑니다 🙇♀️
(리뷰하면서 제것도 슬쩍 고치게 되네요. ㅋㅋㅋㅋㅋㅋ)
남기다보니 주절주절 말이 많아졌는데 그만큼 생각을 많이 하게되고 의견이 점점 궁금해지는 재밌는 코드였습니다!
다음 과제에서 진행할 호아님의 코드도 슬쩍 구경해야겠네요!! ㅋㅋㅋㅋ
리뷰는 제 개인적인 의견이고 잘잘못을 따지고자 남긴건 아니니 혹시라도 제가 부족하게 표현했다면 죄송스럽고,
시간되실때 호아님 의견도 많이 남겨주세요! 😉
@@ -16,6 +16,7 @@ repositories { | |||
} | |||
|
|||
dependencies { | |||
testImplementation 'org.mockito:mockito-inline:3.12.0' |
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.
테스트하실때 mock을 활용하셨군요! ㅇ_ㅇ
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.
네 맞습니다! staticMock을 사용하려고 의존성을 추가했습니다~~
- 6번 안에 맞추면 게임을 종료한다. | ||
- 6번 안에 맞추지 못하면 그래도 종료한다. | ||
|
||
## 용어 사전 |
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.
크 역시 ddd 영재 호아님 👍 정리하신거 멋집니다!
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.
감사합니당!!
docs/README.md
Outdated
- 입력받은 문자와 정답을 비교한다. | ||
- 비교 결과는 타일이 초록색/노란색/회색 중 하나로 바뀌면서 표현된다. | ||
- 맞는 글자는 초록색, 위치가 틀리면 노란색, 없으면 회색 | ||
- 같은 문자가 2개 입력되었을 때, 해당 문자가 정답에 하나만 존재하지만 위치가 틀린 경우 첫번 째 문자만 노란색으로 표시된다. |
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.
같은 문자가 3개 입력되었을 때, 해당 문자가 정답에 하나만 존재하면 어떻게 되나요? 😄
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.
같은 문자가 n개 입력되었을 때, 하나만 존재하면 첫번 째 문자만 노란색으로 표시됩니다! 문서 수정할게요~
docs/README.md
Outdated
| 입력 단어 | Input Word | 플레이어가 입력하는 5글자 단어 | | ||
| 정답 단어 | Answer Word | 오늘 게임의 정답인 5글자 단어 | |
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.
클래스명중에 Word가 있는데 이 Word는 입력단어와 정답 단어를 포괄하는 개념인가요? 😄
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.
넵 초반에는 InputWord와 AnswerWord 클래스를 분리하려고 했으나, 굳이 그럴 필요가 없겠더라구요~ 개발하면서 모델링이 계속 변경되었는데 지속적 업데이트의 중요성을 느낍니다 ㅠㅠ
|
||
## 모델링 | ||
|
||
### 클래스 다이어그램 |
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.
클래스 다이어그램까지 👍👍👍👍👍
|
||
public List<String> readByLine(String filePath) { | ||
if (filePath == null || filePath.isBlank()) { | ||
throw new FileReadFailException(); |
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.
파일 읽으려면 넘어야할 산이 많군요? ㅋㅋㅋㅋㅋㅋ
뭔가 예외가 발생했을때 어디서 잘못되었을까?를 확인해볼때 주로 어느 메시지인지를 많이 확인하는거 같아요.
요기에도 각각이 왜 실패했는지 메시지를 담을 수 있을까요? 😄
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.
맞아요 예외에 메세지를 대부분 빼먹었네요 ㅎㅎ 수정하겠습니다.
|
||
import java.util.Scanner; | ||
|
||
public class ConsoleInputView implements InputView { |
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.
Console 네이밍 너무 좋아요 👍
import org.mockito.MockedStatic; | ||
import org.mockito.Mockito; | ||
|
||
public class TimeTestSupporter { |
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.
시간때문에 Mock이 사용된거였군요! 늘 우리를 괴롭하는 .now() 😄
'테스트하기 좋은 코드'를 고민할때 요런 제어할 수 없는 static 요소, 그중에서도 시간때문에 항상 고민이 많습니다.
저는 이번 wordle을 만들땐 호아님의 Wordle과 같은 역할을 하는 객체를 만들때 오늘날짜를 집어넣었어요. ㅋㅋㅋㅋㅋㅋ
게임도 오늘실행한 게임과 내일 실행한 게임이 다르겠지! 라고 생각해서요. 🥹
public class AlphabetTest { | ||
|
||
@Test | ||
void 알파벳은_대소문자를_구분하지_않는다() { |
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.
역시 테스트는 한글로 짜야 제맛이죠 😄
- 알파벳이 아닌 경우 재입력을 받는다. | ||
- 입력받은 문자와 정답을 비교한다. | ||
- 비교 결과는 타일이 초록색/노란색/회색 중 하나로 바뀌면서 표현된다. | ||
- 맞는 글자는 초록색, 위치가 틀리면 노란색, 없으면 회색 |
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.
리뷰를 다하고 돌아보니... 여기에 맞는글자는 초록색이라고 아예 설명을 정해두고 가셨던거였군요! ㅋㅋㅋㅋㅋ
컬러가 바뀌면 allBlue 요런 네이밍으로 전체이동...되는건가요 😉
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.
아이쿠 ㅎㅎㅎㅎ 뷰에 대한 책임을 대부분 콘솔에 몰아 놓고 메서드명에 박아버렸네요 수정해야겠어요!!
- 같은 문자 2개 -> n개
- 뷰에 의존적인 메서드명 수정
- 뷰에 의존적인 메서드명 수정
- processTurn -> processRound으로 변경 - isEnd대신 명시적으로 round가 끝났니?를 while 조건문에 걸어준다. - while 중간에 정답을 맞추는 게임 성공 표시로 true를 리턴하여 성공종료 메시지를 콘솔에 보여준다. - while 문이 끝날때까지 정답을 맞추지 못하면 false를 리턴하여 실패종료 메시지를 콘솔에 보여준다.
- Word 클래스에서는 input과 answer를 구분하지 않는다. 따라서 파라미터명을 헷갈리지 않도록 변경한다. - input -> word - inputWord -> targetWord
변경사항
|
잼아팀🔥 페어프로그래밍
배운점과 잘한점
넥텝 리뷰어이신 와잼님의 위대함을 느낄 수 있었습니다.. 특히 와잼님의 객체지향에 대한 철학과 코드 스타일은 정말 따라하고 싶을 정도로 배울점이 많았습니다.
프로덕션 코드를 짜기전, 테스트 코드를 먼저 짜는 TDD 방식으로 진행하였는데 확실히 테스트 코드가 탄탄하니, 부담없이 테스트를 돌려보며 리팩토링을 진행할 수 있었습니다. 테스트코드 짱짱 😎
저희팀은 객체지향 생활 체조 원칙 9가지를 빡빡하게 지켜보자는 약속을 갖고 페어를 진행했으며 동시에 getter를 최대한 지양해보려고 했는데 이 과정에서 더욱더 객체끼리 협력할 수 있는 코드가 나온것 같습니다!!
아쉬운점
서로 바쁜 시기라 더 많이 페어를 진행하니 못한 것이 아쉬웠습니다.. ㅠㅠ 오늘도 카페마감시간때문에.. 흑흑.. 파라미터 3개를 받는 부분을 해결했다면 더 좋았을거같네요..
제가 한 방향에 꽂히면 그게 옳고 그른지 판단력이 흐려지는데 해당 과정에서 저의 커뮤니케이션 방식(?)을 반성했습니다..!! (소프트스킬 책 읽어야겠네요.) 그래도 최대한 많은 의견을 수용해주신 와잼님께 감사를 🥹
시간을 고정하고자
staticMock
을 사용하였는데 요부분이 Gradle의 의존성을 추가해야하더라구요. 이미 추가한 상태에서 외부라이브러리를 사용하면 안되는 것을 알았던게 아쉬웠습니다.. 그래도 덕분에 실제 시간에 의존적이지 않은 테스트케이스를 작성할 수 있었습니다.많은 시간을 투자한 부분
첫날 페어를 진행하면서 용어사전을 정의하고 클래스다이어그램을 그리며 설계를 하면서 많은 시간을 쏟았습니다. 보다 복잡한 케이스는
ll현상
이라는 저희끼리만의 언어도 도출하기도 하였으며, 확실히 토론을 진행하며 의견을 나누니 서로 가지고있는 이해도 수준을 맞출 수 있었습니다.그 후 코드를 작성하면서는 가장 복잡했던
ll현상
.. 처음엔 Word를 비교하는 과정을 절차지향적으로 알고리즘 풀듯이 한번 구현한 후 나중에 리팩토링하는 형식으로 진행하였는데 해당 방식을 어떻게 하면 깔끔하게 풀어낼 수 있을지 고민하는데 시간을 많이 썼습니다. (미리 생각해왔어야했는데 뇌가 알고리즘 푸는데 적응이 되어서 그런지 잘 안되더라구요..)페어에게 하고 싶은 말
와잼님께 정말 질문을 많이 했던 것 같은데, 그럴 때마다 논리적으로 잘 설명해주셔서 너무너무 감사했습니다..!! 많은 인사이트를 얻어갈 수 있었어요. 항상 페어하는 시간이 기대되었고 끝나는 시간이 아쉬웠습니다 ㅜㅜ 다음번에 또 페어할 수 있는 기회가 있었으면 좋겠네요!! 일취월장하겠습니다!!! 💪🏻 넘넘 고생하셨어요 🙂