Test and correcting og writing errors