-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
3단계 - 자동차 경주 #5053
base: areumj0507
Are you sure you want to change the base?
3단계 - 자동차 경주 #5053
Conversation
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단계 구현하시느라 수고많으셨습니다.
몇가지 코멘트 남겨두었는데 확인후에
다시 리뷰요청 부탁드려요!
private static final String NUMBER = "number"; | ||
private static final String COUNT = "count"; | ||
|
||
public static Map<String, Integer> inputResult() { |
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.
Map 이 꼭 필요한 형태가 아닌것 같아요 🥲
자동차대수를 입력받는메서드와 횟수를 입력받는 메서드 두가지로 나누면 좋을것 같습니다
private static final String NUMBER = "number"; | ||
private static final String COUNT = "count"; | ||
|
||
public static void start() { |
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.Map; | ||
import java.util.Random; | ||
|
||
public class CarRacingMain { |
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.Map; | ||
|
||
public class ResultView { |
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.
과정을 진행하면서 Map 과 배열은 사용하지 않는걸 추천드립니다.
String[][] 2차원배열의 경우엔 현재 각 어떤값이 들어가있는지 코드를 다 따라가서 확인하지 않으면
이해하기 어려운것 같아요.
필요하다면 별도 DTO 등의 형태로 클래스를 만들어보시면 좋을것 같습니다.
public void testConcat() { | ||
ResultView.concat(0, 0, "-"); | ||
ResultView.concat(1, 0, ""); | ||
assertThat(ResultView.value()[1][0]).isEqualTo("-"); |
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.
만약 출력시 대쉬가 아닌 *
을 사용해야한다면 테스트코드 자체가 변경되어야하는구조입니다.
테스트코드와 객체(도메인) 는 출력에 의존적이지 않은 형태로 고민해보시면 좋을것 같습니다.
추가적으로 코멘트 남깁니다. 현재 코드가 객체지향적이지 않고 메서드만 존재하여 절차지향적으로 작성되어있습니다. 힌트를 드리자면 객체지향적설계와 요구사항의 내용들은 모두 구현해보시는데 초점을 맞춰보시면 좋을것 같습니다. |
단위 테스트를 구현하는 데 어려움이 있네요😅
코멘트 및 피드백 부탁드립니다!