What’s exactly is refactoring and can it improve our application testability?

Photo by Caspar Camille Rubin on Unsplash

What refactoring is?

As Martin Fowler point in his book “Refactoring”:

Refactoring is a controlled technique for improving the design of an existing code base. Its essence is applying a series of small behavior-preserving transformations. [..]

So refactoring is about improving existing code but without changing its behaviour, by small transformations. …

Refactoring for testability / Removing singletons

Let’s check what can we do to improve code testability by removing singletons methods calls from methods.

Photo by Caspar Camille Rubin on Unsplash

I don’t want to elaborate on is singletons are good, bad, useful, helps solve some problems or introduce ones. I would like to focus on how they affect code testability.

Code that heavily relies on singletons is commonly considered untestable. …

When I started to write unit tests for my code main metrics for me was code coverage. I was proud because Xcode prints almost 100% coverage for all my classes— but sadly QA team starts ping me with tickets for my part of application and I was like “What? I…

If we target our application in more wide range than our country, it is good to localize application to be understandable by users. Very good habit is localize application in your native language and at least in English.

Making localizations in iOS application can be little tricky.

Old days to…

In almost every app there comes time when we have to make some formatting. Some time we need to convert Bool into readable string, more often Date object into text literal which will be understandable to people who use our application, not saying about rounding numbers to two spaces after…

Daniel Sumara

iOS Developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store