generated from cotes2020/chirpy-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
80 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
--- | ||
layout: post | ||
title: "[SRE] Ch17. Testing for Reliability" | ||
date: 2023-08-30 | ||
categories: | ||
- Study | ||
- Book | ||
- SRE | ||
tags: [ | ||
sre, | ||
google, | ||
devops, | ||
study, | ||
book, | ||
reliable, | ||
] | ||
--- | ||
|
||
**κ²°λ‘ : ν μ€νΈλ μμ§λμ΄λ€μ΄ μμ μ μ νμ μ λ’°μ±μ ν₯μμν¬ μ μλ κ°μ₯ μ μ ν ν¬μ μλ¨μ΄λ€.** | ||
|
||
- ν μ€νΈμ μ’ λ₯λ κ΅μ₯ν μ¬λ¬κ°μ§κ° μλλ°, μ λ’°μ±μ μ¬λ¦¬κΈ° μν΄μ λλ΅μ μΌλ‘ ν μ€νΈμ μ’ λ₯μ μ€μλμ λν΄μ μ€λͺ νκ³ μλ€. | ||
- ν μ€νΈλ μ΄λ€ λ³κ²½ μ¬νμ΄ μΌμ΄λ¬μ λ νΉμ λΆλΆμμ λμΌν κ²°κ³Όλ₯Ό κΈ°λν μ μλ€λ κ²μ 보μ¬μ£ΌκΈ° μν λ©μ»€λμ¦μ΄λ€. | ||
|
||
# μννΈμ¨μ΄ ν μ€νΈμ μ’ λ₯ | ||
|
||
## μ ν΅μ μΈ ν μ€νΈ | ||
|
||
- μννΈμ¨μ΄λ₯Ό κ°λ°νλ λμ μννΈμ¨μ΄κ° μ¬λ°λ₯Έ λμμ μννλμ§ μ¬λΆλ₯Ό νκ°νλ `ν μ€νΈ` | ||
|
||
### Unit Test | ||
|
||
- ν΄λμ€λ ν¨μ λ±μ ν μ€νΈνμ¬ κ° λμμ λ 립μ μΌλ‘ ν μ€νΈνλ λ°©λ² | ||
- μ£Όλ‘ `TDD` λ°©λ²λ‘ κ³Ό ν¨κ» μ¬μ©λ¨ | ||
- **dependency κ° μμ λλ μ΄λ»κ²?** | ||
- *β Dependency Injection μ¬μ©. Dagger μ κ°μ ν΄μ μ¬μ©ν΄μ Mock κ°μ²΄λ₯Ό μμ±νμ¬ μν* | ||
|
||
### Integration Test | ||
|
||
- λ¨μ ν μ€νΈλ₯Ό ν΅κ³Όν μννΈμ¨μ΄ μ»΄ν¬λνΈλ κ·Έλ³΄λ€ λ ν° κ·λͺ¨μ μ»΄ν¬λνΈμ νΈμ λλλ°, μ΄λ μννλ ν μ€νΈκ° `ν΅ν© ν μ€νΈ`μ | ||
|
||
### System Test | ||
|
||
- μμ§ λ°°ν¬κ° μλ£λμ§ μμ μμ€ν μ λν΄ μμ§λμ΄κ° μνν μ μλ κ°μ₯ ν° κ·λͺ¨μ ν μ€νΈ. | ||
- **Smoke Test** | ||
- *μ μ νλ‘ κΈ°νμ μ μμ λ£μμ λ κΈ°νμμ μ°κΈ°κ° λλμ§ νμΈνλ ν μ€νΈμμ μ λλ¨.* μ¦, μμ μ±μ μ μ§νκΈ° μν΄μ μ£Όμ κΈ°λ₯λ€μ΄ μ λλ‘ μλνλμ§ νμΈ | ||
- μμ μ± κ²μ¬ (Sanity Test) λ‘ μλ €μ Έ μμΌλ©°, μ½κ°μ μ₯μ μν©μ κ°μ ν ν μ€νΈλ₯Ό ν¬ν¨ν΄μ λ λ§μ λΆλΆμ ν μ€νΈ ν¨ | ||
- **Performance Test** | ||
- μ±λ₯ ν μ€νΈ | ||
- **Regression Test** | ||
- μ΄λ―Έ μλ €μ§ λ²κ·Έλ€μ ν΅ν΄ μμ€ν μ μ€ν¨λ μλͺ»λ κ²°κ³Όκ° λνλλ κ²μ μ μΆνλ ν μ€νΈ. | ||
|
||
## νλ‘λμ ν μ€νΈ | ||
|
||
- μ€μ λμνλ μΉ μλΉμ€μ λν΄ λ°°ν¬λ μννΈμ¨μ΄ μμ€ν μ΄ μ¬λ°λ₯΄κ² λμ μ€μΈμ§λ₯Ό νλ¨νλ ν μ€νΈ | ||
- **Black Box ν μ€νΈ**λΌκ³ λ λΆλ¦ | ||
|
||
### μ€μ ν μ€νΈ | ||
|
||
- μ€μ νλ‘λμ νκ²½μμ λμνλ νΉμ λ°μ΄λλ¦¬κ° μ€μ λ‘ μ΄λ»κ² μ€μ λμ΄ μλμ§λ₯Ό νμΈνκ³ ν΄λΉ μ€μ νμΌκ³Ό μΌμΉνμ§ μλ λΆλΆμ μ°Ύμ λ³΄κ³ ν¨ | ||
|
||
### μ€νΈλ μ€ ν μ€νΈ | ||
|
||
- μμ€ν μ ꡬμ±νλ μ»΄ν¬λνΈλ€μ νκ³λ₯Ό μ΄ν΄νκΈ° μν¨. | ||
- μμ | ||
- DB μ©λμ΄ μ΄λ μ λμ λ€λ€λ₯΄λ©΄ μ°κΈ° μμ μ μ€ν¨νλκ°? | ||
- μλ²λ μ΄λΉ λͺ κ°μ 쿼리κΉμ§ μλ΅ν μ μλκ°? | ||
|
||
### μΉ΄λ리 ν μ€νΈ | ||
|
||
- μλ²μ μΌλΆλ§μ μλ‘μ΄ λ²μ μ λ°μ΄λ리λ μ€μ νμΌλ‘ μ κ·Έλ μ΄λν ν, μΌμ κΈ°κ° λμ μ΄ν΄λ³΄λ ννλ‘ μ§ν | ||
|
||
# ν μ€νΈ λ° λΉλ νκ²½ ꡬμ±νκΈ° | ||
|
||
- **μΌλ°μ μΌλ‘ μ΄κΈ° μ€κ³ λΆν° ν μ€νΈ 컀λ²λ¦¬μ§ 100νλ‘λ₯Ό λ¬μ±νλ©΄μ νλ‘μ νΈλ₯Ό μννλ κ²½μ° (TDD) λ μ μμ.** | ||
- λΏλ§ μλλΌ SRE μμ§λμ΄λ€μ λλΆλΆ νλ‘μ νΈκ° νμ°½ μ§ν μ€μΌ λ ν©λ₯νκΈ° λλ¬Έμ, μ΄λ λΆλΆλΆν° ν μ€νΈλ₯Ό μμν΄μΌνλμ§ νλ¨νλ λΆλΆμ΄ μ€μν¨ | ||
- **κ³ λ €ν΄μΌν μ λ€** | ||
- μ΄λ€ ννλ‘λ μ€μλλ₯Ό μΈ‘μ ν΄μ μ»΄ν¬λνΈλ€μ μ°μ μμλ₯Ό κ²°μ ν΄μΌν¨ | ||
- μ¬νμ΄ κ±Έλ €μκ±°λ, λΉμ§λμ€ κ΄μ μμ μ€μν κΈ°λ₯μ΄λ ν΄λμ€λ₯Ό νΉμ ν μ μλμ§? | ||
- λ€λ₯Έ νλ€μ΄ ν΅ν©ν΄μ μ¬μ©νλ APIλ€μ΄ μλμ§? | ||
- β **κ°μ₯ κ°λ ₯ν ν μ€νΈ λ¬Έν μ립 λ°©λ²μ μ§κΈκΉμ§ λ³΄κ³ λ λͺ¨λ λ²κ·Έλ₯Ό ν μ€νΈ μΌμ΄μ€μ ννλ‘ λ¬Έμννκ³ ,** `regression Test` **μ ν¬ν¨μμΌμΌν¨** |