![]() For Uber’s use case, we set out to create tooling that would let engineers automatically generate test mocks for any protocol they wanted by simply annotating them. The information required to generate mock classes already exists in the Swift protocol. Needless to say, we were not very excited about the additional complexity of manually writing and maintaining mock implementations for each of our thousands of protocols. Dynamic languages have good frameworks to build test mocks, stubs, or stand-ins by dynamically creating or modifying existing concrete classes. Since Swift is a very static language, unit testing became problematic. We used this architecture for the first time in our new rider application and moved our primary language from Objective-C to Swift. ![]() Uber’s new application architecture (RIBs) extensively uses protocols to keep its various components decoupled and testable. ![]() Excerpts from how we developed (and subsequently open sourced) Uber's cross-platform mobile architecture framework, RIBs, going from Objective-C to Swift in the process for iOS:
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |