Download - Testing μέσα από το Visual Studio!
Testing μέσα από το Visual Studio!
31/5/2012
Testing για τον Προγραμματιστή
31/5/2012
Γιώργος ΚαρκαλήςSafeCape Software Solutions
Agenda− Unit testing− Code coverage− Profiling / Performance− VS11 – what’s new− Exploratory testing− Azure for testing− Tips & tricks
Unit testing− Primary goal :
− take the smallest piece of testable software
− isolate it from the remainder of the code− determine whether it behaves exactly as
expected
int c = Add(1, 2)Assert.AreEqual(3, c);
Unit testing in VS− VS2010 : Microsoft Unit Testing
Framework− Based on Attributes
− [TestClass]− [TestInitialize]− [TestMethod]− ...
− VS11: Support for any Unit Testing framework− xUnit, nUnit...− Common Unit Test Explorer
DemoUnit Testing
Code Coverage− Τι ποσοστό του κώδικα καλύπτουν τα
unit tests που έχω φτιάξει− Code Instrumentation− Block-based statement coverage− Line-based coverage− Source code color highlighting
DemoCode Coverage
Profiler – Performance Analysis− Identify appl hotspots and memory
leaks− Tier Interaction profiling
− Database / ADO.NET− Modes:
− CPU Sampling− Instrumentation− Concurrency− .NET Memory Allocation
− Integration with Web tests – Load tests
− Reports comparison
DemoProfiler – Performance
Analysis
Visual Studio 11 – what’s new− Customer Feedback− Exploratory testing (TFS)− Unit test explorer− 3rd party frameworks− Performance improvements (test
execution)− 64-bit test execution− Async Unit Test support (.NET 4.5)− Fakes & Shims− Continuous run tests after build
DemoVS 11 Exploratory Testing
Azure as testing rig
DemoAzure testing rig
DemoTesting tips & tricks
Ερωτήσεις
Usefull resources− Content Index for Unit Test
− http://blogs.msdn.com/b/mathew_aniyan/archive/2012/05/17/content-index-for-unit-test.aspx
− Content Index for Coded UI Test− http://
blogs.msdn.com/b/mathew_aniyan/archive/2010/02/11/content-index-for-coded-ui-test.aspx
− Content Index for Web Tests and Load Tests− http://blogs.msdn.com/b/edglas/archive/2007/12/17/content-inde
x-for-web-tests-and-load-tests.aspx− Using Visual Studio Load Tests in
Windows Azure Roles− http://msdn.microsoft.com/en-us/library/windowsazure/hh
674491.aspx