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

Step3 #6123

Merged
merged 6 commits into from
Mar 25, 2025
Merged

Step3 #6123

merged 6 commits into from
Mar 25, 2025

Conversation

myj4513
Copy link

@myj4513 myj4513 commented Mar 25, 2025

No description provided.

Copy link
Member

@nooose nooose left a comment

Choose a reason for hiding this comment

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

예준님 3단계 너무 잘 끝내주셨네요 👍
크게 리뷰 드릴 부분은 없는 것 같아서
바로 머지할게요
수고하셨습니다!

import racingcar.view.InputView;
import racingcar.view.ResultView;

public class Main {
Copy link
Member

Choose a reason for hiding this comment

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

테스트 케이스 잘 작성해 주신 것 처럼
README.md 에도 내가 처리할 요구사항을 먼저 정리해 보면 어떨까 싶어요!

  • 기능을 구현하기 전에 README.md 파일에 구현할 기능 목록을 정리해 추가한다.
  • git의 commit 단위는 앞 단계에서 README.md 파일에 정리한 기능 목록 단위로 추가한다.
    참고문서: AngularJS Commit Message Conventions

Comment on lines +8 to +9
RacingGame racingGame = new RacingGame(new InputView(), new ResultView(), new JavaUtilRandomNumberGenerator());
racingGame.play();
Copy link
Member

Choose a reason for hiding this comment

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

👍 👍


import java.util.Random;

public class JavaUtilRandomNumberGenerator implements RandomNumberGenerator {
Copy link
Member

Choose a reason for hiding this comment

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

인터페이스 도출된 것은 너무 좋은데 네이밍이 쪼끔 아쉽네요!
BoundaryRandomNumberGenerator 같은 네이밍을 주면 더 자연스럽지 않을까요?

new BoundaryRandomNumberGenerator(범위)

참고만 해주세요~

Comment on lines +18 to +19
@CsvSource({"2,false", "3,false", "4,true", "5,true", "6,true", "7,true", "8,true"})
public void carIsMovableWhenRandomLTE4(int random, boolean expected) {
Copy link
Member

Choose a reason for hiding this comment

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

👍 👍

만약 범위가 1에서 1억 사이라면
모든 범위를 테스트하기에는 불가능할 것 같아요

4라는 수에 경계를 두고 전후만 체크한다면 어떨까요?

Comment on lines +3 to +13
public class StubRandomNumberGenerator implements RandomNumberGenerator {
private int fixedValue;

public void setFixedValue(int fixedValue) {
this.fixedValue = fixedValue;
}

@Override
public int generate(int max) {
return fixedValue;
}
Copy link
Member

Choose a reason for hiding this comment

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

테스트 제어 객체 너무 좋습니다! 👍

Comment on lines +21 to +26
public void play() {
inputView.initGameInput();
initializeCars(inputView.getNumberOfCars());
runRace(inputView.getAttemptCount());
resultView.printResult();
}
Copy link
Member

Choose a reason for hiding this comment

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

이미 MVC 패턴에 익숙하신 것 같네요 😄

Copy link
Member

Choose a reason for hiding this comment

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

출력을 담당하는 객체가 상태를 계속 변경하고 유지하는 것보다는,
모델을 전달받아 출력만 담당하도록 설계하는 것이 더 나을 것 같습니다.

상태가 없다면 동일한 입력에 대해 항상 같은 출력을 보장할 수 있지 않을까요?

@nooose nooose merged commit 1172a63 into next-step:myj4513 Mar 25, 2025
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