Reformat the testing chapter

This commit reformats the testing chapter (and adds minor polishing
changes) in order to avoid massive merge diffs in upcoming commits.

Issue: SPR-10357