All quizzes
Free quiz · 20 questions in the bank

XCTest quiz

Test your XCTest knowledge with a free interactive quiz — 20 questions with answers and explanations. No signup needed to play.

Question 1/5Score 0

What is XCTest?

Questions in this quiz
  1. What is XCTest?
  2. What is `XCTUnwrap` used for, and what problem does it solve compared to force-unwrapping an optional directly?
  3. What does `XCTAssertEqual` do?
  4. What is the purpose of code coverage reporting, as integrated with XCTest in Xcode?
  5. How do you define a test case in XCTest?
  6. What is `measure { }` used for in an XCTest performance test?
  7. What is a common pattern for structuring an individual XCTest test method, sometimes referred to as "Arrange-Act-Assert" (or "Given-When-Then")?
  8. How does XCTest handle testing asynchronous code, such as a network request completion handler?
  9. What is the distinction between an XCTest "unit test" and a "UI test" (XCUITest)?
  10. What does `XCTAssertNil` and `XCTAssertNotNil` check, and why might using them be preferable to a manual `if` statement with `XCTFail`?
  11. How does XCTest handle running tests from the command line, outside of the Xcode IDE (e.g. as part of a CI pipeline)?
  12. What is the significance of writing tests as part of the same Xcode project/workspace as the application code, using a dedicated test target?
Gaps to close?
Read the curated XCTest notes — core concepts, patterns, interview prep.
XCTest notes

More quizzes

.NET.NET MAUIAbsintheAccessibilityActixActix Web