Diagnostics and battery testing