-
Notifications
You must be signed in to change notification settings - Fork 70
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
[자동차 경주] 임아리 미션 제출합니다. #78
Open
dldb-chamchi
wants to merge
26
commits into
next-step:dldb-chamchi
Choose a base branch
from
dldb-chamchi:step1
base: dldb-chamchi
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
수고많으셨습니다!! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
느낀점
이번 학습 주 목표는 MVC패턴 학습이었습니다. 처음 적용 해보았기 때문에 시행착오가 많았습니다. 특히 어떤 방식으로 view, model, controller를 나누어야할지 잘 몰랐습니다. controller가 무슨 역할을 하는지 이해하지 못했는데 많은 검색과 예제를 통해 게임할 때 사용하는 컨트롤러와 유사하다는 깨달음을 얻어 MVC패턴을 적용해보았습니다. 아직 미숙해서 제대로 잘 되었을지는 모르겠습니다...
MVC 패턴
MVC패턴을 적용하기 전에는 코드가 매우 복잡하고 가독성이 떨어졌습니다. 또한 어떻게 단위 테스트 코드를 작성할지가 가장 문제였습니다. 하지만 리팩터링을 하면서 MVC패턴을 적용한 뒤에는 코드가 깔끔해졌고 단위 테스트를 어떻게 적용할지에 대한 생각도 떠올랐습니다. 학습한 바로는 수정이 용이하고 유지보수가 좋다는 장점을 가지고 있는데 확실히 그런 것 같습니다. 서로 의존하는 부분이 없으니 수정을 해도 많이 바뀌지 않았습니다.
요구사항
이번 요구사항에서 인상 깊었던 점은 depth가 1이하이어야 한다는 점이었습니다. depth가 1이하를 요구한다는 점은 모듈화를 잘할 수 있는지를 테스트 하는 것이라 생각했습니다. 실제로 코드를 작성하면서 모듈화를 해야할 부분이 많지는 않았지만 어느정도는 있었습니다. 간단한 부분은 쉬웠지만 게임에서 승리한 자동차를 찾을 때 조금 복잡한 코드라 모듈화가 들어가야했습니다. 하지만 모듈화를 하니 굉장히 코드가 더러워졌고, 그에 생각해낸것이 스트림 라이브러리였습니다. 아직은 미숙하지만 서치와 IDE의 도움을 받아 작성해보았습니다.
아쉬운 점
요구사항에는 UI부분은 제외하고 모든 로직에 단위 테스트를 구현하라하였습니다. 하지만 솔직히 어떻게 랜덤 값을 테스트하고 적용하는지는 아직까지 잘 모르겠습니다. 또한 모든 로직에 구현하라는 것이 어떻게 하라는지 예시를 생각해낼 수 없어 더욱 힘들었습니다. (검색을 해봤는데 Mock을 통한 테스트 라는 것이 있다는데 솔직히 잘 이해하지 못해서 적용하지는 못했습니다.)그래서 이번 경우에는 테스트를 2개 밖에 작성하지 못했습니다. 후에 피드백이 들어오면 더 작성해보려 합니다.
집중 피드백 받고 싶은 점
MVC패턴이 잘 되어있는지와 그에 관해 더욱 개선할 점을 피드백 받고 싶습니다. 또한 이런 랜덤 값을 테스트할 경우에 생각해낼 수 있는 단위 테스트들의 예시를 알고 싶습니다. (제가 작성한 단위 테스트가 올바른지도 확인 받고 싶습니다)