Every WWDC, I hope for improvements to unit testing — but have learned to expect disappointment. So at WWDC 2018, I was surprised to have my low expectations thwarted! Xcode 10 brings changes that will improve my test-centric workflow.
For several years, Apple’s changes for test support have underwhelmed me. They focused on:
With Test Driven Development, unit tests run locally are my primary tool. The features above may have helped some people, but I wasn’t one of them.
So what did WWDC 2018 bring me? Here’s what I see on the horizon with Xcode 10.Continue reading
When you refactor, do you have unit tests covering you? …If not, why not? …If so, how do you know?
To me, it seems that the state of refactoring has gotten worse across the industry. Both managers and programmers and managers say the word “refactoring” more than ever. But they almost always mean, “I’m going to change a bunch of stuff. Then at the end, we need to make sure I didn’t break anything.”
But that’s not refactoring. That’s rewriting.
Quickly generate code for either Swift or Objective-C. Code snippets provided for both Xcode and AppCode.
Subscribe to our newsletter to receive regular updates and tips about Clean Code techniques for iOS developers & get instant access to the free code snippets.
Does your code have comments? Sometimes they’re helpful. But most of the time…
It’s time for a quick exercise in code smells!
How many code smells do you see below?
When I was first learning TDD, I’d try to get to the First Step (a failing test) by writing a fully-formed test. But it often took a lot fiddling to get that test to run and fail. Sometimes this was because the production code took several steps to set up. Sometimes it was because the test code wasn’t right.
One of the tricky parts of TDD is that we’re creating two streams of code in parallel: the test code, and the production code. Two things changing at the same time… that’s a hard thing to keep in your head!
Happy new year! It seems like good time for a Quality Coding retrospective. I also want to share some goals for 2018.
…Did someone say, “Are you writing a book?”
We’ve looked at ways to mock methods in Swift. But what about standalone functions? Is there a way to mock them as well?
Yes! Not only can we mock Swift standalone functions, but we can do it without changing the call sites.
We get feedback from the compiler. We get feedback from Test Driven Development. But what sources of feedback lie in between?
This is where linters come in. A linter goes beyond “Does the code compile?” A linter answers questions like, “Is the code idiomatic? Is it stylistically clean? Are there any red flags?”
A paper published in 2013 about Test Driven Development included the following diagram. Unfortunately, it gets some things wrong:
Do you enjoy conferences and workshops? Here’s my conference schedule for this fall:
Last year, I attended Silicon Valley Code Camp for the first time. This year, I’ll be teaching a session: Intro to Test Driven Development.
This won’t be specific to iOS development. Instead, it’ll be platform agnostic, for anyone with a little programming experience.
This year, it’ll be hosted at the PayPal campus in San Jose, California. My session will be Saturday morning at 9:45. You can’t beat the price, which will be little more than a nominal lunch fee.
Send any programmers you know in the area. Also managers! They’ll get a taste of TDD from someone who’s been practicing it since 2001.Register for SVCC
My one-day TDD Workshop for iOS Developers has been well-received in Verona, San Jose, Chicago, and Indianapolis. This time, it’s coming to Seattle as part of Swift by Northwest.
The last time I taught the workshop (for a company, not a conference), I kept saying, “Wow, there’s so much we can cover. This could easily be a two-day workshop.” So guess what? This time, you can spend two solid days with me, learning Test Driven Development for iOS!Register for Workshop
My session will be on the SOLID Design Principles. But I want to try something a little different this time:
I think it’ll be a lot of fun. From our shared experiences, we’ll all become better software designers.Register for Swift by NW
Will you be at any of these events? Let me know by leaving a note below!