adding source code for automatically detecting errors