1 / 24

Unit testing your metro style apps built using XAML

TOOL-529T. Unit testing your metro style apps built using XAML. Peter Provost Senior Program Manager Microsoft Corporation. Agenda. New unit t esting c apabilities in Visual Studio 11 Unit t esting managed XAML apps Unit t esting n ative code Recap Key takeaways

taryn
Download Presentation

Unit testing your metro style apps built using XAML

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. TOOL-529T Unit testing your metro style apps built using XAML Peter Provost Senior Program Manager Microsoft Corporation

  2. Agenda • New unit testing capabilities in Visual Studio 11 • Unit testing managed XAML apps • Unit testing native code • Recap Key takeaways • How to use the new Visual Studio unit testing features • Design your new XAML app for high quality & testability

  3. What is unit testing? • Unit testing is a method by which individual units of source code are tested to determine if they are fit for use • A unit is the smallest testable part of an app • Unit tests are typically written and run by software developers to ensure that code meets its design and behaves as intended

  4. Other kinds of testing • Integration testing • Confirm that the parts work when put together • Functional or system testing • Confirm that the whole system meets the specified requirements • Exploratory testing • A tester intentionally explores areas of the system, looking for inconsistencies or incorrect behavior

  5. Effective unit testing is one of the biggest contributors to high quality software.

  6. Unit testing features in Visual Studio 11

  7. Unit test explorer • New, extensible test runner interfacein Visual Studio 11 • All important information available at a glance • Designed for developers writing tests • Fast and scalable • Available in Win8Express, Pro, Premium and Ultimate editions

  8. Test framework extensibility How do you want to test today? • New plugin model can support any unit testing framework • Built in support for • VS managed tests (aka MS-Test) • New VS native unit testing framework

  9. demo Visual Studio 11Unit Test Explorer A quick look at the new Unit Test Explorer and unit testing Metro style apps

  10. Unit testing managed XAML apps

  11. demo Unit Testing an existing managed XAML app What happens when you take an existing app that was not designed for testing and try to add unit tests to it?

  12. Windows 8 concepts & issues • The AppContainersandbox • Isolates your app from the system and vice-versa • Prevents use of many .NET APIs • Requires a special kind of unit test project • Dealing with XAML issues • XAML can only be properly rendered within your app • Try to avoid putting much in the code-behind file

  13. Key elements for success • Design for testability • Test units in isolation from one another • Isolate dependencies • Write tests while you code and run them often

  14. demo Unit Testing an existing managed XAML app Using some well-known patterns to separate logic from UI, we can make the app very easy to test.

  15. Unit testing native code

  16. Native Unit Testing framework • In Visual Studio 11 we will be introducing a new Unit Testing Framework for C/C++ • Speedy test authoring with terse syntax • Light weight, performant test discovery and execution • Tests are isolated and do not pollute the environment • Fully featured and extensible: fixtures, attributes, assertions, logging, expected exceptions

  17. Testing native C++ overview • Write your tests in the samelanguage you write your code • Design for testability, test in isolation, run your tests frequently • Deal with the Windows 8 specific concepts and issues

  18. demo Unit testing native code If you are using native code today, or plan to use it for your new apps, you can have the same unit testing experience

  19. Recap

  20. Unit testing Metro style XAML apps • Visual Studio 11 brings a new focus on developer testing with an improved user experience and extension model • Managed or native code, you choose! • You should use well-known design patterns like MVVM for improved testability

  21. Related sessions • [TOOL-455T] Developing and testing on Windows 8 with Hyper-V • [TOOL-515T] Tips and tricks for developing Metro style apps using XAML • [TOOL-530T] Manual testing of Windows Metro style apps built using HTML • [TOOL-793T] Working on an agile team with Visual Studio 11 and Team Foundation Server 11

  22. thank you Feedback and questions http://forums.dev.windows.com Session feedbackhttp://bldw.in/SessionFeedback

  23. © 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

More Related