Having a MacBook Pro Late 2016, I can only dream of 4h battery life with the workload you describe. It has a bigger screen though.
I'm impressed; with Xcode and the simulator I'm lucky to get anything longer than 6 hours…
I got the figures from https://en.wikipedia.org/wiki/MacBook_Pro#Technical_specific... and https://en.wikipedia.org/wiki/MacBook_Pro#Technical_specific...