Testing Tools and Production Boosts

Products, such as the BBC News iOS app, are constantly evolving and have lifespans longer than team members, who also have to respond to stake holder requirements while also maintaining, and improving where possible, the existing code base.

Few argue against the value of unit tests when working on this type of digital product. The team had been investing in unit tests, XCTest with OCMock, before I joined and I have contributed my fair share and I also introduced a test harness.

Again drawing on experience with established technologies, Apache and PHP, and introducing them to a newer friend, Charles Proxy, I was easily able to create a set of .json files served locally against network requests. This means stub server responses can be created and changes tested against.

I found that serving the .json through a .php proxy file has a number of advantages :
  1. Only one Remote Host mapping is needed in Charles Proxy.

    Changing these mappings in Charles Proxy is much more fiddly than editing
    a line of code in a .php file.

  2. You can use PHP to return desirable HTTP headers for your situation.

    This proved a fantastic production boost when developing new layouts for each language variant. Headers can be set so that content is not cached by the app, changes made and pull to refresh used to display the changes.

    When so much time is spent waiting for code to compile in mobile development this simple test harness, created using technology already installed on any Mac, started delivering benefits after an afternoon's work.