© Gio Lodi 2021
G. LodiTest-Driven Development in Swifthttps://doi.org/10.1007/978-1-4842-7002-8_5

5. Changing Tests with Fixtures

Gio Lodi1  
(1)
Mount Martha, VIC, Australia
 

How can you modify the type signatures of your production code without having to update the tests that consume them too?

By decoupling the tests from the production object initialization code.

Test-Driven Development promises to help developers work at a steady pace. For this to happen, writing tests first is not enough; we need to maintain the test code like the production one, keep it nimble and simple to work with. As Robert C. Martin puts it in Clean Code: A Handbook of Agile Software Craftsmanship
  • Test code is just as important as production code. It is not a second-class ...

Get Test-Driven Development in Swift: Compile Better Code with XCTest and TDD now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.