Haciendo realidad la agilidad




                                        Herramientas de pruebas unitarias
                                        Pex y Moles
                                        Ibon Landa
                            © flioukas




                                        Plain Concepts
                                        http://www.plainconcepts.com
                                        http://geeks.ms/blogs/ilanda




                                                                                    1


lunes 21 de junio de 2010
Pex & Moles
         White box unit testing tool for .Net
         Microsoft Research
         Visual Studio 2008/2010 add-in
         Free for personal use or with MSDN
         license
         Support multiple testing frameworks




                                                2


lunes 21 de junio de 2010
Pex = Project Exploration
         Helps with writing unit tests
         Analyze the branch conditions
         Create simple parameterized unit tests
         automatically
         Uses a constraint solver to
         systematically generate relevant inputs




                                                   3


lunes 21 de junio de 2010
Pex


      The result is a minimal test
       suite with maximum code
                coverage



                                     4


lunes 21 de junio de 2010
¿What is Moles?
         Lightweight mocking
         Allows replacing any .NET method with
         a delegate
         Isolate from environment dependencies
         such as time, file system, database…
         Two Types: Stub & Moles Type




                                                 5


lunes 21 de junio de 2010
Stub Type
         Rely on virtual method dispatch
         Cannot be used for static methods,
         non-virtual methods, sealed virtual
         methods, methods in sealed types..
         Self-contained
         Provide implementations of interfaces
         and abstract methods



                                                 6


lunes 21 de junio de 2010
Moles Type
         Rely on runtime code rewriting
         Significant performance degradation in
         execution time
         CLR profiler
         Cannot instrument interfaces and
         abstract methods




                                                 7


lunes 21 de junio de 2010
Haciendo realidad la agilidad




                                        Herramientas de pruebas unitarias
                                        Pex y Moles
                                        Ibon Landa
                            © flioukas




                                        Plain Concepts
                                        http://www.plainconcepts.com
                                        http://geeks.ms/blogs/ilanda




                                                                                    8


lunes 21 de junio de 2010

Cas2010 herramientas-de-pruebas-unitarias-pex-y-moles

  • 1.
    Haciendo realidad laagilidad Herramientas de pruebas unitarias Pex y Moles Ibon Landa © flioukas Plain Concepts http://www.plainconcepts.com http://geeks.ms/blogs/ilanda 1 lunes 21 de junio de 2010
  • 2.
    Pex & Moles White box unit testing tool for .Net Microsoft Research Visual Studio 2008/2010 add-in Free for personal use or with MSDN license Support multiple testing frameworks 2 lunes 21 de junio de 2010
  • 3.
    Pex = ProjectExploration Helps with writing unit tests Analyze the branch conditions Create simple parameterized unit tests automatically Uses a constraint solver to systematically generate relevant inputs 3 lunes 21 de junio de 2010
  • 4.
    Pex The result is a minimal test suite with maximum code coverage 4 lunes 21 de junio de 2010
  • 5.
    ¿What is Moles? Lightweight mocking Allows replacing any .NET method with a delegate Isolate from environment dependencies such as time, file system, database… Two Types: Stub & Moles Type 5 lunes 21 de junio de 2010
  • 6.
    Stub Type Rely on virtual method dispatch Cannot be used for static methods, non-virtual methods, sealed virtual methods, methods in sealed types.. Self-contained Provide implementations of interfaces and abstract methods 6 lunes 21 de junio de 2010
  • 7.
    Moles Type Rely on runtime code rewriting Significant performance degradation in execution time CLR profiler Cannot instrument interfaces and abstract methods 7 lunes 21 de junio de 2010
  • 8.
    Haciendo realidad laagilidad Herramientas de pruebas unitarias Pex y Moles Ibon Landa © flioukas Plain Concepts http://www.plainconcepts.com http://geeks.ms/blogs/ilanda 8 lunes 21 de junio de 2010