testing xaml-based windows store apps mit vs 2013

33
Nico Orschel | AIT Marc Müller | 4tecture Testen von XAML-based Store Apps mit VS 2013

Upload: nico-orschel

Post on 05-Dec-2014

98 views

Category:

Technology


0 download

DESCRIPTION

Talk about "Testing XAML-based Windows Store Apps with VS 2013" with VS / TFS 2013 @ Basta 2014, Speakers: Marc Müller, Nico Orschel

TRANSCRIPT

Page 1: Testing XAML-based Windows Store Apps mit VS 2013

Nico Orschel | AIT

Marc Müller | 4tecture

Testen von XAML-based

Store Apps mit VS 2013

Page 2: Testing XAML-based Windows Store Apps mit VS 2013

Agenda

• Einleitung

• Manuelles Testen

• Unit Testing

• UI Testing

• Fazit

Page 3: Testing XAML-based Windows Store Apps mit VS 2013

Testen mit VS und TFS

Microsoft Testmanager (MTM)

• Testmanagement

• Man. Testausführung (Formal+Agile)

• Testumgebungsmanagement

Visual Studio (Testautomatisierung)

• Code

• Autom. Testausführung (DefaultLabTemplate.XAML)*

Lab Management (Testumgebungen)

• SCVMM

• Standard

Page 4: Testing XAML-based Windows Store Apps mit VS 2013

Testpyramide

UI

Service

Unit / Component

Quelle: Mike Cohn

Unit Testing

Framework +

Isolation

Framework

Unit Testing +

Isolation

Framework

UI Test Frameworks

Page 5: Testing XAML-based Windows Store Apps mit VS 2013

Manuelles Testen

Page 6: Testing XAML-based Windows Store Apps mit VS 2013

Microsoft Test Manager

• Orientiert an Testeraufgaben– Testplanung

– Testdurchführung

– Testnachverfolgung

– Umgebungsmanagement

• „Testautomatisierung“

für Oberflächen

• Test und Entwicklung

enger zusammenbringen– „Rich Bugs“

– Testvirtualisierung

9

Page 7: Testing XAML-based Windows Store Apps mit VS 2013

Die Qual der Wahl: MTM vs. Test

Hub

Page 8: Testing XAML-based Windows Store Apps mit VS 2013

Infrastruktur

LAN MTMWindows 8.1 Tablet mit Microsoft Test Tools Adapter Service

LAN LAN

Page 9: Testing XAML-based Windows Store Apps mit VS 2013

Infrastruktur

Page 10: Testing XAML-based Windows Store Apps mit VS 2013
Page 11: Testing XAML-based Windows Store Apps mit VS 2013

Demo

Page 12: Testing XAML-based Windows Store Apps mit VS 2013

Unit Testing

Page 13: Testing XAML-based Windows Store Apps mit VS 2013

Unit Testing als Fundament

• Store Apps sind schnelllebig

• Kurze Releasezyklen

• Reaktion auf Kundenfeedback

• Refactoring

Page 14: Testing XAML-based Windows Store Apps mit VS 2013

Tests

Red, Green, Refactor

Code

Refactor!

Page 15: Testing XAML-based Windows Store Apps mit VS 2013

«Old fashioned» Big Design Up Front

All requirements known Architecture Diagram

Source: http://www.integrativebiology.ac.uk/softarch.html

QS / Rollout

Source: http://www.effectiveeng.com/en-030619.htm

Page 16: Testing XAML-based Windows Store Apps mit VS 2013

«Modern» Emergent Architecture

Each Sprint: Working Software

Page 17: Testing XAML-based Windows Store Apps mit VS 2013

Classic Code Structure

DB

Page 18: Testing XAML-based Windows Store Apps mit VS 2013

Decoupled Code Structure

DB

Page 19: Testing XAML-based Windows Store Apps mit VS 2013

Unit Testing Checklist

• Dependency Injection

– Dependencies auf Interfaces

– Modularisierung

• MVVM

– Binding

– Commands

– Behaviors

• Libraries: Prism, Caliburn Micro, etc.

Page 20: Testing XAML-based Windows Store Apps mit VS 2013

Besonderheiten WinStore Apps

• Zugriff auf Windows Apps Sandbox über

speziellen Test-Projekttyp

• Kein spezieller Test-Projekttyp für

WinJS-basierende Apps

– Alternative: Chuzpath JavaScript

Testrunner + Referenzen auf WinJS

Libraries

Page 21: Testing XAML-based Windows Store Apps mit VS 2013

Asynchrone Methoden

Page 22: Testing XAML-based Windows Store Apps mit VS 2013

Portable Libs

• Shared DLL

zwischen Store App,

Phone App, etc.

• Auslagern der Logik,

einfaches Unit

Testen

• Reduzierter

Befehlssatz

Page 23: Testing XAML-based Windows Store Apps mit VS 2013

Code Sharing in Universal Apps

• Shared Code =

Kopie zur

Compile Zeit

• Unit Test Projekte

pro Zielsystem

Page 24: Testing XAML-based Windows Store Apps mit VS 2013

Demo

Page 25: Testing XAML-based Windows Store Apps mit VS 2013

UI Testing

Page 26: Testing XAML-based Windows Store Apps mit VS 2013

CodedUI

• CodedUI ist eine

Testautomatisierungsplattform

• CodedUI unterstützt die meisten

Windows UI Technologien

• Gleiche API für Rich Client und Web

Applikationen

Page 27: Testing XAML-based Windows Store Apps mit VS 2013

Unterstützte PlattformenTechnology Support Comment

IE 8-11 Yes Older IEs are not

supported anymore

WinForms 2.0, WPF

3

Yes 3rd party controls could be

a problem

Win 8.1 Store Apps,

Windows Phone 8.1

Apps

Yes VS 2013, VS 2013 Update

2 (Phone)

Chrome, Firefox Yes Latest version via

Selenium Adapter, (> VS

2012 Update 1, VS 2013)

Silverlight No Unofficial support for

Silverlight v4/v5

Flash, Java, Mobile No e.g. Ranorex, Squish

Windows Win32 /

MFC

Partially May work with known

issues

SharePoint Yes > SP 2007, > VS 2012

Update 1, VS 2013

Vollständige Liste

siehe

http://msdn.microsof

t.com/en-

us/library/vstudio/dd

380742.aspx

Page 28: Testing XAML-based Windows Store Apps mit VS 2013

CodedUI Architektur

Web Plug-ins

(MSHTML/DOM)

Interpreter

Coded UI Test

Code

Generation

Test Runner

PlaybackRecorder

Rich Client Plug-ins

(UIA/MSAA)

Filter/

Aggregation

Rules

APIProperty

Provider

3rd Party Plug-ins

Action

Invoker

My UI

Technology Abstraction Layer

Page 29: Testing XAML-based Windows Store Apps mit VS 2013

3 CodedUI ArtenR

ecord

and

Pla

yback • Default

Approach

• Poor Code Generation

• Poor Maintainability

Record

UI M

aps • BetterMaintainability

• Supports large testrepositories

Hand C

ode T

ests • Expert Mode

• CleanestAutomation Model

Page 30: Testing XAML-based Windows Store Apps mit VS 2013

Demo

Page 31: Testing XAML-based Windows Store Apps mit VS 2013

Zusammenfassung

• Zugriff auf Tablet (x86 + ARM) mit MTM

• Unit Testing als Fundament

– Unit Testing Support für alle App-Typen

verfügbar

• UI Testing Support für XAML Apps

– Unterstützung Emulator und Hardware

– Umfangreicher Gesture-Support

Page 32: Testing XAML-based Windows Store Apps mit VS 2013

Wir unterstützen Sie

[email protected]

+49 151 55052624

AIT GmbH & Co. KGLeitzstr. 45, 70469 Stuttgart

www.aitgmbh.de

BERATUNGAgile ALM und TFS

.NET und Architektur

ENTWICKLUNGDienstleister für individuelle

Lösungen mit .NET und Azure

© AIT GmbH & Co. KG – Alle genannten und gezeigten Marken oder Warenzeichen sind eingetragene Marken oder eingetragene Warenzeichen ihrer jeweiligen Eigentümer

und ggf. nicht gesondert gekennzeichnet. Aus dem Fehlen der Kennzeichnung kann nicht geschlossen werden, daß es sich bei einem Begriff oder einem Bild nicht um eine

eingetragene Marke oder ein eingetragenes Warenzeichen handelt.

Page 33: Testing XAML-based Windows Store Apps mit VS 2013

4tecture GmbHThurgauerstrasse 40CH-8050 Zürichwww.4tecture.ch

Marc MüllerPrincipal [email protected]@muellermarc