Mac OS, Obj-C, Programming, Unit Testing

Injecting data into Obj-C readonly properties

<tl;dr> If you want to inject data into an object that only has read-only properties, swizzle the synthesised getter function so you can inject the data you need at the point it’s accessed. For example </tl;dr>   I recently needed to set up some client side unit tests for our iOS receipt verification server. This [...]

Accu, C++, Community, Conferences, Continuous Integration, Git, Unit Testing

Accu 2014 Conference Notes

I had the chance to go to ACCU 2014 the other week (full conference schedule is here) and I have to say it was one of the best conferences I've had the pleasure to attend. And while it did confirm my idea that C++ is getting the point of saturation and ridiculous excess (C++11 was [...]

Development, Unit Testing

‘Unit Testing’ Complex Systems

I was e-mailed by a co-worker the other week asking for advice on how to test a new feature that was implemented solely using private member functions and inaccessible objects within an existing system. It's an interesting question that people often struggle with when trying to 'unit test' complex or high level systems when they [...]

Programming, Unit Testing

Testing Objects with the Same Behaviour

One of the most difficult things when it comes to unit testing is cutting down on the number of duplicated tests. In the past I've often developed objects which have very different implementations but externally produce very similar results (for example when developing a vector compared to a fixed vector, or implementing different types of [...]

FTL, Programming, Unit Testing

Unit Testing an Object with Dependent Behaviour

It would be a good idea to start with a bit of history. In previous posts I've talked about our custom STL implementation which contains a basic vector, but also a fixed::vector which takes a fixed size and allocates all memory within that container (usually on the stack) and cannot increase or decrease in size. [...]