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

심미진 1주차 이론 제출 #8

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions .gitignore

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/.gitignore

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

Binary file added 1주차/mijin-img/01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1주차/mijin-img/02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
75 changes: 75 additions & 0 deletions 1주차/심미진.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
### 주제

> 라이브러리를 모킹하는 이유

### 배경

- 이상적인 개발 프로세스
- 기획 → 백엔드 개발 → 프론트 개발
- 현.실
- 기획 → 백엔드 개발 & 프론트 개발 동시 진행

**_→ 굉장히 비효율 적이다… 그래서 Mocking을 활용한다!!_**

### 테스트 종류

1. 단위 테스트: 작은 코드 단위 테스트
2. 통합 테스트: 여러 컴포넌트 or 시스템 통합 기능 검증
3. 시스템 테스트: 전체 시스템 기능, 성능, 종합 평가

### Mocking?

> 테스트 코드를 유연하게 작성하도록 하는 기술

- 가짜 객체 활용 → 의존성이 높은 객체 or 외부 시스템 테스트 쉽게 가능

### Mocking의 목적

테스트 하고자 하는 코드블록에서 사용 되는 외부 의존성 제거
→ 실제 객체 대신 가짜 객체로 의존성을 분리시키기 때문
→ 로직 개발에만 집중할 수 있다
→ 애플리케이션의 정확도화 효율성이 증가한다.

### Mocking 방법

1. 필요한 데이터 상태에 내부 로직을 붙여서 직접 Mocking한다
2. 별도 서버를 생성한다 → 비효율적..

→ 문제가 많다, 이걸 해결하기 위해서는 실제 네트워크 수준에서 Mocking하는 것이 필요하다.
→ 이걸 해결하기 위해 MSW를 사용한다.

### MSW?

> 서버 네트워크 요청을 가로채 모의 응답을 보내주는 API Mocking 라이브러리

**→ MSW가 이렇게 할 수 있는 이유는 Service Worker 덕분!!**

### Service Worker?

> 웹 어플리케이션의 메인스레드와 분리된 별도의 백그라운드 스레드에서 실행시킬 수 있는 기술

→ 애플리케이션 UI Block 없어도 연산 처리 및 네트워크 요청 가로채기가 가능함!

- 사용되는 곳
1. 백드라운드 동기화 기능
2. 높은 비용 계산 처리
3. Push Event
- 유의사항
- IE 브라우저 지원 안됨 ㅠㅠ
- HTTPS프로토콜 환경이어야 테스트 가능함

### MSW 동작 원리

![image.png](/1주차/mijin-img/01.png)

### **MSW를 활용한 개발 방식**

![image.png](/1주차/mijin-img/02.png)

### 결론

- TDD를 통해 버그를 조기 발견, 품질을 향상시킬 수 있다.
- API 없이도 프론트엔드 개발자는 기획자와 미리 프론트엔드 애플리케이션을 확인하며 피드백을 주고받고, 그 사이 백엔드 개발자는 API 개발을 진행 가능
→ 이후 백엔드 개발자가 API를 제공하면, 프론트엔드 개발자는 별다른 작업 없이 MSW를 스위치 오프만 하면 Production으로 배포할 수 있는 형태의 개발 과정을 통해 개발 진행 가능
- MSW는 디버깅이 필요한 상황에서도 좋은 시너지를 만들어 낼 수 있다.
→ 기획자 등 다른 누군가에게 각 화면을 공유하고 피드백을 받아야 하는 상황이 발생했을 때에도, 서비스 로직의 수정 없이도 MSW를 통해 제공이 가능.
1 change: 1 addition & 0 deletions 1주차/이지훈.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 1주차 이지훈 이론 공부 md
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
각 주차 branch 확인해주세요
# 이론 공부 공간
160 changes: 0 additions & 160 deletions biome.json

This file was deleted.

28 changes: 0 additions & 28 deletions eslint.config.js

This file was deleted.

13 changes: 0 additions & 13 deletions index.html

This file was deleted.

12 changes: 0 additions & 12 deletions jest.config.ts

This file was deleted.

2 changes: 0 additions & 2 deletions jest.setup.ts

This file was deleted.

48 changes: 0 additions & 48 deletions package.json

This file was deleted.

Loading