@ WWDC 18
- Xcode 9.3
- Performance and accuracy
- Target selection
- xccov
- Source editor
๋ง์ด ๋ง์ด ์ค์!
๋ง์ด ๋ง์ด ์ค์!
- Code Coverage
- Enabled for all targets
- Enabled for selected targets
- Disabled
- Command line tool
- Output formats
- Human-readable
- Machne-parseable (JSON)
- View coverage data
code coverage๊ฐ enabled๋ ์ํ์์ xcode๋ฅผ ์คํ์ํค๋ฉด ์์ ๊ฐ์ด ๋ ๊ฐ์ ํ์ผ์ ๋ง๋ ๋ค.
- Derived data
- Result bundle
Xcode๋ฅผ ์ด์ฉํด์ ์ด๋ค ํ๊ฒ์ ํ ์คํธ ์ฝ๋๊ฐ ์ผ๋งํผ ์ปค๋ฒํ๊ณ ์๋์ง ํ์ ํ ์ ์๋ค.
- Not all tests are equal
- 1000 unit tests
- 10 UI tests
- Different tests in different situations
- Pre-commit
- Nightly
- "Tests to skip"
- Automatically includes new tests
- "Tests to run"
- Explicit opt-in for tests
- Alphabetical
- Default
- Deterministic
- Can hide implicit dependencies
- Randomized
- Nondeterministic
- Can uncover implicit dependencies
- Only beneficial if testing on multipl destinations
- Only available from xcodebuild
Your App + Test Bundle = Runner
- Hidden dependencies between tests iin a class
- Avoid unnecessary +setUp and +tearDown computation
- Original simulator is not used duriing testing
- Separate data containers
- Enabling parallelization
- Viewing results in the test log and test report
- Multiple instances of a Mac app running unit tests
- Multiple simulator clones running UI tests
- Override the number of workers
-parallel-testing-worker-count n
- Force parallel testing on or off
-parallel-testing-enabled YES | NO
- Consider splitting a long running class into two classes
- Put performance tests into their own bundle, with parallelization disabled
- Understand which tests are not safe for parallelization