티스토리 뷰

반응형

code quality란?

1. 코드가 해야 할 일을합니다.

2. 코드에 결함이나 문제점이 없어야 합니다

3. 코드가 읽기 쉽고, 유지와 확장성이 좋아야 합니다.


code quality를 향상 시키기 위해선?

1. Test

- 1번과 2번을 향상

- Testing Tool

: Unit Test - Jest

: Integration Test

: End to End Test (front end to back end)


2. Linter

- 2번과 3번을 향상

- Airbnb Style Guide : https://github.com/airbnb/javascript

- Logical Lint

코드에 오류가 있는지 확인

: 잠재적으로 의도하지 않은 결과가 있는 코드 확인

: 위험한 코드 패턴이 있는지 확인

- When

: IDE 용 코드 - 플러그인을 작성할 때

: 드를 커밋 할 때 - Git hooks

: 테스트를 실행할 때 - CI

- ESlint : Logical & Stylistic Linting


Jest

- DOCS : https://jestjs.io/

- 함수 정리 : https://flaviocopes.com/jest/#run-jest-with-vs-code

To Do 

1. install Jest on your root folder.

2. Go to test-example folder, check what fucntionts in math.js do.

3. Go to test-exmpalge/__test__ foler and create test cases on math.js.

4. Check your test cases run correctly by typing npm run test:example on your terminal.


ESlint 

- DOCS : https://eslint.org/

- 참고 사이트 

https://flaviocopes.com/eslint/

https://hackernoon.com/how-to-use-eslint-in-node-js-applications-cc4b2298ce55

- To Do

1. Configure ESlint extends property to "recommended". 

2. Integrate ESlint to your Editor.

3. ADVANCE Integrate ESlint to Git Precommit Hook (Do not use any framework).


반응형

'DevEnv' 카테고리의 다른 글

node debugger  (0) 2019.03.05
VScode에서 리눅스 Bash 연동 하기  (0) 2019.02.12
톰캣(tomcat) 설치  (0) 2018.08.21
이클립스 다운로드  (0) 2018.08.20
자바 jdk 다운로드  (0) 2018.08.20
댓글