14 Jul Smooth Migration: Objective C to Swift and Enhancing Stability
Our client, a San Francisco-based start-up, wanted to migrate their large Objective C codebase to Swift while at the same time maintaining ongoing development. We all know how complex this migration is. Nevertheless, they contacted us and through meticulous planning, gradual migration, and comprehensive testing, we ensured a smooth transition, while also improving application stability.
|Project duration:||10 Months|
|Team size:||6 people|
|Project goal:||Migrate codebase from Objective C to Swift, while continuing development and adding new features to the project.|
|Results:||Well-planned gradual codebase migration while ensuring stability through a mix of unit, integration, and UI testing.|
|Technologies and tools used on the project:||
About the Client
Our client is a start-up company working in the area of office management and work process automation.
Project codebase migration from Objective C to Swift including CI/CD changes while ensuring the project remains fully functional and operational throughout the migration process.
The company had a large codebase in Objective C, that needed to be rewritten in Swift. Migration from Objective C to Swift is undertaken to modernize the codebase, leverage the advantages of a more expressive and safer language, ensure compatibility with the latest Apple platforms, and enhance developer productivity.
Migrating third-party libraries
Along with the codebase, there was a set of third-party libraries (Masonry, Mantle, OHHTPStubs, OCMock, Alamofire, CocoaLumberjack, Firebase, Crashlytics, Instabug) which needed upgrade/replacement with Swift equivalents.
Since the company already used CircleCI, which could support both Objective C and Swift projects, our team replaced some of the scripts, while others were migrated.
Improve application stability
During the code migration process, one of the goals was to identify and address potential issues within the codebase, while enhancing the overall stability of the application by adoption of Swift’s modern and robust language features.
Keep going forward
The primary objective was to ensure a seamless development process, allowing the company to maintain existing functionality, create new features, and deliver value to customers without disruption during the migration period.
1. Codebase complexity
At that time, the company faced the challenge of dealing with a substantial codebase and numerous third-party Objective C libraries that required rewriting or replacement. Moreover, the complexity of the existing solutions added an extra layer of difficulty in porting them to Swift.
2. Limited time frame
Time constraint posed an additional challenge as the project had a narrow window, requiring meticulous planning and execution to accommodate limited room for unpredictability during the migration process.
3. Partial test coverage
One of the main issues was insufficient test coverage which was crucial during the migration process. To ensure the app’s existing functionality and promptly address potential issues caused by the code migration – it was vital to identify and create missing tests before the migration process.
4. Moving target
As said above, the app was live all the time and the migration work had to be synchronized with the ongoing development and deployment. This one was the most complex part of the whole process.
Team Size and Approach
The project team consisted of a client-appointed team lead, complemented by a dedicated group of skilled senior and junior developers provided by BDIT. Despite working remotely, the team maintained continuous communication through various channels such as email, Slack, and other collaboration tools. Daily synchronization ensured effective coordination, while live calls and video conferences were conducted periodically or as needed to address project requirements and facilitate seamless collaboration.
Migration was done gradually and on a planned schedule. Code was covered with a mix of unit, integration and UI tests in order to provide stability and eliminate possible new issues. In parallel with migration efforts, regular smoke and/or regression testing were conducted.
“Through meticulous planning, gradual migration, and comprehensive testing, the team ensured a smooth transition, and improved application stability.”
Testing parties were organized periodically, on milestone releases, to guarantee and further improve the stability of the codebase. It is worth mentioning that we actively participated in the development and deployment of new features alongside with the codebase migration process.
|Migrate from Objective C to Swift||
|Migrating third-party libraties|
|Migrate existing Objective C libraries to Swift: Masonry, OHHTPStubs, Mantle, OCMock, Alamofire, CocoaLumberjack, Firebase, Crashlytics, Instabug||
|Adopt CircleCI, Fastlane, Bash scripts for Swift||Successfully upgraded for Swift project|
|Improve application stability|
|Improve application stability while keep going forward||Application stability was upheld and improved by resolving existing issues and introducing missing tests during the process|
Explore our case studies and find out how we help our clients achieve their goals: Case studies.