All Posts 💻 ✏️
Looking for featured posts? 👉 Check them out: here
-
A Journey of Maintaining Device Farms for E2E Testing
Continuing from the end-to-end testing series, today we’ll dive into the practical challenges of maintaining a device farm - something that’s much easier said than done. A device farm refers to the infrastructure - usually a server setup - responsible for managing and orchestrating E2E test executions across physical devices. This could be a mix of iOS and Android phones connected to a server. Maintaining such a device farm can be challenging, and require deep technical insight to mitigate stability and performance issues.
-
Swift Packages: Packaging as an XCFramework (1)
Background Modularizing code using Swift packages has become more and more common in iOS development. With the introduction of XCFrameworks, Apple has provided a robust mechanism to ship prebuilt products that support multiple platforms and architectures. Binary distribution of SDKs and third-party libraries is not new, especially in closed-source projects where protecting intellectual property is crucial. Another major benefit is reduced build times. Many build caching tools rely on this aspect, ie.
-
Async Let Bindings: a Gotcha and a Closer Look
Swift 5.5 introduced a powerful set of concurrency tools to deal with asynchronous tasks, eliminating the complexity of callbacks and queues. Besides Task and TaskGroup for managing child tasks, the async let syntax allows you to start concurrent tasks and bind their results to variables, following structured concurrency principles. Yet, be cautious when writing async let bindings. Consider these two declarations below. async let x = taskX() // returns an Int async let y = taskY() // retunns a String let result = await (x, y) async let (x, y) = (taskX(), taskY()) let result = await (x, y) At first glance, they seem equivalent.
-
When Your Research Goes Off-Track
One of the biggest frustrations in research is realizing - after investing quite some effort - that you have gone off-track… Lately, I’ve been exploring BSP (Build Server Protocol) and how to make VSCode work seamlessly with iOS projects. If you read my previous post, you may know that my motivation for looking into BSP was test discovery. Extracting tests in non-SPM projects is not straightforward. Here, non-SPM refers to projects managed by the traditional xcworkspace/xcodeproj structures.
-
In Search of Test Discovery Solutions in iOS
Introduction Five years ago, I wrote a blog post about extracting test methods before runtime in iOS. This falls under a broader category of test discovery - the process of identifying test cases in a codebase. While test discovery is relatively straightforward in scripting languages, it is more challenging in iOS and other statically typed languages. For a Swift package project, this can be done with the swift test list command.
-
Swift Testing and the Compatibility With xcodebuild
Introduction Swift Testing is a new test framework introduced by Apple at WWDC 2024. It offers a range of macro-based features, making test writing more expressive. One of the key features driving migration from XCTest to Swift Testing is parameterized testing. While this concept has been widely available in other languages (ex. pytest introduced it in 2011), Swift Testing now enables repeated test execution with different inputs and expected outputs.
-
Automation at Your Core
We often hear that automating repetitive tasks improves productivity. But how do we decide when automation is truly worth the effort? 1 At OKX, while managing end-to-end testing servers, I frequently needed to SSH into servers to diagnose issues and retrieve relevant logs (to my local) for further investigations. This was tedious but manageable, thanks to my terminal’s auto-completion. However, as we expanded to four servers (two in Hong Kong, two in Singapore), keeping track of server IPs, usernames and passwords for the SSH became a hassle.
-
WebDriverAgent - The Heart of iOS E2E Testing
In the previous post, we explored the overview of E2E testing in mobile development. Today, we’re going to dive deeper into how E2E testing with Appium works on iOS. 1. Introduction to WebDriverAgent (WDA) 1.1. Running Your First Test With Appium Here’s a simple code snippet to start your tests. For simplicity, we’ll run tests on simulators.
-
Overview of Mobile E2E Testing
1. Introduction End-to-end (E2E) testing is a software testing strategy that verifies the system integration from start to finish, including apps, backend services, and other related components; to ensure everything functions as expected altogether. Compared to unit tests, E2E tests are often fewer in number due to their complexity and maintenance costs. This type of testing is even more uncommon in mobile development where special setups are often required. This blog post aims to provide a quick overview of mobile E2E testing and some opinionated architecture suggestions for incorporating E2E testing into your engineering process.
-
Chuyện Nghề: Một Xưởng Tàu Nọ (1)
Hôm ấy, một buổi chiều thứ sáu như thường lệ… Nắng dệt vàng ươm những cánh buồm lững thững trên mặt nước vùng vịnh. Có lẽ đã rất lâu rồi, mình mới có dịp ngắm nhìn toàn bộ quang cảnh quen thuộc ấy một cách rõ ràng, nhưng không phải dưới ánh đèn phố thị lấp lánh, hay qua một bức tường trong suốt từ trên cao. Đảo quốc Sư Tử hôm ấy bình yên đến lạ.