12. Pexの紹介 Microsoft Research が開発したツール 名前から想像がつくように、MS の関連研究機関です。 (一応独立しているらしい。) F# とか Spec# も Microsoft Research から出てきました。
13. Pex automatically generates test suites with high code coverage.Right from the Visual Studio code editor, Pex finds interesting input-output values of your methods, which you can save as a small test suite with high code coverage. Microsoft Pex is a Visual Studio add-in for testing .NET Framework applications. http://research.microsoft.com/en-us/projects/pex/default.aspx
22. 試してみよう! using System; public class Class1 { public int divide(int a, int b) { if (b == 0) throw new ArgumentException(“0除算良くない!"); return a / b; } } このコード意図していない 例外が発生します!
25. 試してみよう! もう少し詳しく見てみると… Pex generates Unit Tests from Parameterized Unit Tests through Automated White box Testing based on Dynamic Symbolic Execution: http://research.microsoft.com/en-us/um/redmond/projects/pex/wiki/WebHome.html Pexは parameterized unit tests から、テストメソッドを生成してくれるツール。