# Breaking Loose from Third-Party Lock-In with Custom Refactoring Tools

DevFeed: [Breaking Loose from Third-Party Lock-In with Custom Refactoring Tools](<https://devfeed.tech/articles/breaking-loose-from-third-party-lock-in-with-custom-refactoring-tools-1999.md>)

Original publisher: [Read original article](<https://developers.soundcloud.com/blog//breaking-loose-from-third-party-lock-in-with-custom-refactoring-tools>)

Published: 2020-08-11T00:00:00Z

Content type: article

Language: en

Sources: [SoundCloud Backstage](<https://devfeed.tech/sources/soundcloud-backstage-blog.md>)

Topics: [Test-driven development](<https://devfeed.tech/topics/tdd.md>), [Tool](<https://devfeed.tech/topics/tool.md>), [vendor lock-in](<https://devfeed.tech/topics/vendor-lock-in.md>)

Tags: [abstract](<https://devfeed.tech/tags/abstract.md>), [abstract-class](<https://devfeed.tech/tags/abstract-class.md>), [abstractions](<https://devfeed.tech/tags/abstractions.md>), [accessible](<https://devfeed.tech/tags/accessible.md>), [ast-matchers](<https://devfeed.tech/tags/ast-matchers.md>), [change](<https://devfeed.tech/tags/change.md>), [code](<https://devfeed.tech/tags/code.md>), [custom](<https://devfeed.tech/tags/custom.md>), [developers](<https://devfeed.tech/tags/developers.md>), [essential](<https://devfeed.tech/tags/essential.md>), [ios](<https://devfeed.tech/tags/ios.md>), [job](<https://devfeed.tech/tags/job.md>), [libtooling](<https://devfeed.tech/tags/libtooling.md>), [llvm](<https://devfeed.tech/tags/llvm.md>), [product](<https://devfeed.tech/tags/product.md>), [refactoring](<https://devfeed.tech/tags/refactoring.md>), [requirements](<https://devfeed.tech/tags/requirements.md>), [software](<https://devfeed.tech/tags/software.md>), [software-developers](<https://devfeed.tech/tags/software-developers.md>), [technology](<https://devfeed.tech/tags/technology.md>), [third-party](<https://devfeed.tech/tags/third-party.md>), [time](<https://devfeed.tech/tags/time.md>), [tools](<https://devfeed.tech/tags/tools.md>), [with](<https://devfeed.tech/tags/with.md>), [xcode](<https://devfeed.tech/tags/xcode.md>)

## AI overview

SoundCloud replaced Specta in its iOS codebase by building a custom converter for more than 900 Objective-C spec files. A Clang LibTooling frontend matched Specta constructs in the AST and extracted their structure and code into JSON; Ruby parsers then generated XCTestCase classes, copied imports and variables, built setup and teardown methods and test methods, and formatted the output with clang-format. The authors found regex transformations too cumbersome and error-prone, while Xcode's refactoring features lacked the needed capabilities. Conversion time fell from hours per spec to a couple of minutes, enabling Specta's removal. The approach required upfront work and had drawbacks: limited, often outdated LibTooling documentation, edge cases requiring matcher changes, occasional need for custom matchers, and the added complexity of writing the tool in C++. The excerpt describes the process and tradeoffs but does not establish how the tool handled every possible spec.

## Source excerpt

Code refactoring is an essential part of the job of software developers. As time goes on, technology evolves, product requirements change...