Skip to content

Comments

2주차 과제 다시 구현했습니다.#1

Open
cladren123 wants to merge 60 commits intoreviewfrom
study
Open

2주차 과제 다시 구현했습니다.#1
cladren123 wants to merge 60 commits intoreviewfrom
study

Conversation

@cladren123
Copy link
Owner

No description provided.

Copy link

@choheejin choheejin left a comment

Choose a reason for hiding this comment

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

구현하느라 고생많으셨습니다! ☺️

* 무작위 값을 발생시켜 4보다 크면 전진 합니다.
*/
public void move() {
int number = Randoms.pickNumberInRange(0, 9);

Choose a reason for hiding this comment

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

0, 9 를 상수로 만들어주면 좋을 것 같아요!

Copy link
Owner Author

Choose a reason for hiding this comment

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

인정합니다.

Comment on lines +35 to +39
public static void validateBlank(String input) {
if(input == null || input.equals("")) {
throw new IllegalArgumentException(ErrorMessage.BLANK.getMessage());
}
}

Choose a reason for hiding this comment

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

input.isBlank()를 이용하여 보다 쉽게 검증할 수 있을거 같아요!

Copy link
Owner Author

Choose a reason for hiding this comment

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

좋은 방법 감사합니다!

Choose a reason for hiding this comment

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

제가 프리코스를 하면서 받은 피드백 중 하나인데요.
Validate 클래스를 이용하여 검증 코드를 하나로 모아 가독성을 높일 수 있지만,
보다 큰 프로젝트를 구성하게 될 때, 검증 코드를 하나의 클래스로 모으게 된다면 클래스가 너무 무거워질 것 같다는 피드백을 받았었습니다.
이에 대해서 동언님은 어떻게 생각하시나요? ☺️

Copy link
Owner Author

Choose a reason for hiding this comment

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

프로젝트가 커지면 Validate를 여러 개로 나눌 거 같습니다.
어떤게 좋은 방법일까요?

Choose a reason for hiding this comment

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

3주차 피드백에서 단위 테스트하기 어려운 코드를 단위 테스트하기 부분에
https://tecoble.techcourse.co.kr/post/2020-05-07-appropriate_method_for_test_by_parameter/
이 포스트를 읽으신다면 해당 피드백을 적용할 수 있을것 같아요!

Copy link
Owner Author

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.

2 participants