testing your c#-based windows store app: top 10 areas to look for bugs
DESCRIPTION
Testing your C#-based Windows Store app: Top 10 areas to look for bugs. Francis Cheung (patterns & practices) Senior Software Development Engineer 3-133. Agenda. Background Top Problem Areas Demos Q&A. Background. Developed and tested Windows Store app: AdventureWorks Shopper - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Testing your C#-based Windows Store app: Top 10 areas to look for bugs](https://reader035.vdocuments.us/reader035/viewer/2022081604/568161c0550346895dd1a14b/html5/thumbnails/1.jpg)
![Page 2: Testing your C#-based Windows Store app: Top 10 areas to look for bugs](https://reader035.vdocuments.us/reader035/viewer/2022081604/568161c0550346895dd1a14b/html5/thumbnails/2.jpg)
Francis Cheung (patterns & practices)Senior Software Development Engineer3-133
Testing your C#-based Windows Store app: Top 10 areas to look for bugs
![Page 3: Testing your C#-based Windows Store app: Top 10 areas to look for bugs](https://reader035.vdocuments.us/reader035/viewer/2022081604/568161c0550346895dd1a14b/html5/thumbnails/3.jpg)
BackgroundTop Problem AreasDemosQ&A
Agenda
![Page 4: Testing your C#-based Windows Store app: Top 10 areas to look for bugs](https://reader035.vdocuments.us/reader035/viewer/2022081604/568161c0550346895dd1a14b/html5/thumbnails/4.jpg)
• Developed and tested Windows Store app: AdventureWorks Shopper
• Harvest learnings• Harvest reusable library
(Prism for Windows Runtime)
Background
![Page 5: Testing your C#-based Windows Store app: Top 10 areas to look for bugs](https://reader035.vdocuments.us/reader035/viewer/2022081604/568161c0550346895dd1a14b/html5/thumbnails/5.jpg)
Top Problem AreasTop Problem AreasSuspend/resumeTerminate/restartClient updatesNetwork connectivityAsynchronous codeResolutions and orientationDevice testingLocalizabilityAccessibilityReview against user experience (UX) guidelines
![Page 6: Testing your C#-based Windows Store app: Top 10 areas to look for bugs](https://reader035.vdocuments.us/reader035/viewer/2022081604/568161c0550346895dd1a14b/html5/thumbnails/6.jpg)
• Validate app behavior when app resumes• Updated server data• Sensors
• Use Visual Studio debugger to suspend/resume or terminate/relaunch every state of app
Suspend/resume & Terminate/relaunch
![Page 7: Testing your C#-based Windows Store app: Top 10 areas to look for bugs](https://reader035.vdocuments.us/reader035/viewer/2022081604/568161c0550346895dd1a14b/html5/thumbnails/7.jpg)
Demo: Suspend/resume and Terminate/relaunch with Navigation
![Page 8: Testing your C#-based Windows Store app: Top 10 areas to look for bugs](https://reader035.vdocuments.us/reader035/viewer/2022081604/568161c0550346895dd1a14b/html5/thumbnails/8.jpg)
Client updatesSimulate update with old settings and data• Copy old data into Local/Temporary folder• Detect data serialized in old format• Convert data to new format
Think about versioning of data!
![Page 9: Testing your C#-based Windows Store app: Top 10 areas to look for bugs](https://reader035.vdocuments.us/reader035/viewer/2022081604/568161c0550346895dd1a14b/html5/thumbnails/9.jpg)
Demo: Client update issues
![Page 10: Testing your C#-based Windows Store app: Top 10 areas to look for bugs](https://reader035.vdocuments.us/reader035/viewer/2022081604/568161c0550346895dd1a14b/html5/thumbnails/10.jpg)
Network connectivity• Test no/slow connectivity• Unplug/Disconnect• Fiddler
• Metered connections
![Page 11: Testing your C#-based Windows Store app: Top 10 areas to look for bugs](https://reader035.vdocuments.us/reader035/viewer/2022081604/568161c0550346895dd1a14b/html5/thumbnails/11.jpg)
Demo: Network connectivity issues and Metered connections
![Page 12: Testing your C#-based Windows Store app: Top 10 areas to look for bugs](https://reader035.vdocuments.us/reader035/viewer/2022081604/568161c0550346895dd1a14b/html5/thumbnails/12.jpg)
Asynchronous code cancellation
Stephen Toub’s session (3-301): Async'ing Your Way to a Successful App with .NET
Test re-entering a page multiple times which starts multiple async calls
![Page 13: Testing your C#-based Windows Store app: Top 10 areas to look for bugs](https://reader035.vdocuments.us/reader035/viewer/2022081604/568161c0550346895dd1a14b/html5/thumbnails/13.jpg)
Asynchronous code
Exception when tapping submit button repeatedly?
Test behavior when app starts async operations• Disable buttons• Control order of tasks
![Page 14: Testing your C#-based Windows Store app: Top 10 areas to look for bugs](https://reader035.vdocuments.us/reader035/viewer/2022081604/568161c0550346895dd1a14b/html5/thumbnails/14.jpg)
Async InterleavingException when updating deleted item?Initiate multiple async operations• Don’t know when operations
will complete.• If operations are
related/dependent, strange things can happen
![Page 15: Testing your C#-based Windows Store app: Top 10 areas to look for bugs](https://reader035.vdocuments.us/reader035/viewer/2022081604/568161c0550346895dd1a14b/html5/thumbnails/15.jpg)
Asynchronous code• Test your app with random delays in async calls
• Use Fiddler to delay service calls
public async Task<Customer> GetCustomerAsync(customerId){#if DEBUG
await Task.Delay(new Random().Next(500,2000));#endif
return await dataAccess.GetCustomerAsync(customerId);}
![Page 16: Testing your C#-based Windows Store app: Top 10 areas to look for bugs](https://reader035.vdocuments.us/reader035/viewer/2022081604/568161c0550346895dd1a14b/html5/thumbnails/16.jpg)
Demo: Async interleaving
![Page 17: Testing your C#-based Windows Store app: Top 10 areas to look for bugs](https://reader035.vdocuments.us/reader035/viewer/2022081604/568161c0550346895dd1a14b/html5/thumbnails/17.jpg)
Resolutions and orientations• Use simulator to test all resolutions and
orientations• App should be functional in as many orientations
and window sizes as possible
![Page 18: Testing your C#-based Windows Store app: Top 10 areas to look for bugs](https://reader035.vdocuments.us/reader035/viewer/2022081604/568161c0550346895dd1a14b/html5/thumbnails/18.jpg)
Device testing• Local Machine• Simulator• ARM (Surface)• x64 and x86
![Page 19: Testing your C#-based Windows Store app: Top 10 areas to look for bugs](https://reader035.vdocuments.us/reader035/viewer/2022081604/568161c0550346895dd1a14b/html5/thumbnails/19.jpg)
Localizability• Pseudo-localization
– Use the Multilingual App Toolkit to generate pseudo translations– Add English (qps-ploc) from Control Panel > Language > 'Add a language'
![Page 20: Testing your C#-based Windows Store app: Top 10 areas to look for bugs](https://reader035.vdocuments.us/reader035/viewer/2022081604/568161c0550346895dd1a14b/html5/thumbnails/20.jpg)
Demo: Pseudo-localization
![Page 21: Testing your C#-based Windows Store app: Top 10 areas to look for bugs](https://reader035.vdocuments.us/reader035/viewer/2022081604/568161c0550346895dd1a14b/html5/thumbnails/21.jpg)
Accessibility• Try to use the app with eyes closed and Narrator
turned on• Accessible visual experience
• High contrast (black/white)• Text contrast (WAT-C Contrast Analyser)
• Verify keyboard accessibility• Onscreen & physical keyboardDon’t forget about me!
![Page 22: Testing your C#-based Windows Store app: Top 10 areas to look for bugs](https://reader035.vdocuments.us/reader035/viewer/2022081604/568161c0550346895dd1a14b/html5/thumbnails/22.jpg)
Demo: Narrator & High Contrast / Black and White
![Page 23: Testing your C#-based Windows Store app: Top 10 areas to look for bugs](https://reader035.vdocuments.us/reader035/viewer/2022081604/568161c0550346895dd1a14b/html5/thumbnails/23.jpg)
Test against UX guidelines• Index of UX guidelines for Windows Store
apps• Modal pop-up versus flyouts versus full
page• When testing the app, review UX guidelines for:• App bars• Flyouts• Navigation• Layout• Animation
![Page 24: Testing your C#-based Windows Store app: Top 10 areas to look for bugs](https://reader035.vdocuments.us/reader035/viewer/2022081604/568161c0550346895dd1a14b/html5/thumbnails/24.jpg)
Top Problem AreasTop Problem AreasSuspend/resumeTerminate/restartClient updatesNetwork connectivityAsynchronous codeResolutions and orientationDevice testingLocalizabilityAccessibilityReview against user experience (UX) guidelines
![Page 25: Testing your C#-based Windows Store app: Top 10 areas to look for bugs](https://reader035.vdocuments.us/reader035/viewer/2022081604/568161c0550346895dd1a14b/html5/thumbnails/25.jpg)
LinksAdventureWorks Shopper reference implementation:http://msdn.microsoft.com/en-us/library/windows/apps/xx130643.aspx
Francis Cheung ([email protected])
![Page 26: Testing your C#-based Windows Store app: Top 10 areas to look for bugs](https://reader035.vdocuments.us/reader035/viewer/2022081604/568161c0550346895dd1a14b/html5/thumbnails/26.jpg)
Q&A
![Page 27: Testing your C#-based Windows Store app: Top 10 areas to look for bugs](https://reader035.vdocuments.us/reader035/viewer/2022081604/568161c0550346895dd1a14b/html5/thumbnails/27.jpg)
Evaluate this session
Scan this QR code to evaluate this session and be automatically entered in a drawing to win a prize!
![Page 28: Testing your C#-based Windows Store app: Top 10 areas to look for bugs](https://reader035.vdocuments.us/reader035/viewer/2022081604/568161c0550346895dd1a14b/html5/thumbnails/28.jpg)
© 2013 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.