TDD 和单元测试、UI 自动化测试
ShannonChenCHN opened this issue · 2 comments
ShannonChenCHN commented
- TDD
- 单元测试
- 什么是单元测试
- 为什么要做单元测试
- 应用场景
- 如何做单元测试
- 黑盒测试
- 白盒测试
- 自动化测试
ShannonChenCHN commented
延伸阅读:
- Testing with Xcode - Apple Developer Center
- What's Worth Unit Testing in Objective-C?
- google/EarlGrey
- WebDriverAgent
- Your TDD Will Improve as Your Design Sense Improves
- iOS测试与集成工具总结
- TDD的iOS开发初步以及Kiwi使用入门
- iOS单元测试| 百度Hi iOS团队技术周报
- WWDC15 Session笔记 - Xcode 7 UI 测试初窥
- iOS单元测试(作用及入门提升)
- iOS Unit Testing and UI Testing Tutorial - Ray Wenderlich
- Unit Testing Tutorial: Mocking Objects - Ray Wenderlich
- Objc.io-issue 1-3:测试 View Controllers
- Objc.io-issue 2-5:测试并发程序
- Objc.io-issue 15:测试
- 《iOS 测试指南》
- 测试 iOS App 时需要注意什么?
- 基于 KIF 的 iOS UI 自动化测试和持续集成
- 走出 iOS 单元测试的困境
ShannonChenCHN commented
单元测试
- 基础
- Defining Test Scope/What to Test
- Two types of unit test contexts
- App tests
- Library tests
- XCTest 框架
- Writing Test Classes and Methods
- Test Targets, Test Bundles, and the Test Navigator
- Creating a Test Class
- Test Class Structure
- Setup and Teardown
- Flow of Test Execution
- Writing Test Methods
- XCTest Assertions
- given-when-then
- Writing Tests of Asynchronous Operations
- Writing Tests with Swift
@testable
- Writing Test Classes and Methods
- Running Tests and Viewing Results
- Debugging Tests
- stub 和 mock 的区别
- 最佳实践(FIRST 原则)
- Fast
- Independent/Isolated
- Repeatable
- Self-validating
- Timely
- Performance Testing
- Automating the Test Process(Continuous Integration/Continuous Delivery)
- User Interface Testing
- Mock 框架
- ObjC
- ocmock
- Swift
- ObjC
- 示例代码
- Unit Testing Apps and Frameworks - Apple Sample Code
- Alamofire
- Kingfisher
- ...
问题讨论
- 单元测试应该怎么做
- 单元测试应该怎么写
- Mock 和 Stub
- https://objccn.io/issue-15-5/
- https://objccn.io/issue-15-3/
- https://www.raywenderlich.com/1752-unit-testing-tutorial-mocking-objects
- https://www.swiftbysundell.com/articles/mocking-in-swift/
- https://www.swiftbysundell.com/articles/mock-free-unit-tests-in-swift/
- https://medium.com/bird-engineering/mockingbird-a-convenient-mocking-framework-for-swift-d01a00c16952
- https://academy.realm.io/posts/tryswift-veronica-ray-real-world-mocking-swift/
- 为什么不能测试 Swift 的私有方法
参考:
- 官方文档
- 最佳实践
- Engineering for Testability - WWDC 2017
- Testing Tips & Tricks - WWDC 2018
- Unit tests best practices in Xcode and Swift
- Guidelines: Writing Testable Code
- Unit Tests, How to Write Testable Code and Why it Matters
- XCTest 测试实战⭐️
- 依赖注入 - objc.io⭐️
- 置换测试: Mock, Stub 和其他 - objc.io⭐️
- A Swift-y Approach to Dependency Injection
- 教程
- 其他资料