Skip to content

Commit 0542293

Browse files
committed
revert changes on the english files
1 parent 520e52b commit 0542293

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

sections/testingandquality/refactoring.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,30 @@
44

55
### One Paragraph Explainer
66

7-
리팩토링은 반복적인 개발 흐름에서 중요한 과정이다. 중복 코드, 긴 메서드, 긴 매개 변수 목록과 같은 "코드 스멜"(불량 코딩 관행)을 제거하면 코드가 향상되고 유지 관리가 더욱 용이해집니다. 정적 분석 도구를 사용하면 이러한 코드 스멜을 찾고 리팩토링에 대한 프로세스를 구축하는 데 도움이 됩니다. CI 빌드에 이러한 도구를 추가하면 품질 검사 프로세스를 자동화하는 데 도움이 됩니다. CI가 소나 또는 코드 기후와 같은 도구와 통합될 경우 코드 스멜을 감지하고 작성자에게 문제 해결 방법을 알려주면 빌드가 실패합니다. 이러한 정적 분석 도구는 ESLint와 같은 보풀 도구를 보완합니다. 대부분의 보풀 도구는 단일 파일에서 들여쓰기와 누락된 세미콜론과 같은 코드 스타일(일부는 긴 함수처럼 코드 냄새가 나기도 함)에 초점을 맞추고 정적 분석 도구는 단일 파일과 여러 파일에 있는 코드 냄새(중복 코드, 복잡성 분석 등)를 찾는 데 초점을 맞춥니다.
7+
Refactoring is an important process in the iterative development flow. Removing "Code Smells" (bad coding practices) such as Duplicated Code, Long Methods, Long Parameter list will improve your code and making it more maintainable. Using a static analysis tools will assist you in finding these code smells and build a process around refactoring. Adding these tools to your CI build will help automate the quality checking process. If your CI integrates with a tool like Sonar or Code Climate, the build will fail if it detects code smells and inform the author on how to address the issue. Theses static analysis tools will complement lint tools such as ESLint. Most linting tools will focus on code styles like indentation and missing semicolons (although some will find code smells like Long functions) in a single file while static analysis tools will focus on finding code smells (duplicate code, complexity analysis, etc) that are in single files and multiple files.
88

99
<br/><br/>
1010

11+
1112
### Martin Fowler - Chief Scientist at ThoughtWorks
1213

13-
, "JavaScript 수정: 불량 코드를 정상 코드로 변경"
14+
From the book, "Refactoring - Improving the Design of Existing Code"
1415

15-
> 리팩토링은 기존 코드베이스의 설계를 개선하기 위한 통제된 기술이다.
16+
> Refactoring is a controlled technique for improving the design of an existing code base.
1617
1718
<br/><br/>
1819

1920
### Evan Burchard - Web Development Consultant and Author
2021

21-
, "JavaScript 수정: 불량 코드를 정상 코드로 변경"
22+
From the book, "Refactoring JavaScript: Turning Bad Code into Good Code"
2223

23-
> 사용하는 프레임워크나
24-
> "컴파일-투-JS" 언어 또는 라이브러리가 무엇이든
25-
> 자바스크립트의 기본 품질이 낮으면 버그와 성능에 대한 우려는 항상 문제가 됩니다.
24+
> No matter what framework or
25+
“compiles-to-JS” language or library you use, bugs and performance concerns
26+
will always be an issue if the underlying quality of your JavaScript is poor.
2627

2728
<br/><br/>
2829

29-
### Example: Complex methods analysis with CodeClimate (commercial)
30+
### Example: Complex methods analysis with CodeClimate (commercial)
3031

3132
![alt text](../../assets/images/codeanalysis-climate-complex-methods.PNG "Complex methods analysis")
3233

@@ -38,4 +39,5 @@
3839

3940
![alt text](../../assets/images/codeanalysis-sonarqube-dashboard.PNG "Code analysis history")
4041

42+
4143
<br/><br/>

sections/testingandquality/test-middlewares.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
### One Paragraph Explainer
66

7-
미들웨어 테스트는 시스템의 작은 부분을 차지하며 라이브 Express 서버가 필요하기 때문에 대부분 미들웨어 테스트를 회피합니다. 두 가지 이유 모두 틀렸습니다. 미들웨어는 작지만 요청의 전부 또는 대부분에 영향을 미치며 '{req,res}' JS 개체를 가져오는 순수 함수로 쉽게 테스트할 수 있습니다. 미들웨어 함수를 테스트하려면 해당 함수를 호출하고 {req,res}개 개체와의 상호 작용에 대해 [예를 들어 Sinon 사용](https://www.npmjs.com/package/sinon)))을 스파이하여 함수가 올바른 동작을 수행했는지 확인해야 합니다. 라이브러리 [node-controls-products](https://www.npmjs.com/package/node-mocks-http)는 더 나아가서 {req,res}개의 객체의 동작에 대한 스파이 활동과 함께 인자를 분석합니다. 예를 들어 res 개체에 설정된 http 상태가 예상과 일치하는지 여부를 주장할 수 있습니다(아래 예 참조).
7+
Many avoid Middleware testing because they represent a small portion of the system and require a live Express server. Both reasons are wrong — Middlewares are small but affect all or most of the requests and can be tested easily as pure functions that get `{req,res}` JS objects. To test a middleware function one should just invoke it and spy ([using Sinon for example](https://www.npmjs.com/package/sinon)) on the interaction with the {req,res} objects to ensure the function performed the right action. The library [node-mock-http](https://www.npmjs.com/package/node-mocks-http) takes it even further and factors the {req,res} objects along with spying on their behavior. For example, it can assert whether the http status that was set on the res object matches the expectation (See example below)
88

99
<br/><br/>
1010

@@ -20,11 +20,11 @@ test("A request without authentication header, should return http status 403", (
2020
method: "GET",
2121
url: "/user/42",
2222
headers: {
23-
authentication: "",
24-
},
23+
authentication: ""
24+
}
2525
});
2626
const response = httpMocks.createResponse();
2727
unitUnderTest(request, response);
2828
expect(response.statusCode).toBe(403);
2929
});
30-
```
30+
```

0 commit comments

Comments
 (0)