Skip to content
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

[4기][3주차] Wordle 과제 제출 - 스페셜 #15

Open
wants to merge 38 commits into
base: main
Choose a base branch
from

Conversation

rkd5656
Copy link

@rkd5656 rkd5656 commented Apr 2, 2023

  • Pair 정보 : Jonh님
  • Pair Programing 사용 툴 : Code With Me
    • Code With Me를 통해 John 님의 컴퓨터로 진행하였고, John님이 저와 John님의 Git Repository에 두번 푸쉬하는 방법으로 진행하였습니다.
      • git remote add pair
      • git push origin main & git push pair main
  • 느낀점
    • 둘이서 진행을 하니 몇 시간 동안 상당히 집중을 할 수 있었고 중간에 쉬지 않고 앞으로 나아갈 수 있어서 좋았습니다.
    • 중간 중간 저와 다르게 생각하는 부분들이 굉장히 재밌었고, 제 것으로 흡수하기에 좋았던 것들도 굉장히 많아 좋았습니다.
    • 저의 부족한 점을 굉장히 많이 느꼈습니다. 항상 되기만 하면 되는 코딩을 해왔던 저이기에 많이 부족하단 것을 깨달았고, John님 덕에 테스트, 객체 지향적인 설계 등 정말 많은 것을 배울 수 있어서 저에게는 정말 뜻 깊은 시간 이었던 것 같습니다.

jhsong2580 and others added 30 commits March 24, 2023 20:08
Copy link

@jimbaemon jimbaemon left a comment

Choose a reason for hiding this comment

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

클래스 분리를 잘해 두셔서 보기 좋았습니다 :)
저희팀은 너무 건성하게 한건 아닌지 반성하게 되네요 ㅋㅋㅋㅋ
일부 생각해볼만한 내용 피드백 남겨뒀습니다. 확인 부탁드립니다. 🙇‍♂️

import com.wodle.domain.Word;
import java.util.NoSuchElementException;

public class InputManager {

Choose a reason for hiding this comment

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

서비스 보다는 ui 성격에 가까운 기능이 아닐까 싶습니다 :)

String userInput = Console.readLine();
return new Word(userInput);
} catch (IllegalArgumentException e) {
throw e;

Choose a reason for hiding this comment

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

IllegalArgumentException은 이미 RuntimeException에 속하기 때문에 throw 만을 처리하는 코드를 구지 추가할 필요가 있을까 싶네요

Copy link
Author

Choose a reason for hiding this comment

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

오 좋은 꿀팁 감사합니당.


import java.util.regex.Pattern;

public class StringUtils {

Choose a reason for hiding this comment

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

Util 성에 static 만 사용할거라면 private 생성자를 통해 instance 생성을 막는게 좋아보입니다.
다른 유틸 클래스도 적용해주면 좋을 것 같습니다 :)

private StringUtils(){
        }

Copy link
Author

Choose a reason for hiding this comment

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

최근 넥스트 스텝 강의에서 배웠는데.. 여기에 바로 있네요 ㅋㅋㅋㅋ

@@ -0,0 +1,21 @@
# 기능 명세

### 정답 단어 추출하기

Choose a reason for hiding this comment

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

Function 에 대한 정의 javadoc 을 활용해 보셔도 좋을것 같습니다 :)
https://johngrib.github.io/wiki/java/javadoc/

Copy link
Author

Choose a reason for hiding this comment

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

오우 감사합니당!

return new GameMachine(word, START_COIN);
}

private static class GameMachine {

Choose a reason for hiding this comment

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

GameMachine 은 서비스에 가까운 기능 같아요.
클래스를 아에 분리하고 기능을 위임하는 식으로 처리하면 어떨까 싶네요 :)

//when
boolean isGameEnd = result.isGameEnd();

assertThat(isGameEnd).isFalse();

Choose a reason for hiding this comment

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

//then


//then
assertAll(
() -> assertThat(wordStr).isEqualTo("abcde"),

Choose a reason for hiding this comment

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

get한 값을 확인해도 괜찮지만 인스턴스 자체를 equals() 메소드를 이용해서 비교해 보는것도 좋을 것 같습니다 :)

assertThatThrownBy(
() -> new Word("abcd2")
).isInstanceOf(IllegalArgumentException.class)
.hasMessage("user input require 5 small alphabet");

Choose a reason for hiding this comment

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

좋네요 :)

Word word = inputManager.inputWord();

//then
assertThat(word.getWord()).isEqualTo("abcde");

Choose a reason for hiding this comment

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

인스턴스 equals 를 이용한 검증이 좋아 보입니다 :)

assertThat(word).isEqualTo(new Word("abcde"));

public void init() {
super.init();

wordsGenerator = new WordsGenerator();

Choose a reason for hiding this comment

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

인터페이스로 처리하셨으면 조금더 테스트 하기 용이하셨을것 같아요.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants