Ukázková aplikace je ke stažení na https://www. wug

Slides:



Advertisements
Similar presentations
Test Automation: Coded UI Test
Advertisements

Lecture plan Information retrieval (from week 11)
Tools for Agile Development: A Developer’s Perspective Mike Linnen Blog:
Adding scalability to legacy PHP web applications Overview Mario A. Valdez-Ramirez.
Using EWD to re-purpose a UI Rob Tweed. The Concept You have an existing well-designed and functional web user interface You want to re-purpose it to.
Create Windows ® Applications with.NET Allan Knudsen.NET Developer Evangelist Microsoft.
Developed by Reneta Barneva, SUNY Fredonia Component Level Design.
The course builder architecture & project planning presented by: Bahareh Agha Jafari.
Access Web Apps – OK, Now What? EXTENDING ACCESS WEB APPS George Young Dawson Butte Software ACCESS DAY – OCTOBER DENVER,
CZ Biz. Auto. System & Test-Driven Development Teoman Soygul (Sept 24, 2012).
User Group 2015 Version 5 Features & Infrastructure Enhancements.
By Bob Bunson  Simulation of software development project  Fictitious system from Concept to Code  Oriented around the.
Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc
Kay Herzam Herzam IT Consulting What‘s new in ASP.NET MS TechTalk.
Sitefinity CMS Technical Overview & Developer’s Perspective
Ori Calvo, 2010 “If people want to have maximum reach across *all* devices then HTML will provide the broadest reach” Scott Guthrie,
Testing Tools using Visual Studio Randy Pagels Sr. Developer Technology Specialist Microsoft Corporation.
Test Driven Development Arrange, Act, Assert… Awesome Jason Offutt Software Engineer Central Christian Church
Alcatel-Lucent CDC Workshop, Coaching & Knowledge Transfer Architecture.
Jonathan Canfield Mavin Lisa Giss Professor Kenytt D. Avery
Refactoring for Testability (or how I learned to stop worrying and love failing tests) Presented by Aaron Evans.
Using Mock Objects with Test Driven Development Justin Kohlhepp
Getting Started with ASP.NET MVC BRIJ BHUSHAN MISHRA.
Trunica Inc. 500 East Kennedy Blvd #300 Tampa, FL Cross Platform Mobile Apps With Cordova and Visual Studio 2015 © Copyright 2015.
Five design principles
Welcome to Azure App Services! Amie Seisay
ASP.NET MVC Telerik Academy
UNDERSTANDING YOUR OPTIONS FOR CLIENT-SIDE DEVELOPMENT IN OFFICE 365 Mark Rackley
SOLID Design Principles
Bundles, Minification Andres Käver, IT Kolledž
Integrating with and Extending Visual Studio. Objectives.
Introduction to ASP.NET development. Background ASP released in 1996 ASP supported for a minimum 10 years from Windows 8 release ASP.Net 1.0 released.
Automated Testing for Dynamics CRM
Bob German Principal Architect Developing SharePoint Applications with MVC and Entity Framework.
 Cloud Computing technology basics Platform Evolution Advantages  Microsoft Windows Azure technology basics Windows Azure – A Lap around the platform.
ANGULAR JS 2.0 Revolutionizes UI/UX Development. A CONTEMPORARY FRAMEWORK  Open Source Web Application Framework  Renowned, Established & Stable Frontend.
Unit testing of the Services Telerik Software Academy Web Services and Cloud.
Ognjen Bajić Ana Roje Ivančić Ekobit Efficient Application Testing.
The Holmes Platform and Applications
Stephen W. Thomas Integration MVP
MeshCentral 2.0.
Abstract Factory Pattern
Visual Studio 2017 By Michael Washington
IF-less programming in C#
Better Unit Tests through Design Patterns: Repository, Adapter, Mocks, and more… Benjamin
Microsoft List Schedule April – May 2016
Unit testing your metro style apps built using XAML
Building Web Applications with Microsoft ASP
Haritha Dasari Josue Balandrano Coronel -
By Gary Mandela December 26, 2006
Abstract Factory Pattern
Intent (Thanks to Jim Fawcett for the slides)
API Application Services
Introduction to AngularJS
Lecture 1: Multi-tier Architecture Overview
Why Object-oriented Programming?
Debugging tips and tricks
DAT381 Team Development with SQL Server 2005
Your code is not just…your code
What’s new in ASP.NET Core and Entity Framework 2.2 (Preview 3)
From Development to Production: Optimizing for Continuous Delivery
From Development to Production: Optimizing for Continuous Delivery
A (partial) blueprint for dealing with change
Object Oriented Design & Analysis
ASP.NET MVC Imran Rashid CTO at ManiWeber Technologies.
Some principles for object oriented design
Mark Quirk Head of Technology Developer & Platform Group
#01# ASP.NET Core Overview Design by: TEDU Trainer: Bach Ngoc Toan
Your code is not just…your code
Presentation transcript:

Ukázková aplikace je ke stažení na https://www. wug Ukázková aplikace je ke stažení na https://www.wug.cz/brno/akce/836-WUG-Days-2016/program u přednášky „Jak na testovatelné webové aplikace“ jako „AddNodeWizard.zip“. Vyžaduje Visual Studio 2015.

How to write testable web applications Jiří Tomek jiri.tomek@solarwinds.com

Agenda Testing? Why should I care? Test pyramid Different kinds of tests Unit tests Integration tests End to end tests Sample application AngularJS, ASP.NET WebApi 2

Why testing? Tests define the behavior of application Allow safe changes and refactoring Simplify debugging Debugging against unit test is much cheaper than against live application Improve code quality What to test? Consider gain/price ratio Parts that have high impact on functionality bring more benefit

Test pyramid To the top: - less reliable - higher price - slower feedback

Unit tests Unit test is code as any other Needs to be maintained Can be debugged Tests just one class/component Should be: Easy to write Readable Reliable Fast Independent Deterministic No need for special test code It’s cheapest kind of test

Readable Name of the test clearly says what it does Code is clean and easily understandable

Enemies of testable code Static classes/methods You can’t replace them with custom logic for testing Singleton Only one instance holding the state Can’t parallelize tests Can’t reset to default state Global state Environment variables Configuration files

SOLID SOLID principles Single responsibility principle Class does just one thing Open/Closed principle Class is opened for extension but closed for changes Easy to add new functionality without need to touch existing code Liskov substitution principle Class can be replaced by its subclass without affecting functionality Interface segregation Interface should be small and focused Dependency Inversion Concrete classes depend on abstract interfaces, not vice versa

Integration tests Test more classes or components together Focused on component integration Correct use of API Good to use when Testing component alone is too complex to setup Component integration is not trivial To test complex workflow More expensive than unit tests but still good Slower Harder to maintain

End-to-end tests Run against live application Test whole application or its major part Use public interface of application API UI Most expensive Time to setup the test Time to setup the environment Execution time Protractor - http://www.protractortest.org/

UI tests Test UI behavior Without real backend Mock API Protractor HTTP mock - https://github.com/atecarlos/protractor-http-mock

Sample application

Web application Presentation layer Business layer Data layer Web browser TypeScript/JavaScript, AngularJS, HTML, CSS Business layer Web server ASP.NET WebApi 2, C# Data layer Entity framework SQL database AngularJS, JS, HTML, CSS ASP.NET WebApi 2 SQL DB

Testable? Covered by automated tests End-to-end tests Unit tests UI behavior Client logic MVC Backend DB Unit tests Integration tests

Switch to VS

Useful links TypeScript - https://www.typescriptlang.org/ Moq - https://github.com/Moq/moq4/wiki/Quickstart AngularJS – https://angularjs.org Protractor - http://www.protractortest.org/ Protractor HTTP mock - https://github.com/atecarlos/protractor-http-mock Effort - https://github.com/tamasflamich/effort

SolarWinds 30+ products for IT Management Microsoft stack: C#, MS SQL, AngularJS Brno office – SolarWinds R&D center https://www.solarwindsmeetup.com/ Career opportunities http://solarwinds.jobs/ Visit our booth