0
0
iOS Swiftmobile~5 mins

Snapshot testing in iOS Swift - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is snapshot testing in iOS development?
Snapshot testing is a way to check if the visual appearance of a UI component stays the same over time by comparing its current look to a saved image.
Click to reveal answer
beginner
Which framework is commonly used for snapshot testing in Swift?
The iOSSnapshotTestCase framework (also known as FBSnapshotTestCase) is commonly used for snapshot testing in Swift projects.
Click to reveal answer
intermediate
Why is snapshot testing useful compared to manual UI checks?
Snapshot testing automates UI verification, catching visual bugs quickly and consistently without needing a person to look at the screen every time.
Click to reveal answer
intermediate
What should you do if a snapshot test fails because the UI intentionally changed?
You should update the saved snapshot image to the new correct UI appearance to keep tests accurate.
Click to reveal answer
advanced
Name one limitation of snapshot testing.
Snapshot testing can be fragile if small UI changes happen often, and it may not catch functional bugs that don't affect appearance.
Click to reveal answer
What does a snapshot test compare?
AUser input vs validation rules
BCode logic vs expected output
CNetwork response vs cached data
DCurrent UI image vs saved UI image
Which of these is a popular snapshot testing framework for Swift?
AXCTest
BiOSSnapshotTestCase
CAlamofire
DCoreData
If a UI change is intentional, what should you do with the snapshot test?
ADelete the test
BIgnore the failure
CUpdate the saved snapshot
DRevert the UI change
Snapshot testing is best described as:
ATesting UI appearance
BTesting app performance
CTesting backend APIs
DTesting user input validation
One limitation of snapshot testing is:
AIt may fail often with small UI changes
BIt requires manual UI checks
CIt cannot detect visual bugs
DIt tests only backend logic
Explain how snapshot testing helps maintain UI quality in iOS apps.
Think about how comparing images can catch bugs without manual review.
You got /4 concepts.
    Describe the steps to update a snapshot test after a UI change.
    Consider what happens when the UI changes on purpose.
    You got /4 concepts.