Testing with VS2010 - A Bugs Life

  • 13,471 views
Uploaded on

V1.0 …

V1.0
How often do you get a bug report that you can’t reproduce?
How often do you struggle to find the source of the bug in your code?
How can you streamline the testing process and make sure you don’t repeat the same bugs?
With Visual Studio 2010 & Team Foundation Server (TFS) 2010 there are a lot of new features for testers and developers that will solve these problems.
In this session you will learn how to: automate more, reproduce bugs easier, maintain your tests and configuration and discover problems sooner.

from Peter Gfader

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
13,471
On Slideshare
0
From Embeds
0
Number of Embeds
3

Actions

Shares
Downloads
280
Comments
0
Likes
2

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide
  • Peter Gfader Testing with VS2010
  • Java current version 1.6 Update 171.7 released next year 2010Dynamic languages Parallel computingMaybe closures
  • The silliest bug report ever seen ...“The worst bug report I ever seen... And actually I wrote it”
  • Not everyone in GermanyThis is already quite good...Stacktrace, Exception, Screenshot ...Automated exception handlerNo steps to reproduceUnable to reproduce without customer...Not easy to fix, until I know This is the answer to the problem... But I don’t know what the question is...I want steps to reproduce...You could to a lot of Trace.Writelines or use log4net or some other logging framework...I save you from all these! 
  • Windows app?
  • This is another way of sending a bug. Its OKTFS web accessTester and Client can directly enter bugs into your bug tracking system
  • TFS + Emails + TeamCompanion
  • Windows app?We take that a bit further as well...Is there anything else you want to have in your bug reports?Sys infoScreen size...MHTML, short for MIMEHTML, is a web page archive format used to bind resources that are typically represented by external links (such as images, Flash animations, Java applets, audio files) together with HTML code into a single file. The content of an MHTML file is encoded as if it were an HTML e-mail message, using the MIME type multipart/related.
  • Do all these things....
  • App.xaml
  • SKIP THIS
  • We have RyanDo you have a dedicated tester?That does just testing? No coding? Not on the same project...
  • Integrate the whole system
  • Relies on entries in the database, should use in memory/mock objectsWhat are we testing here?Naming of Test should reflect: What are we testing? Scenario: Input values, Behaviour,
  • Tests that span multiple layers (for example business logic, view, and controller) are also not considered unit tests You have to do special things to your environment (such as editing config files) to run it.
  • how is it different that an integration test?An integration test usually is not in-memory: it may touch the disk file system, databases, registry or other shared resources.  It may read or need a configuration file of the file system, wheas a unit test can be fully configured in-memory, for example.An integration test will usually run much slower because it does not run in-memory.An integration test can be less consistent – it may use threads or random number generators so that the result of the test is not always consistent.---
  • An integration test will usually run much slower because it does not run in-memory.An integration test can be less consistent – it may use threads or random number generators so that the result of the test is not always consistent.---– it may use threads or random number generators so that the result of the test is not always consistent.
  • Integration test: Test on physical serverIntegration tests: Should be setup env. Themselves and tear down afterwardsDateTime.Now Moq:MDateTime
  • Readable: Easy to understand, see what we are testing, why, expectMaintainable: If they are to hard to maintain they’ll get stale, and your investment in writing them was wasted. Trustworthy: If you can’t trust your tests to find bugs (and especially if you don’t know you can’t trust them), then the opposite may be true — you may be confident you don’t have bugs when you do.
  • Don’t repeat the same logic in the test!Bug is reproduced in test!
  • ** Find better example for DB mocking
  • WebFormsMvp.UnitTestshttp://webformsmvp.codeplex.com/
  • WebFormsMvp.UnitTestshttp://webformsmvp.codeplex.com/
  • This is the old way!!!
  • No detailed planCreate click sequence that is out of the mainstream
  • Magic moment when we close tasks:Dev: “Should be fine now”“Unable to reproduce” = “Works on my machine”“Unable to reproduce” is just as silly as “works on my mach”Every time you choose that, the screen should come up
  • No time to fix all bugs --> We must SHIP (we call this the “Vista method”) #8
  • How often do you get a bug report that you can’t reproduce? How often do you struggle to find the source of the bug in your code?
  • Start up “Microsoft Test and LabManager”
  • ONLY IN Visual Studio Ultimate edition
  • Tester sees tests to doWe pick test division by 0
  • “Create action recording” - To reproduce steps
  • TestCaseCollectorErrorWarning.xml =WarningErrors from MTLM<?xml version="1.0" encoding="UTF-8"?><DataCollectionLogxmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010"> <DataCollectorMessages> <DataCollectorExceptionMessage timestamp="2009-11-14T22:26:52.7623220+11:00" dataCollectorUri="datacollector://microsoft/VideoRecorder/1.0" dataCollectorFriendlyName="Video Recorder" agentName="WIN-M3V9YMSUKRG" level="Error"> <Text>A video recording cannot be created</Text> <ExceptionType>Microsoft.VisualStudio.TestTools.Execution.WindowsMediaEncoderNotInstalledException</ExceptionType> <ExceptionMessage>To create a video recording, follow the instructions on the following link to install any necessary software:http://go.microsoft.com/fwlink/?LinkId=154778</ExceptionMessage> </DataCollectorExceptionMessage> <DataCollectorMessage timestamp="2009-11-14T22:29:45.6272345+11:00" dataCollectorUri="datacollector://microsoft/TraceDebugger/1.0" dataCollectorFriendlyName="IntelliTrace" agentName="WIN-M3V9YMSUKRG" level="Warning"> <Text>No Microsoft .NET applications were launched during the test run. Launch applications from Explorer or a new command prompt after a test case has started. If no .NET application is being tested, disable the Test Impact and IntelliTrace Data Collectors.</Text> </DataCollectorMessage> <DataCollectorMessage timestamp="2009-11-14T22:29:45.6321170+11:00" dataCollectorUri="datacollector://microsoft/TraceDebugger/1.0" dataCollectorFriendlyName="IntelliTrace" agentName="WIN-M3V9YMSUKRG" level="Warning"> <Text>The data collector is configured to collect data from IIS, but no web request was intercepted during the test. Ensure that the "ASP.NET Client Proxy for IntelliTrace and Test Impact" is enabled in the client test settings and that "localhost" or "127.0.0.1" is not being used to contact the server. This warning is expected if the test is not testing a web application or web service on the IIS server.</Text> </DataCollectorMessage> </DataCollectorMessages></DataCollectionLog> ActionLog.txt Log fileUse this to create a test
  • What does the dev get?BAD: the tdlog (intelliTrace) is huge > 10MB of this exception
  • Trace (intelliTrace) is there in this bug (All Links)Uitest is there as well
  • Stacktrace is good...We don’t need it anymore...We see the error in yellow!!** Balloons over this
  • Balloon on exception on the transitionHOVER OVER d and see NAN: NOT POSSIBLE?
  • From my tester
  • http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.uitesting.applicationundertest%28VS.100%29.aspx
  • [TestMethod] public void CodedUITestMethod1() {ApplicationUnderTestappUT = ApplicationUnderTest.Launch(@"c:DataPeterGfaderProjectsTFSPeter-Gfader-Calculator runkWPFCalculatorcsharpinx86DebugAvalonCalculator2.exe"); // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items. this.UIMap.Press2();this.UIMap.PressDivide(); this.UIMap.Press0();this.UIMap.PressEquals();Assert.IsTrue(appUT.Process.Responding, "App not responding"); // cleanupappUT.Close(); }
  • Bug can be fixed directly in debugging session – since on same machine...Not sure if that’s the case when tester is on another machine...
  • BAD: the tdlog (intelliTrace) is huge > 10MB for this exception (1minute)
  • Think of falling asleep during a movie... Then you wake up suddenly because a shot happened in the movie. Now you rewind back to see what happened...Now imagine this with an exception (=shot)
  • Think of falling asleep during a movie... Then you wake up suddenly because a shot happened in the movie. Now you rewind back to see what happened...Now imagine this with an exception (=shot)
  • Think of falling asleep during a movie... Then you wake up suddenly because a shot happened in the movie. Now you rewind back to see what happened...Now imagine this with an exception (=shot)
  • Dev shouldn’t close the bugDev just says: Resolved
  • nDepend
  • Create sequence diagram -> context menu on method
  • "That is all I have for today. I appreciate you giving me your time. Thank you very much and have a great day." Peter Gfader
  • Menu doesn’t hop up and down on switching projects...
  • Adding more values (including notes) to data tipsIs this in source control? otherwise ???
  • Searching in the Breakpoints windowLabel breakpointsImport and export breakpoints (put under source control for all devs)String comparison for breakpoint conditions in native debuggingExport and Import of Breakpoints and Data Tips
  • Windows app?
  • Similar to TDD...
  • Click to add notesPeter Gfader Testing with VS2010

Transcript

  • 1. A bug’s life
    Testing with VS 2010
  • 2. Testing the world with Visual Studio 2010
    How often do you get a bug report that you can’t reproduce?
    How often do you struggle to find the source of the bug in your code?
    How can you streamline the testing process and make sure you don’t repeat the same bugs?
    With Visual Studio 2010 & Team Foundation Server (TFS) 2010 there are a lot of new features for testers and developers that will solve these problems.
    In this session you will learn how to: automate more, reproduce bugs easier, maintain your tests and configuration and discover problems sooner.
    Abstract
  • 3. In every day software development, we often encounter bugs that are difficult to reproduce and even more difficult to find. This problem is accentuated when it’s a reoccurring bug in the system. Visual Studio 2010 & Team Foundation Server (TFS) 2010 introduces heaps of new features that will help testers and developers in squashing these bugs once and for all.
    In this session you will learn how to:
    Reproduce bugs
    Automate your tests to find reoccurring bugs
    Maintain your tests and configuration
    Discover problems sooner
    Abstract
  • 4. SSA @ SSW
    Loves C# and .NET (Java not anymore)
    Specializes in
    Windows Forms
    ASP.NET
    TFS testing
    Automated tests
    Peter Gfader
  • 5. How to report bugs
    What to test to find bugs?
    Tests
    Unit tests
    Integration test
    Testing, reporting bugs and fixing bugs
    Test & Lab Manager (MTLM)
    VS2010
    Missing in VS2010
    Agenda
  • 6. “Pass by my office then I show you”
  • 7.
  • 8.
  • 9. Email
    Web application
    TFS web access
    How do you report bugs?
  • 10.
  • 11.
    • We love TFS
    • 12. And we love emails
    TeamCompanion glues those worlds together
    http://www.ssw.com.au/ssw/standards/rules/rulestobetterprojectmanagementwithtfs.aspx#TeamCompanionWorkItem
    How we report bugs
  • 13. Instructions to tester
    Reproduce steps
    Screen captures
    Stacktrace (Windows Forms, WPF, ASP.NET, Silverlight)
    Win7 Recorder?
    How do you report bugs (Instructions)?
  • 14. Reproduce steps
    Screen captures
    Stacktrace (Windows Forms, WPF, ASP.NET, Silverlight)
    Win7 Recorder ???
    URL (Page)
    Version number
    Browser (Firefox or IE)
    http://www.ssw.com.au/ssw/standards/Support/BugReportOrEnhancement.aspx
    Instructions to tester
  • 15.
    • Handle All unhandled exceptions
    • 16. Application.ThreadException
    • 17. Global.asax
    • 18. ** JavaScript
    Capturing unreported bugs #2
  • 19.
    • SSW Exception handler
    • 20. LadyLog
    http://www.ssw.com.au/ssw/Standards/Rules/RulesToBetterErrorHandling.aspx
    We suggest to use
  • 21. ** Triaging rule
    Runtime error  this release
    Suggestions / feature  next release
    Little UI ones  this release
    ** RULE
    Do you have rules on triaging?
  • 22. ** add pix
    Ryan
    His favourite quote
    “Test failed – 5 critical bugs found”
    Do you have a dedicated tester?
  • 23. Code
    UI
    DB
    Deployment
    Reports
    Performance
    Security
    Whole system
    User requirements fulfilled
    What do we want to test?
  • 24. Theory
  • 25. What is the problem here?
    1. What are we testing?
    [TestMethod]
    publicvoidTestCalculation()
    {
    varorderManager = newOrderManager();
    using (var db = newNorthwindDataContext())
    {
    var order = db.Orders.FirstOrDefault();
    var actual = orderManager.GetTotalIncGST(order);
    var expected = order.OrderItems.Sum(oi =&gt; oi.Qty * price) * 1.1;
    Assert.AreEqual(actual, expected);
    }
    }
    2.
  • 26. “A unit test is a fast, in-memory, consistent, automated and repeatable test of a functional unit-of-work in the system.”
    “A unit of work is any functional scenario in the system that contains logic. It can be as short as a function, or it can span multiple classes and functions, and it provides internal or business value to the system under test.”
    “Art of Unit Testing” Roy Osherove
    What is a Unit test?
  • 27. It talks to the database
    It communicates across the network
    It touches the file system
    It can&apos;t run at the same time as any of your other unit tests
    You have to do special things to your environment
    Configuration files, registry, ...
    Michael Feathers
    What is NOT a Unit test?
  • 28. Integrates different pieces
    UI
    Business Layer
    Database
    Not in memory
    Touches
    File system
    Registry
    Database
    Other shared resources
    Integration test
  • 29. Run much slower
    not run in-memory
    Less consistent
    Dependent from external resources
    Has side effects
    Harder to prepare
    E.g. Database setup
    Integration test
  • 30. Unit tests – ALWAYS
    Integration tests – “allow” to be red
    Why is this important?
  • 31. Readable
    Understand!
    What? Scenario? Expectation?
    Maintainable
    We change our application
    Trustworthy
    All  We are bug free
    Attributes of a good Unit test
  • 32. Exam!
  • 33. [TestMethod]
    publicvoidActualEndTime_PlusOvertimeHardcoded_Valid()
    {
    // Arrange
    EmployeeShiftnewShift=newEmployeeShift();
    newShift.EndTime=newDateTime(2000, 01, 01, 8, 0, 0);
    newShift.OvertimeAfter= 1.5;
    // Act
    DateTime actual = newShift.ActualEndTime;
    // Assert
    Assert.IsTrue(actual ==
    newDateTime(2000, 01, 01, 9, 30, 0));
    }
  • 34. [TestMethod]
    publicvoidGetDirtyObjects_Insert2Shifts_DirtyObjectsFound()
    {
    using (var db = newNorthwindDataContext())
    {
    // Arrange
    db.CreateNewEmployeeShift(
    1 // EmployeeId
    &quot;01/01/2000 02:00&quot;, &quot;01/01/2000 10:00“);
    db.CreateNewEmployeeShift(
    2 // EmployeeId
    &quot;01/01/2000 15:00&quot;, &quot;01/01/2000 19:00”);
    // Act
    vardirtyObjects =
    db.GetDirtyObjects(empShiftIdToVerify);
    // Assert
    Assert.IsTrue(dirtyObjects.Count() &gt; 0);
    }
    }
  • 35.         [TestMethod]
            publicvoidAlwaysTrueRuleTest()
            { //Arrange
                var rules = newList&lt;IRule&lt;Shift&gt;&gt;
                {
                    newWorkflowRule&lt;Shift&gt;()
                    {
                        Name = &quot;Rule 1&quot;,
                        Description = &quot;This rule will always pass&quot;,
                        Condition = &quot;true&quot;,
                        ErrorMessage = &quot;This will never be shown&quot;
                    }
                };
                var shift = newShift()
                {
                    ShiftID = Guid.NewGuid(),
                    StartTime = DateTime.Now,
                    EndTime = DateTime.Now
                };
    //Act
                var results = RuleManager.Execute&lt;Shift&gt;(shift, rules);
    //Assert
                Assert.IsTrue(results.Count == 0);
                Assert.IsTrue(results.IsValid);
            }
  • 36. [TestMethod]
    publicvoidTestCalculation()
    {
    varnorthWindDataContextFake =
    MockRepository.GenerateStub&lt;INorthwindDataContext&gt;();
    varorderitemsFake = Helper.CreateListOfOrders();
    varorderFake = Helper.CreateNewOrder();
    northWindDataContextFake.Stub(
    d =&gt; d.Orders.FirstOrDefault()).Return(orderFake);
    northWindDataContextFake.Stub(
    d =&gt; d.OrderItems).Return(orderitemsFake);
    varorderManager = newOrderManager();
    using (var db = northWindDataContextFake)
    {
    var order = db.Orders.FirstOrDefault();
    var actual = orderManager.GetTotalIncGST(order);
    var expected = order.OrderItems.Sum(
    oi =&gt; oi.Qty * oi.Price) * 1.1;
    Assert.AreEqual(actual, expected);
    }
    }
  • 37. [TestMethod]
    publicvoidPresenter_Request_ReturnsRequestFromHttpContext()
    {
    // Arrange
    var view = MockRepository.GenerateStub&lt;IView&gt;();
    varhttpContext =
    MockRepository.GenerateStub&lt;HttpContextBase&gt;();
    var request = MockRepository.GenerateStub&lt;HttpRequestBase&gt;();
    httpContext.Stub(h =&gt; h.Request).Return(request);
    // Act
    var presenter = newTestPresenter(view);
    presenter.HttpContext = httpContext;
    // Assert
    Assert.AreSame(request, presenter.Request);
    }
    http://webformsmvp.codeplex.com/
  • 38. [TestMethod]
    publicvoidRedirectPresenterRedirectsOnActionAccepted()
    {
    // Arrange
    var view = MockRepository.GenerateMock&lt;IRedirectView&gt;();
    varhttpContext = MockRepository.GenerateMock&lt;HttpContextBase&gt;();
    varhttpResponse = MockRepository.GenerateMock&lt;HttpResponseBase&gt;();
    httpContext.Expect(h =&gt; h.Response).Return(httpResponse);
    httpResponse.Expect(r =&gt; r.Redirect(&quot;~/RedirectTo.aspx&quot;));
    var presenter = newRedirectPresenter(view)
    {
    HttpContext = httpContext
    };
    // Act
    view.Raise(v =&gt; v.Load += null, view, newEventArgs());
    view.Raise(v =&gt; v.ActionAccepted += null, view, newEventArgs());
    presenter.ReleaseView();
    // Assert
    httpContext.VerifyAllExpectations();
    httpResponse.VerifyAllExpectations();
    }
    http://webformsmvp.codeplex.com/
  • 39. [TestMethod]
    publicvoid DataContextSubmitChangesValidateDirtyObjects_RuleResultSavedMeasureTime_RunProcessorAfterInsert5Shifts()
    {
    for (inti = 0; i &lt; 5; i++)
    {
    //dummy entries
    DbHelper.CreateNewEmployeeShift(
    DbHelper.EmployeeId1SouthSuperIntendentEast,
    &quot;01/01/2000 15:00“,
    &quot;01/01/2000 16:00“,
    true);
    }
    Stopwatch stopwatch = new Stopwatch();
    stopwatch.Start();
    RuleProcessor.Default.Start();
    System.Threading.Thread.Sleep(2000);
    RuleProcessor.Default.Stop();
    stopwatch.Stop();
    // no dirty object left
    vardirtyObjects = DbHelper.GetDirtyObjects();
    Assert.IsTrue(dirtyObjects.Count() == 0,&quot;Dirty objects found&quot;);
    }
  • 40. Hard to see
    Naming convention
    Unit test
    Test single small “unit of work”
    Integration test
    Test integration, functionality
    Unit test vs. Integration test
  • 41. Test & Lab Manager (MTLM)
    VS2010
    TestingReporting bugsFixing bugs
  • 42. VS2008Scenario #1
    Coding done
    Internal testing done
    Deploy to staging
    “Test please” to Tester…
  • 43. No plan (no user stories)
    Lucky to find bugs
    Waste a lot of time on irrelevant things
    This is called “Exploratory testing”
    Tester tests
  • 44. Subject: Bug found!!
    “I cant quite remember what I did but I got this after a while”
  • 45. Hi Ryan
    The developer tests and replies...
  • 46. Bug never gets fixed
  • 47. Dev: We have 2 additionally reported bugs
    PM: No time to fix bugs...
    We must SHIP!
     We call this the “Vista method”
    Finally at the end of Test phase
  • 48. 2 weeks development  BANG
    Tester has no plan – Exploratory testing
    Tester tests everything
    “Unable to reproduce” = “Works on my machine”
    Bug never gets fixed
    Ship a buggy product
    Problems
  • 49. VS2010#1 Tester uses Test Lab Manager
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55. Add screenshot
  • 56. #2 Tester files bug
  • 57.
  • 58. #3 Dev sees bug
    Start VS2010
    Open “My work items”
  • 59.
  • 60. More details...
  • 61. Bug in TFS
    Video.wmv
    Detailed steps
    IntelliTrace (drill through to Visual Studio)
    Automated recording
    Lots of details (you don’t need if you get intelliTrace)
    Stack trace
    System info
    What’s good?
  • 62. #4 Dev rewinds debugging session Dev spots bugs
  • 63.
  • 64.
  • 65. From recorded test we create an automated test
    Don’t fix bug yet#5 Create automated test
  • 66.
  • 67.
  • 68.
  • 69. Changes to the test
    //Arrange
    ApplicationUnderTestappUT =
    ApplicationUnderTest.Launch(@”binx86DebugAvalonCalculator2.exe&quot;);
    //Act // SNIP SNIPSNIP
    //Assert
    Assert.IsTrue(appUT.Process.Responding,
    &quot;App not responding&quot;);
  • 70.
  • 71. #6 Dev fixes bug
  • 72. VS2008: Developer tests manually his bug fix
    VS2010: Replay coded UI test
    #7 Dev verifies bug fix
  • 73. Automated test is GREEN
  • 74. Easy to reproduce the bug
    Create functional test (coded UI test)
    Automate the test from recording
    Good for future changes (Regression testing)
    What’s good with coded UI tests
  • 75.
    • Fall asleep during a movie
    IntelliTrace
  • 76.
    • Fall asleep during a movie
    • 77. Suddenly wake up because of a surprise!
    IntelliTrace
  • 78.
    • Fall asleep during a movie
    • 79. Suddenly wake up because of a surprise!
    • 80. Rewind back to see what happened...
    IntelliTrace
  • 81. Was called “Historical Debugging”
    Easy to spot the bug
    Record method calls with parameters
    Advanced call stack
    Get intellitrace logs from your testers
    Record / Trace testers execution
    Use same source code to debug as the tester had to test
    Get intellitrace logs from your build server
    What’s good in IntelliTrace
  • 82. Hi Ryan
    Done – Fixed and test added
    PS: you don’t need to test this again
    PPS: testers are becoming less useful with 2010
    Peter
    #8 Email to tester
  • 83. Everyone is happy
  • 84. They destroy things
    They break our code
    “Developers hate testers”
  • 85. VS2010 – New dev joins team
  • 86. Dependency graphs
    Get an overview
  • 87. TODO Insert image
    Assembly dependency
  • 88. Create sequence diagram -&gt; context menu on method
    What happens when?
  • 89. TODO Insert image
  • 90. Call hierarchy (not just debugging)
    View  Code definition window
    Navigate To Ctrl+comma
    Reference highlighting - select and wait
    Code navigation
  • 91. Extras
  • 92.
    • Dead code -> Code analysis
    Why gets my breakpoint never hit?
  • 93. Test impact analysis
    The developer sees that his code affected other tests (Test Impact analysis)
    Saves time on running tests
    Running a lot of tests is slow
  • 94. Changed shortcuts
  • 95. Many test cases
    Start application
    Login to application
    Browse to start page
     Annoying!
    What are shared steps?
  • 96. Re-use test steps over different test cases
    Record once
    Play back in other tests
    Use shared steps
  • 97. intelliTrace with WPF 64bit
  • 98. Tester: I want to test that specific build
  • 99. Choose specific build to test
  • 100. Tip: Why do I have this toolbar?
  • 101. Let your Knowledge workers know of this tool!
    Sending you problems in a standardized way
    With Win7 --&gt; use recorder
  • 102. VS2010 Debugging
  • 103. Sticky Data tips
  • 104. Pinning quick watch
  • 105. Label breakpoints
    Searching in the Breakpoints window
    Export and Import of Breakpoints and Data Tips (put under source control for all devs)
    Breakpoints Window
  • 106. MTLMHow can I get it?
  • 107. Email
    Web application
    TFS web access
    Test & Lab Manager
    Which one would you use now?
  • 108.
  • 109. When you get a bug report!
    Create test
    Test is RED
    Fix bug
    Test is GREEN
    Send a “Done - Test created”
    When do you create a test?
  • 110. Reproduce bug
    Spot bug
    “Works on my machine”
    Bug never gets fixed
    Generate test from bug
    Dev uses “Re-play” button instead of manual test
    Recap Scenario
  • 111.
  • 112. Every time I change something I want to test (verify) that I didn’t introduce a bug
    Deployment
    Bug fix
    New feature
    New report added
    I love automated tests
  • 113. Integrated web UI tests
    Windows UI tests, when they do it for Web, they can do it for Windows apps (Windows Forms, WPF)
    RowTests
    Data driven tests with attributes next to the test
    What I want in VS2012
  • 114. [TestMethod]
    [DeploymentItem(@&quot;TestDatavalidConditions.txt&quot;)]
    [DataSource(&quot;System.Data.OleDb&quot;,
    &quot;Provider=Microsoft.Jet.OLEDB.4.0;
    DataSource=|DataDirectory|;
    Extended Properties=&apos;text;FMT=TabDelimited;HDR=YES&apos;&quot;, @&quot;validConditions#txt&quot;, DataAccessMethod.Sequential)]
    publicvoidCodeParserTryParseCondition_Valid_ValidConditionsFromFile()
    {
    // Arrange
    string condition = TestContext.DataRow[0].ToString();
    CodeParsercodeParser = new CodeParser();
    // Act
    boolsuccessFul = codeParser.TryParseCondition(condition);
    // Assert
    Assert.IsTrue(successFul);
    }
  • 115. [TestMethod]
    [Row(&quot;Target.IsDirty&quot;)]
    [Row(&quot;Target.IsValid“)]
    [Row(&quot;(1 != 2)&quot;)]
    publicvoidCodeParserTryParseCondition_Valid_ValidConditionsFromFile(
    stringcondition)
    {
    // Arrange
    CodeParsercodeParser = new CodeParser();
    // Act
    boolsuccessFul = codeParser.TryParseCondition(condition);
    // Assert
    Assert.IsTrue(successFul);
    }
  • 116. Roy Osherove
    Book http://www.artofunittesting.com/
    Blog http://weblogs.asp.net/ROsherove/
    Unit test definitionhttp://weblogs.asp.net/ROsherove/archive/2009/09/28/unit-test-definition-2-0.aspx
    Michael Feathers
    Bloghttp://www.artima.com/weblogs/index.jsp?blogger=mfeathers
    What is not a unit test?http://www.artima.com/weblogs/viewpost.jsp?thread=126923
    Resources
  • 117. Compare Visual Studio editionshttp://www.microsoft.com/visualstudio/en-us/products/2010/default.mspx#compare
    Visual Studio pricing optionshttp://arstechnica.com/microsoft/news/2009/10/visual-studio-2010-simplified-to-four-skus-beta-2-arrives.ars
    Resources
  • 118. Good blog about VS2010http://blogs.msdn.com/habibh/
    How Does VS2010 Historical Debugging Work?http://www.wintellect.com/CS/blogs/jrobbins/archive/2009/06/16/how-does-vs2010-historical-debugging-work.aspx
    Resources
  • 119. 3things…
    PeterGfader@ssw.com.au
    http://peitor.blogspot.com
  • 120. Thank You!
    Gateway Court Suite 10 81 - 91 Military Road Neutral Bay, Sydney NSW 2089 AUSTRALIA
    ABN: 21 069 371 900
    Phone: + 61 2 9953 3000 Fax: + 61 2 9953 3105
    info@ssw.com.auwww.ssw.com.au