testing windows phone 8.1 app with unit test and coded ui test

20
Michele Capra Twitter: @ piccoloaiutante Mail: [email protected] Test your Windows Phone 8.1 Apps Windows Phone 8.1

Upload: michele-capra

Post on 26-May-2015

445 views

Category:

Technology


2 download

DESCRIPTION

This presentation will introduce you to how to test your Windows Phone 8.1. You'll have an introduction to unit test, integration test and coded UI test. Here you can find the related code https://github.com/piccoloaiutante/NotaSpese.

TRANSCRIPT

Page 1: Testing Windows Phone 8.1 app with unit test and Coded UI test

Michele Capra

Twitter: @ piccoloaiutanteMail: [email protected]

Test your Windows Phone 8.1 Apps

Windows Phone 8.1

Page 2: Testing Windows Phone 8.1 app with unit test and Coded UI test

2

• Mvvm• Introduzione al testing di app• Tools per testing• Demo • Coded UI Test• Tools per coded UI test• Demo

Agenda

Page 3: Testing Windows Phone 8.1 app with unit test and Coded UI test

04/12/2023 3

• Indispensabile per separare UI da logica

• Applicazione del pattern

• Framework o plain

MVVM

Page 4: Testing Windows Phone 8.1 app with unit test and Coded UI test

04/12/2023 4

• Separazione delle competenze

• Es view, viewmodel, service, model

• Possibilità di isolare bene le varie classi da testare

App design

Page 5: Testing Windows Phone 8.1 app with unit test and Coded UI test

5

APP TESTING

Page 6: Testing Windows Phone 8.1 app with unit test and Coded UI test

04/12/2023 6

In ingegneria del software, per unit testing (testing d'unità o testing unitario) si intende l'attività di testing (prova, collaudo) di singole unità software.

In ingegneria del software, per test di integrazione si intende l’attività di testing in cui singole unità software sono composte assime e testate come gruppo.

Test unitario vs. test d’integrazione

Page 7: Testing Windows Phone 8.1 app with unit test and Coded UI test

04/12/2023 7

Test unitario:• ViewModel• Business logic

Test d’integrazione:• Tutte le classi che fanno I/O (rete, database, file)• Tutta la app dai ViewModel in giù

Cosa testare nelle app Windows Phone

Page 8: Testing Windows Phone 8.1 app with unit test and Coded UI test

04/12/2023 8

• Isolare il ViewModel

• Farlo dialogare con altri oggetti fake

• Verificare le assunzioni fatte nei test

Come testare i ViewModel

Page 9: Testing Windows Phone 8.1 app with unit test and Coded UI test

04/12/2023 9

• MSTest Framework come libreria per i test

• Test scritti in C#/C++

• I test vengono eseguiti in un’app

Unit Test Framework per Windows Phone 8.1

Page 10: Testing Windows Phone 8.1 app with unit test and Coded UI test

04/12/2023 10

• Windows 8.1• Visual Studio 2013 Update 2

• Express, Pro, Premium and Ultimate editions

Strumenti

Page 11: Testing Windows Phone 8.1 app with unit test and Coded UI test

11

DEMO

Page 12: Testing Windows Phone 8.1 app with unit test and Coded UI test

04/12/2023 12

• Primo test• Testing async• In line data driving• Assert on exception• Command line testing

Recap demo

Page 13: Testing Windows Phone 8.1 app with unit test and Coded UI test

04/12/2023 Microsoft Confidential

13

CODED UI TEST

Page 14: Testing Windows Phone 8.1 app with unit test and Coded UI test

04/12/2023 14

• Novità per le app per Windows Phone 8.1• E’ possibile effettuare un test di integrazione al

100% (dalla UI in giù!)• Molto utili come test di regressione • Supporto di tutte le gesture

Filosofia

Page 15: Testing Windows Phone 8.1 app with unit test and Coded UI test

04/12/2023 15

• Creare la UI Map come repository per i controlli della UI

• Scrivere i test

• Eseguirli come applicazione

Passi

Page 16: Testing Windows Phone 8.1 app with unit test and Coded UI test

04/12/2023 16

• Windows 8.1• Visual Studio 2013 Update 2

• Premium and Ultimate editions

Strumenti

Page 17: Testing Windows Phone 8.1 app with unit test and Coded UI test

17

DEMO

Page 18: Testing Windows Phone 8.1 app with unit test and Coded UI test

04/12/2023 18

• Come e dove fare Unit Test

• Come e dove usare i Coded UI Test

Recap

Page 19: Testing Windows Phone 8.1 app with unit test and Coded UI test

04/12/2023 19

ciao!

https://github.com/piccoloaiutante/NotaSpese

Page 20: Testing Windows Phone 8.1 app with unit test and Coded UI test

04/12/2023 20

© 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.

The information contained in this document represents the current view of Microsoft Corp. on the issues discussed as of the dateof publication. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitmenton the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information presented after the date of publication.This guide is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT.Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no partof this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form, by any means (electronic, mechanical, photocopying, recording or otherwise), or for any purpose, without the express written permission of Microsoft.Microsoft may have patents, patent applications, trademarks, copyrights or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights or other intellectual property.The example companies, organizations, products, domain names, email addresses, logos, people, places, and events depicted herein are fictitious. No association with any real company, organization, product, domain name, email address, logo, person, place, or event is intended or should be inferred.