testing

Testing tools, testing philosophy & methodology...
2015-10-05T16:51:59.000005Z

I have a decision upcoming that I'd like more input on, maybe more angles: Here's the background: I am writing currently tests against our API (let's call that my 'production code'). I am writing the necessary validation and parsing code unit-test-driven (let's call that 'test code'). I have currently no direct influence on the code behind the API as I do not know that language and don't intend to learn it at this point. Here's my decision to take: The code that I write to parse the API's answers is on one hand pretty easy, but I am not a top notch developer, so I feel better to check that it's doing what it's supposed to. It's deeply nested maps and lists. I started checking the structures of the arguments and return values of the needed functions with libs like Prismatic.Schema and doorkey.annotate. In fact I wrote both options to compare them. Also I compared writing explicit validation tests to having annotations that validate functions inline. Talking to a colleague this morning we looked at the multiple options. On one hand I feel safer with the validation than without. On the other hand the inline options clutters my little nice and neat functions. Also I don't like the explicit tests too much as I need to generate a lot of test data (currently with test.check). And then this is a not typed language and being that is one of its strengths. Testing for data structures seems very much going back to typing and I'm hesitant. Any addditional thoughts? Sorry, this got so much longer than intended but I tried giving additional thoughts and context 😑