For testing, there's the Adobe DNG SDK: https://helpx.adobe.com/camera-raw/digital-negative.html
You'll find the whole spec there, too. I think the source is also available somewhere.