13. Intro to QA Testing
Learning Goals
- Testing์ (๋น๊ตฌ์กฐ์ ) ์ฐจ์์์ coverage๋ฅผ ๋ฌ์ฑํ๊ธฐ ์ํ ํ๋์ผ๋ก ๊ฐ์ฃผ
- Usability, reliability, security, robustness (์ผ๋ฐ ๋ฐ ์ํคํ ์ฒ), performance, integration๊ณผ ๊ฐ์ ํ์ง ์์ฑ ํ๊ฐ๋ฅผ ์ํ testing ์ ๋ต ์ด๊ฑฐ
- Trade-off๋ฅผ ์ ์ํ๊ณ ๊ฐ technique์ด ์ ์ฉํ ์ ์๋ ์์ ์๋ณ
- Testing์ ํ๋ก์ ํธ์ lifecycle ๋ฐ practice์ ํตํฉ
- Test plan ๊ฐ์ ์์ฑ
Quality Assurance (QA) is HARD
- QA & Software Testing์ MS์์ ๋์ ์ ์ธ ๊ณผ์
- Microsoft์ ๊ฐ์ ๋ํ ์์ฉ ์ํํธ์จ์ด ํ์ฌ์์๋ development๋งํผ testing ์ํ
- Developer๋งํผ ๋ง์ tester ๋ณด์ . Tester๋ ํญ์ testing ์ํ, developer๋ ์ฝ ์ ๋ฐ์ ์๊ฐ์ testing ๊ณผ์ ์ ์ฐธ์ฌ
- Test case๋ ๋งค์ฐ ๋น์. ํ๋ก๊ทธ๋จ ์์ฒด๋ณด๋ค test harness์ ๋ ๋ง์ code ๋ผ์ธ ์กด์ฌ (์ข ์ข ์ฝ 3:1 ๋น์จ)
- Time Estimates (in hours):
| Activity | Estimated | Actual |
|---|---|---|
| Testing plans | 3 | 0 |
| Unit testing | 3 | 1 |
| Validation testing | 4 | 2 |
| Test data | 1 | 1 |

QA has Many Facets
- Questions
- Specification์ด ์ฌ๋ฐ๋ฅธ์ง ์ด๋ป๊ฒ ๋ณด์ฅํ๋๊ฐ?
- ์์คํ ์ด specification์ ์ถฉ์กฑํ๋์ง ์ด๋ป๊ฒ ๋ณด์ฅํ๋๊ฐ?
- ์์คํ ์ด ์ฌ์ฉ์์ ์๊ตฌ๋ฅผ ์ถฉ์กฑํ๋์ง ์ด๋ป๊ฒ ๋ณด์ฅํ๋๊ฐ?
- ์์คํ ์ด ์๋ชป ๋์ํ์ง ์๋์ง ์ด๋ป๊ฒ ๋ณด์ฅํ๋๊ฐ?
Verification vs Validation
- Verification: ์์คํ
์ด specification์ ์ถฉ์กฑํ๋๊ฐ?
- ์ฆ, ์์คํ ์ ์ฌ๋ฐ๋ฅด๊ฒ ๊ตฌ์ถํ๋๊ฐ?
- Verification: Design ๋๋ code์ ๊ฒฐํจ์ด ์๋๊ฐ?
- ์ฆ, ์๋ชป๋ design ๋๋ implementation ๊ฒฐ์ ์ด ์๋๊ฐ?
- Validation: ์์คํ
์ด ์ฌ์ฉ์์ ์๊ตฌ๋ฅผ ์ถฉ์กฑํ๋๊ฐ?
- ์ฆ, ์ฌ๋ฐ๋ฅธ ์์คํ ์ ๊ตฌ์ถํ๋๊ฐ?
- Validation: Specification์ ๊ฒฐํจ์ด ์๋๊ฐ?
- ์ฆ, requirements ์บก์ฒ๋ฅผ ์๋ชป ์ํํ๋๊ฐ?
Brief Case Discussion

์ด๋ค qualities๊ฐ ์ค์ํ๋ฉฐ, ์ด๋ป๊ฒ ๊ทธ๊ฒ์ ๋ณด์ฅํ ์ ์์๊น?
Very Important
- ๋ชจ๋ ํ์ง ๋ฌธ์ ๋ฅผ ์๋ฒฝํ๊ฒ ํด๊ฒฐํ ์ ์๋ ๋จ์ผ analysis technique์ ์์
- ์ด๋ค technique์ด ์ ์ ํ์ง๋ ์ฌ๋ฌ ์์ธ์ ๋ฐ๋ผ ๋ค๋ฆ
- ํด๋น ์์คํ (๋ฐ ํฌ๊ธฐ/๋ณต์ก์ฑ), ํ์ง ๋ชฉํ, ๊ฐ์ฉ resource, ์์ /๋ณด์ ์๊ตฌ์ฌํญ ๋ฑ
Definition: Software Analysis
Software artifact์ ์์ฑ์ ๊ฒฐ์ ํ๊ธฐ ์ํ ์ฒด๊ณ์ ์ธ ์กฐ์ฌ
- ํฌ๊ด์ ์ด ๋๋ ค๋ ์๋
- ์: Test coverage, inspection check list, exhaustive model checking
- ์๋: Regression testing, static analysis, dynamic analysis
- ์๋: Manual testing, inspection, modeling
- Code, system, module, execution trace, test case, design ๋๋ requirements ๋ฌธ์
Principle Techniques
- Dynamic:
- Testing: ํต์ ๋ ํ๊ฒฝ์์ test data๋ก code๋ฅผ ์ง์ ์คํ
- Analysis: Test run์์ data๋ฅผ ์ถ์ถํ๋ tool
- Static:
- Inspection: Code, design ๋ฌธ์ (spec ๋ฐ model), ์์ ์ฌํญ์ ๋ํ ์ธ๊ฐ์ ํ๊ฐ
- Analysis: Tool์ด program์ ์คํํ์ง ์๊ณ reasoning
No Single Technique
- ๋ชจ๋ ํ์ง ๋ฌธ์ ๋ฅผ ์๋ฒฝํ๊ฒ ํด๊ฒฐํ ์ ์๋ ๋จ์ผ analysis technique์ ์์
- ์ด๋ค technique์ด ์ ์ ํ์ง๋ ์ฌ๋ฌ ์์ธ์ ๋ฐ๋ผ ๋ค๋ฆ
- ํด๋น ์์คํ (๋ฐ ํฌ๊ธฐ/๋ณต์ก์ฑ), ํ์ง ๋ชฉํ, ๊ฐ์ฉ resource, ์์ /๋ณด์ ์๊ตฌ์ฌํญ ๋ฑ
What is Testing?
- ํต์ ๋ ํ๊ฒฝ์์ test data๋ก code๋ฅผ ์ง์ ์คํ
- ์ฃผ์ ๋ชฉํ:
- Verification: Program์ด ํ์ง ์์ฑ์ ํฌํจํ requirements๋ฅผ ์ถฉ์กฑํ๋์ง ํ์ธ
- Defect testing: Failure ๋ฐ๊ฒฌ
- ๊ธฐํ ๋ชฉํ:
- Reveal bugs (์ฃผ์ ๋ชฉํ)
- Assess quality (์ ๋ํ ์ด๋ ค์)
- Clarify the specification, documentation
- Verify contracts
- "Testing shows the presence, not the absence of bugs.โ -Edsger W. Dijkstra 1969
Software Errors
- Functional errors
- Performance errors
- Deadlock
- Race conditions
- Boundary errors
- Buffer overflow
- Integration errors
- Usability errors
- Robustness errors
- Load errors
- Design defects
- Versioning and configuration errors
- Hardware errors
- State management errors
- Metadata errors
- Error-handling errors
- User interface errors
- API usage errors
- โฆ
What are We Covering?
- Program/system ๊ธฐ๋ฅ:
- Execution space (white box!)
- Input ๋๋ requirements space (black box!)
- ์์๋๋ ์ฌ์ฉ์ ๊ฒฝํ (usability)
- GUI testing, A/B testing
- ์์๋๋ performance envelope (performance, reliability, robustness, integration)
- Security, robustness, fuzz, infrastructure testing
- Performance ๋ฐ reliability: soak ๋ฐ stress testing
- Integration ๋ฐ reliability: API/protocol testing
โTraditionalโ Coverage
- Statement
- Branch
- Function
- Path (?)
- MC/DC
We Can Measure Coverage on Almost Anything
- Testing์ ์ํ ์ผ๋ฐ์ ์ธ adequacy criteria๋ program execution ๋๋ specification space์ ์ ์ฒด "coverage"์ ๊ทผ์
- ์ฃผ์ด์ง verification ํ๋์ด ๋ชฉํ๋ฅผ ๋ฌ์ฑํ ์ ๋๋ฅผ ์ธก์ . ํ๋์ adequacy ๊ทผ์ฌ
- ๊ฐ์ฅ ์์ฃผ testing์ ์ ์ฉ๋์ง๋ง, ๋ชจ๋ verification ํ๋์ ์ ์ฉ ๊ฐ๋ฅ
- ์ธก์ ๋ ํญ๋ชฉ ์ค ์ ์ด๋ ํ ๋ฒ ์คํ๋๊ฑฐ๋ ํ๊ฐ๋ ํญ๋ชฉ์ ์ด ์์ ๋ํ ๋น์จ๋ก ํํ. ๋ณดํต ๋ฐฑ๋ถ์จ๋ก ํํ
Testing Levels
- Unit testing
- Integration testing
- System testing
JUnit
- Java๋ฅผ ์ํ ์ธ๊ธฐ ์๋ unit-testing framework
- ์ฌ์ฉํ๊ธฐ ์ฌ์
- Tool ์ง์ ๊ฐ๋ฅ
- Design mechanism์ผ๋ก ์ฌ์ฉ ๊ฐ๋ฅ
Test Driven Development
- Test ์ฐ์ !
- ์ธ๊ธฐ ์๋ agile technique
- Code ์์ฑ ์ specification์ผ๋ก test ์์ฑ
- ์คํจํ๋ test ์์ด code ์์ฑ ๊ธ์ง
- ์ฃผ์ฅ:
- Testable design์ ํฅํ design ์ ๊ทผ ๋ฐฉ์
- Interface ์ฐ์ ๊ณ ๋ ค
- ๋ถํ์ํ code ์์ฑ ๋ฐฉ์ง
- ๋ ๋์ ์ ํ ํ์ง (์: ๋ ๋์ code, ๋ ์ ์ defect)
- ๋ ๋์ test suite ํ์ง
- ๋ ๋์ ์ ๋ฐ์ ์ธ ์์ฐ์ฑ
Continuous Integration
- ์๋์ผ๋ก build, test ๋ฐ ๊ฒฐ๊ณผ ํ์
Regression Testing
- ์ผ๋ฐ์ ์ธ model:
- Bug fix ๋ฑ์ ์ํด regression test ๋์
- Code๊ฐ evolveํจ์ ๋ฐ๋ผ ๊ฒฐ๊ณผ ๋น๊ต
- Code1 + TestSet -> TestResults1
- Code2 + TestSet -> TestResults2
- Code๊ฐ evolveํจ์ ๋ฐ๋ผ TestResults1์ TestResults2 ๋ฑ๊ณผ ๋น๊ต
- Specification์ด ๋ณ๊ฒฝ๋์ง ์๋ ํ ๋์ผํด์ผ ํจ
- ์ด์ :
- Bug fix๊ฐ ์ ์ง๋๊ณ bug๊ฐ ๋ค์ ๋ํ๋์ง ์๋๋ก ๋ณด์ฅ
- Specification์ ๋ํ ์์กด๋ ๊ฐ์
The Oracle Problem
What are We Covering?
- Program/system ๊ธฐ๋ฅ:
- Execution space (white box!)
- Input ๋๋ requirements space (black box!)
- ์์๋๋ ์ฌ์ฉ์ ๊ฒฝํ (usability)
- GUI testing, A/B testing
- ์์๋๋ performance envelope (performance, reliability, robustness, integration)
- Security, robustness, fuzz, infrastructure testing
- Performance ๋ฐ reliability: soak ๋ฐ stress testing
- Integration ๋ฐ reliability: API/protocol testing
Usability Testing
- Specification?
- Test harness? Environment?
- Nondeterminism?
- Unit testing?
- Automation?
- Coverage?
Automating GUI/Web Testing
- ์ด๋ ค์
- Capture and Replay Strategy
- Mouse actions
- System events
- Test Scripts: ("Start" ๋ฒํผ ํด๋ฆญ, Y ํ๋์ ๊ฐ X ์์)
- ๋ง์ tool ๋ฐ framework
- ์: JUnit + Jemmy (Java/Swing)
- Selenium (Web)
- (Model์ GUI์ ๋ถ๋ฆฌํ์ฌ GUI testing ๋ถํ ๋ฐฉ์ง)
- Functional correctness๋ฅผ ๋์ด์?
Manual Testing?
- Live System?
- Extra Testing System?
- Check output / assertions?
- Effort, Costs?
- Reproducible?
Usability: A/B Testing
- Control (A)๊ณผ treatment (B)์ธ ๋ ๊ฐ์ง variant๋ฅผ ์ด์ฉํ ํต์ ๋ ๋ฌด์์ experiment
- ํ ์ฌ์ฉ์ ๊ทธ๋ฃน์๋ A (ํ์ฌ ์์คํ ) ์ ๊ณต, ๋ค๋ฅธ ๋ฌด์์ ๊ทธ๋ฃน์๋ B ์ ์. ๊ฒฐ๊ณผ ๋น๊ต
- Web ๋๋ GUI ๊ธฐ๋ฐ application์์ ์์ฃผ ์ฌ์ฉ๋จ (ํนํ ๊ด๊ณ ๋๋ GUI ์์ ๋ฐฐ์น/design ๊ฒฐ์ test)
Example
What are We Covering?
- Program/system ๊ธฐ๋ฅ:
- Execution space (white box!)
- Input ๋๋ requirements space (black box!)
- ์์๋๋ ์ฌ์ฉ์ ๊ฒฝํ (usability)
- GUI testing, A/B testing
- ์์๋๋ performance envelope (performance, reliability, robustness, integration)
- Security, robustness, fuzz, infrastructure testing
- Performance ๋ฐ reliability: soak ๋ฐ stress testing
- Integration ๋ฐ reliability: API/protocol testing
Security/Robustness Testing
- Specification?
- Test harness? Environment?
- Nondeterminism?
- Unit testing?
- Automation?
- Coverage?
Random Testing
- Program์ input domain์์ ๋ฌด์์๋ก input ๋
๋ฆฝ์ ์ ํ
- Program์ input domain ์๋ณ
- ๋์๋ฅผ ํด๋น input domain์ mapping
- ํน์ ํ๋ฅ ๋ถํฌ์ ๋ฐ๋ผ input domain์์ input ์ ํ
- ํด๋น input์ ๋ํด program์ด ์ ์ ํ output์ ๋ฌ์ฑํ๋์ง ํ์ธ
- Random testing์ program์ faultiness์ ๋ํ ํ๋ฅ ์ ๋ณด์ฅ ์ ๊ณต
- ์: Failure ์์ด ์ฝ 23,000๊ฐ input (N = 23,000)์ ์ฌ์ฉํ random testing์ 90% ์ ๋ขฐ๋ (C = 0.9)๋ก program์ด 10,000๋ฒ ์ค 1๋ฒ (F = 104) ์ด์ failureํ์ง ์์์ ์ ์ฆ
Reliability: Fuzz Testing
- Program, device ๋๋ system์ malformed (๋น์ ์) ๋ฐ unexpected input data๋ฅผ feedํ์ฌ security ๊ด๋ จ defect ๋๋ denial of service, degradation of service ๋๋ ๊ธฐํ ์์น ์๋ behavior๋ก ์ด์ด์ง๋ critical flaw๋ฅผ ์ฐพ๋ negative software testing ๋ฐฉ๋ฒ (A. Takanen et al, 2008)
- Fuzz test๋ฅผ ์์ฑํ๊ฑฐ๋ fuzz testing์ ์ํํ๋ ๋ฐ ์ฌ์ฉ๋๋ program ๋ฐ framework๋ฅผ fuzzer๋ผ๊ณ ํจ
Types of Faulty Found
- Pointer/array errors
- Not checking return codes
- Invalid/out of boundary data
- Data corruption
- Signed characters
- Race conditions
- Undocumented features
- ...Possible tradeoffs?
Fuzzing Process
- Seed pool
- ๋ชจ๋ seed input i1์ ๋ํด
- ์ ํ:
- ์ ํธ๋๋ input ์ฐ์
- ์์ :
- Bitflip
- Byteflip
- ...
- (Modified seed input)
- (One cycle)
- ์ path๋ฅผ coverํ์ง ์๋ input ๋ฒ๋ฆฌ๊ธฐ
- ์ path๋ฅผ coverํ๋ input์ pool์ ์ถ๊ฐ
Unit and Regression Testing for Performance
- Critical component์ execution time ์ธก์
- Execution time์ log๋ก ๊ธฐ๋กํ๊ณ ์๊ฐ์ ๋ฐ๋ผ ๋น๊ต
Profiling
- Execution time ๋ฐ memory ๋ณ๋ชฉ ํ์ ์ฐพ๊ธฐ
Performance Testing During Design
- Modeling ๋ฐ simulation
- ์: queuing theory
Stress Testing
- Robustness testing technique: ์ ์ ์๋ ํ๊ณ๋ฅผ ๋์ด test
- System granularity์ ๋ชจ๋ level์์ ์ ์ฉ ๊ฐ๋ฅ
- Stress test๋ ์ผ๋ฐ์ ์ผ๋ก heavy load ํ์์์ robustness, availability, error handling์ ์ค์
Soak Testing
- ๋ฌธ์ : System์ด ์ธ์์ ์ผ๋ก ์ ํ๋ execution ์กฐ๊ฑด ํ์์๋ ์์๋๋ก ์๋ํ ์ ์์
- ์: Memory leak์ failure๋ก ์ด์ด์ง๋ ๋ฐ ๋ ์ค๋ ๊ฑธ๋ฆด ์ ์์
- Soak testing: ์๋นํ load ํ์ ์๋นํ time ๋์ system์ testing (๊ธ์ )
- ์ฃผ์ด์ง duration๊ณผ threshold ํ์์ simulated ํ๊ฒฝ์ test ๋์ ๋ฐ์ ํ์ธ์ ์ฌ์ฉ
Chaos Engineering
Chaos Monkey
- Netflix infrastructure testing system
- "์ ์์ ์ธ" program์ด component, network, datacenter, AWS instance ๋ฑ์ ๋ฌด์์๋ก ์์
- Chaos monkey๊ฐ ์ต์ด โ production instance๋ฅผ ๋ฌด์์๋ก ๋นํ์ฑํ
- ๋ค๋ฅธ monkey๋ก๋ Latency Monkey, Doctor Monkey, Conformity Monkey ๋ฑ์ด ์์. Infrastructure level์์์ Fuzz testing
- System architecture๊ฐ ๊ณํ๋์ง ์์/๋ฌด์์ outage์ resilientํ์ง ํ์ธํ๊ธฐ ์ํด component์ failure ๊ฐ์
- Netflix๋ chaos monkey code๋ฅผ open-source๋ก ๊ณต๊ฐ
Brief Case Discussion
What are We Covering?
- Program/system ๊ธฐ๋ฅ:
- Execution space (white box!)
- Input ๋๋ requirements space (black box!)
- ์์๋๋ ์ฌ์ฉ์ ๊ฒฝํ (usability)
- GUI testing, A/B testing
- ์์๋๋ performance envelope (performance, reliability, robustness, integration)
- Security, robustness, fuzz, infrastructure testing
- Performance ๋ฐ reliability: soak ๋ฐ stress testing
- Integration ๋ฐ reliability: API/protocol testing
Completeness?
- ํต๊ณ์ threshold
- ๋ณด๊ณ ๋/์๋ฆฌ๋ defect
- Defect ์ข ๋ฅ์ ์๋์ ๋น์จ
- "Going gold" ์์ธก ๋ณ์
- Coverage criterion
- ์: ํญ๊ณต software์ 100% coverage ํ์
- Software ์๊ณก
- Matrix: Test case๋ฅผ requirements use case์ mapping
- ๊ณผ๊ฑฐ data ์ฐธ์กฐ ๊ฐ๋ฅ
- ์กฐ์ง ๋ด์์ project ๊ฐ ๋น๊ต ๊ฐ๋ฅ. ๊ธฐ๋์น ๋ฐ ์์ธก ๋ณ์ ๊ฐ๋ฐ
- ์กฐ์ง ๊ฐ์๋ commensurability์ ์ด๋ ค์์ผ๋ก ์ธํด ๋ ์ด๋ ค์ (์: ํญ๊ณต software vs. ์๋น์ software)
- ๊ฒฝํ ๋ฒ์น: Error detection rate๊ฐ ๋จ์ด์ง ๋ (testing investment ๋๋น diminishing returns ์๋ฏธ)
- ๊ฐ์ฅ ์ผ๋ฐ์ : Time ๋๋ money ์์ง
Limits of Testing
- ์คํ๋์ง ์์ code์ bug๋ฅผ ์ฐพ์ ์ ์์ผ๋ฉฐ, bug ๋ถ์ฌ ๋ณด์ฅ ๋ถ๊ฐ
- Oracle problem
- Nondeterminism, flaky tests
- ํน์ ์ข ๋ฅ์ bug๋ ๋งค์ฐ ๋๋ฌธ ์กฐ๊ฑด์์๋ง ๋ฐ์
- Specification ๊ด์ฐฐ/๋จ์ธ ์ด๋ ค์
- Memory leaks, information flow, โฆ
- ์ ์ฌ์ ์ผ๋ก ๋น์ธ๊ณ ๊ธด ์คํ time
- ์ ์ฌ์ ์ผ๋ก ๋์ manual effort
- Verification, not validation
- ...

