nayaread
HomeFavouritesTopicsSources
HomeFavouritesTopicsSources
NayaRead links to original engineering blogs. All copyright belongs to the respective authors.
Shopify Engineering·Jan 15, 2019·8 min read51

iOS Application Testing Strategies at Shopify - Shopify

At Shopify, we use a monorepo architecture where multiple app projects coexist in one Git repository. With hundreds of commits per week, the fast pace of evolution demands a commitment to testing at all levels of an app in order to quickly identify and fix regression bugs.This article presents the ways we test the various components of an iOS application: Models, Views, ViewModels, View Controllers, and Flows. For brevity, we ignore the details of the Continuous Integration infrastructure where these tests are run, but you can learn more from the Building a Dynamic Mobile CI System blog post. Testing Applications, Like Building a Car Consider the process of building a reliable car, base components like cylinders and pistons are individually tested to comply with design specifications (Model & View tests). Then these parts are assembled into an engine, which is also tested to ensure the components fit and function well together (View Controller tests). Finally, the major subsystems like the engine, transmission, and cooling systems are connected and the entire car is test-driven by a user (Flow tests).The complexity and slowness of a test increases as we go from unit to manual tests, so it’s important to choose the right type and amount of tests for each component hierarchy. The image below shows the kind of tests we use for each type of app component; it reads bottom-up like a Model is tested with Regular Unit Tests. Types of Tests Used for App Components Testing Models A Model represents a business entity like a Customer, Order, or Cart. As the foundation of all other application constructs, it’s crucial to test that the properties and methods of a model ensure conformance with their business rules. The example below shows a unit test for the Customer model where we test the rule for a customer with multiple addresses, the billingAddress must be the first default address. A Word on Extensions Changing existing APIs in a large codebase is

Mobile
Read original on shopify.engineering

Score breakdown

  • Technical depth81
  • Practical value30
  • Originality100
  • Writing quality100
  • Source reputation0
  • Recency0
  • External engagement0
  • On-site engagement0

NayaRead shows a summary and links to the original article. The full article is hosted on shopify.engineering.

More like this

Engineering at Meta

How do you test your tests?

Dec 10, 2020·17 min read
Slack Engineering

Continuous Load Testing

Sep 11, 2022·15 min read
Etsy — Code as Craft

Macramé: Untangling the Knot on the Etsy Android Listing Screen

John Kalmi·Mar 18, 2024·8 min read
Shopify Engineering

Building Reliable Mobile Applications - Shopify

Aug 14, 2020·14 min read