Inadequate design and testing caused last year's battery fire that led to the grounding of Boeing Dreamliner jets for more than three months, investigators concluded.