Skip to content

Conversation

@mudark
Copy link

@mudark mudark commented Mar 25, 2025

No description provided.

Copy link

@ImTotem ImTotem left a comment

Choose a reason for hiding this comment

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

수고했습니다.
리뷰 확인해주세요

}
return winnerList;
}
} No newline at end of file
Copy link

Choose a reason for hiding this comment

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

Comment on lines 9 to 10
@DisplayName("실행")
@Test
Copy link

Choose a reason for hiding this comment

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

이 프로그램 진입점은 테스트를 위한 코드가 아닌데 Test를 붙인 이유가 있을까요?

Copy link
Author

Choose a reason for hiding this comment

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

테스트 관련해서 이것저것 알아보다 추가하고 방치한 것 같네요.

public static void main(String[] args) {
// TODO: 프로그램 구현
System.out.println("경주할 자동차 이름을 입력하세요.(이름은 쉼표(,) 기준으로 구분)");
String input=Console.readLine();
Copy link

Choose a reason for hiding this comment

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

가독성을 생각해보면 좋을거 같아요
자바 코딩 컨벤션에 대해 찾아보세요~

Comment on lines 22 to 23
}catch(IllegalArgumentException e) {
System.out.println("잘못된 값이 입력되어서 종료합니다.");
Copy link

Choose a reason for hiding this comment

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

IllegalArgumentException이 발생하면 알아서 종료될건데 catch해서 다시 print 해주고 종료하는 이유가 있나요?

print보단 커스텀 exception을 만들어서 종료해보는건 어떨까요


import static org.assertj.core.api.Assertions.*;

public class RacingCar {
Copy link

Choose a reason for hiding this comment

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

RacingCar로 네이밍한 이유가 있나요?
RacingCar보다는 RacingGame 같은게 더 알맞지 않을까요? 아니면 RacingCars로 여러대를 포함하고 있음을 알려주는게 좋을 것 같다고 생각해요.

Copy link
Author

Choose a reason for hiding this comment

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

해당 변수명 뭘로 할까 고민하다 생각 안 나서 그냥 RacingCar로 한 걸로 기억합니다.

Comment on lines 20 to 21
input=Console.readLine();
n= getTurn(input);
Copy link

Choose a reason for hiding this comment

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

input을 가져오는것도 getTurn의 일부로 볼 수 있지 않을까요?

int distance;

public Car(String name) {
name=name.replaceAll(" ","");
Copy link

Choose a reason for hiding this comment

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

공백을 없애준 이유가 있나요?

이름의 앞과 맨 마지막에 잘못 들어간 공백만 지워주는건 어떤가요?

Comment on lines 45 to 46
winnerList=winnerList.concat(car[i].name);
winnerList=winnerList.concat(", ");
Copy link

Choose a reason for hiding this comment

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

StringBuilder에 대해 알아보면 좋을거 같아요~

assertThatThrownBy(() -> runException("pobi,javaji", "1"))
.isInstanceOf(IllegalArgumentException.class)
assertThatCode(() -> runException("pobi,javaji", "1"))
.doesNotThrowAnyException()
Copy link

Choose a reason for hiding this comment

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

여러 예외 상황이 있었을건데 최대한 많은 부분에 대해서 테스트 해보면 좋을것 같아요.

@mudark mudark changed the title [김민석_Backend] 1주차 과제 제출합니다. [김민석_Backend] 2주차 과제 제출합니다. Apr 1, 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.

2 participants