PragmaticBookshelf

PragmaticBookshelf

Devtalk Sponsor

The Case of the Crimson Test Suite (PragProg)

Write and run test for you Swift code with ease with this quick, hands-on introduction to the new Swift Testing Framework.

Daniel H Steinberg

Check out this quick, hands-on introduction to the new Swift Testing Framework. You’ll learn how easy it is to now write and run tests for your Swift code, and the results are so much cleaner and clearer. You’ll collect some tests in a suite and use tags to group others. You’ll write expectations and requirements and learn various techniques to combine and simplify them. You’ll actually look forward to testing your code.

The Case of the Crimson Test Suite is an introduction to the modern Swift Testing framework.

Testing your packages and apps for Apple platforms has never been easier. The new Swift Testing framework makes it easy for you to write tests that are clean and clear with easy-to-read feedback when a test fails. In this book we begin with tests that run as freestanding functions. Later, we gather some of them up into a suite so that we can run a test individually, as part of a suite, or as one of the entire tests in the current test plan.

You’ll write expectations and requirements to test the result of calling your production code and you’ll verify methods that should and do throw an error. You’ll test asynchronous code and, in those rare cases when it’s needed, write serialized tests. By default Swift Testing runs your tests in parallel in random order for both improved performance and to catch hidden dependencies. You’ll create display names and use test description to improve the test output and introduce tags so that you can run a subset of your tests without suites or across many suites.


Daniel H Steinberg is the author of more than a dozen books including the best selling books A Functional Programming Kickstart, A SwiftUI Kickstart, A Swift Kickstart, Second Edition, and Dear Elena. He has written apps for the iPhone and the iPad since the SDKs first appeared and has written programs for the Mac all the way back to System 7.

Daniel presents iOS, Functional Programming, SwiftUI, and Swift training and consults through his company Dim Sum Thinking. When he’s not coding or talking about coding for the Mac, the iPhone, and the iPad he’s probably cooking, baking bread, or hanging out with friends. Details on his training and speaking are on the Dim Sum Thinking website.


Don’t forget you can get 35% off with your Devtalk discount! Just use the coupon code “devtalk.com" at checkout :+1:

Where Next?

Popular Backend topics Top

PragmaticBookshelf
Real-time applications come with real challenges—persistent connections, multi-server deployment, and strict performance requirements are...
New
PragmaticBookshelf
Machine learning can be intimidating, with its reliance on math and algorithms that most programmers don't encounter in their regular wor...
New
lpil
Michael published this video today on the how and why of Gleam’s new try syntax. I thought it would be a good first bit of content to sha...
New
ManningBooks
Spring Quickly teaches you how to build professional-quality applications using Spring and Spring Boot. Author Laurențiu Spilcă draws on ...
New
PragmaticBookshelf
Build efficient applications that exploit the unique benefits of a pure functional language, learning from an engineer who uses Haskell t...
New
PragmaticBookshelf
Learn how to build a privacy-aware and developer-friendly workflow using Python to keep track of your personal finances. Siddhant Go...
New
PragmaticBookshelf
Test your math, and sharpen your skills. These fun and twisty challenges will puzzle your brain, tease your number sense, and get you thi...
New
PragmaticBookshelf
Learn and apply the powerful streams API and lambda expressions to create highly expressive, concise, and maintainable functional style c...
New
PragmaticBookshelf
Programming Ruby is the most complete book on Ruby, covering both the language itself and the standard library as well as commonly used t...
New
PragmaticBookshelf
Develop, deploy, and debug BEAM applications using BEAMOps: a new paradigm that focuses on scalability, fault tolerance, and owning each ...
New

Other popular topics Top

AstonJ
If it’s a mechanical keyboard, which switches do you have? Would you recommend it? Why? What will your next keyboard be? Pics always w...
New
malloryerik
Any thoughts on Svelte? Svelte is a radical new approach to building user interfaces. Whereas traditional frameworks like React and Vue...
New
siddhant3030
I’m thinking of buying a monitor that I can rotate to use as a vertical monitor? Also, I want to know if someone is using it for program...
New
AstonJ
Thanks to @foxtrottwist’s and @Tomas’s posts in this thread: Poll: Which code editor do you use? I bought Onivim! :nerd_face: https://on...
New
New
husaindevelop
Inside our android webview app, we are trying to paste the copied content from another app eg (notes) using navigator.clipboard.readtext ...
New
PragmaticBookshelf
Author Spotlight: VM Brasseur @vmbrasseur We have a treat for you today! We turn the spotlight onto Open Source as we sit down with V...
New
First poster: bot
Large Language Models like ChatGPT say The Darnedest Things. The Errors They MakeWhy We Need to Document Them, and What We Have Decided ...
New
DevotionGeo
I have always used antique keyboards like Cherry MX 1800 or Cherry MX 8100 and almost always have modified the switches in some way, like...
New
Fl4m3Ph03n1x
Background Lately I am in a quest to find a good quality TTS ai generation tool to run locally in order to create audio for some videos I...
New