Microsoft の最新のIDE Visual Studio 2017 に、新機能のLive Unit Testing(ライブ ユニット テスト)の機能が導入されました。 Live Unit Testingでは、コードの編集中にバックグラウンドで影響範囲のユニットテストが実行され、 その結果やテスト範囲がリアルタイムでエディターにわかりやすく表示されます。 コード変更の既存テストへの影響のほか、新たに追加したコードが既存のテスト範囲でカバーされているかどうかも即座にフィードバックされます。このため、バグの修正や機能の追加の際に、ユニットテストの作成が必要かどうかを把握できます。 (Visual Studio 2017 については、こちらで無料でインストールできます。(Windowsのみ)) この記事では、そのLive Unit Testingの機能の紹介の他に、 単体テストの書き方も、丁