I'm writing a client application that receives a JSON response from a server. In the past I've run into situations where a developer on the server side changes the JSON response in a way that causes the client application to crash. An example of this is when the client expects that a JSON field or subobject will always be present, but a change on the server side causes the JSON to deviate from what is expected possibly returning a null value when null should never be a possible response.It seem like the server side could always have unit tests that ensure that the JSON response fulfills the contract, but that's susceptible to human error if a developer decides to rewrite a test or simply makes a mistake in testing or misunderstands a requirement. The client side can check that the JSON response is valid, but this would need to occur at runtime and if the server is writing proper tests, the double-checking of the server response by the client would be unnecessary.Is there a recommended process to ensure that the contract (JSON response format) between the client and server doesn't get broken? 
Should a client ever test server response at runtime?
server;client server;client
Yes, you should validate what you get, but you also need to be a Tolerant Reader:http://martinfowler.com/bliki/TolerantReader.htmlMartin Fowler states that:My recommendation is to be as tolerant as possible when reading data from a service. If you're consuming an XML file, then only take the elements you need, ignore anything you don't. Furthermore make the minimum assumptions about the structure of the XML you're consuming. Which, to my experience is a good way to be resilient (tolerant) to changes. Also, if the change is too big to be tolerant, you should consider some strategy to versioning your API:https://blog.pivotal.io/labs/labs/api-versioninghttp://www.mashery.com/blog/ultimate-solution-versioning-rest-apis-content-negotiationFrom a more practical point of view, you can also write some test/contracts to your API so that you can continuously check the contracts:https://github.com/realestate-com-au/pact (see the links at the end of page)https://github.com/thoughtworks/pacto