Joy! Xcode 10 Promises to Improve Test-Centric Workflows

Shares

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.

Xcode 10 (still in beta)

For several years, Apple’s changes for test support have underwhelmed me. They focused on:

  • Xcode Bots (…I tried them. I gave up.)
  • Performance tests (…My code is not performance-critical.)
  • UI tests (…I don’t write any.)

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

Do You Refactor without Tests? It’s Time for Safety

Shares

When you refactor, do you have unit tests covering you? …If not, why not? …If so, how do you know?

People trying to weigh down pitchfork as it tilts dangerously

Source: http://www.ntd.tv/2017/02/14/2016-fails-will-stay-ever/

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.

Continue reading

Generate Test Scaffolding & Stay Focused

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.

We take your privacy seriously. See our privacy policy here.

How to Improve Code Comments with Little Refactorings

Shares

Does your code have comments? Sometimes they’re helpful. But most of the time…

Continue reading

Code Smells: How Many Do You See in This Method?

It’s time for a quick exercise in code smells!

How many code smells do you see below?

Continue reading

The 3 Laws of TDD: Focus on One Thing at a Time

Shares

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!

Continue reading

My Crazy Plans for the New Year (Book Teaser)

Shares

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?”

Continue reading

How to Mock Standalone Functions …Without Changing the Call Sites

Shares

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.

Continue reading

How to Use SwiftLint for Clean, Idiomatic Swift

Shares

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?”

Continue reading

What Can We Learn from an Incorrect TDD Diagram?

Shares

A paper published in 2013 about Test Driven Development included the following diagram. Unfortunately, it gets some things wrong:

incorrect TDD diagram

Continue reading

Where Will Jon Be in Fall 2017?

Shares

Do you enjoy conferences and workshops? Here’s my conference schedule for this fall:

October 7–8: Intro to TDD (non iOS) in San Jose

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

October 25–26: TDD Workshop in Seattle

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

October 27–28: Swift by Northwest

The intimate traveling conference CocoaConf has stopped traveling. It’s roosted in Seattle, and taken on a new name. I’m honored to be included in the launch of Swift by Northwest!

My session will be on the SOLID Design Principles. But I want to try something a little different this time:

  • No slides. Live scribbling instead.
  • Not a “presentation,” but a seminar. There will be discussion.

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!

1 2 3 12
>