QUnit JavaScript Testing in the Enterprise David Lee Oct. 11, 2011.

Slides:



Advertisements
Similar presentations
Test Automation: Coded UI Test
Advertisements

Lecture 4 Basic Scripting. Administrative  Files on the website will be posted in pdf for compatibility  Website is now mirrored at:
A Blackboard Building Block™ Crash Course for Web Developers
Developing HTML5 Application using MVVM pattern Pekka Ylenius.
Web Applications Development Using Coldbox Platform Eddie Johnston.
Copyright 2004 Monash University IMS5401 Web-based Systems Development Topic 2: Elements of the Web (g) Interactivity.
ExtJS 4.0 JavaScript MVC Framework. Who ExtJS is provided by Sencha ( o Sencha Touch o GWT o CSS Animator o IO (Cloud Data Management)
Lecture 3B: Client-Side Scripting IT 202—Internet Applications Based on notes developed by Morgan Benton.
The Team Team consisted of 5 members. Max Annear – Henderson Conrad Orange Mike Debney Anton Slooten Luke Stanford.
© 2004, The Trustees of Indiana University 1 OneStart Workflow Basics Brian McGough, Manager, Systems Integration, UITS Ryan Kirkendall, Lead Developer.
Applied Software Project Management Andrew Stellman & Jennifer Greene Applied Software Project Management Applied Software.
Russell Taylor Lecturer in Computing & Business Studies.
Automated Tests in NICOS Nightly Control System Alexander Undrus Brookhaven National Laboratory, Upton, NY Software testing is a difficult, time-consuming.
Test-Driven Development “Test first, develop later!” –OCUnit.
Agenda What is AJAX? What is jQuery? Demonstration/Tutorial Resources Q&A.
Copyright , Synchrony Systems, Inc. EGL Rich UI / Web 2.0 GUI to RUI Transformation with Enterprise Application Modernizations Slavik Zorin Founder.
 Computer Information System Club focused on the understanding and applied learning of web development.  The club was founded in April 5,  We.
CIS 375—Web App Dev II ASP.NET 2 Introducing Web Forms.
1 DAN FARRAR SQL ANYWHERE ENGINEERING JUNE 7, 2010 SCHEMA-DRIVEN EXPERIMENT MANAGEMENT DECLARATIVE TESTING WITH “DEXTERITY”
Michael Burnside Blog: Software Quality Assurance, Quality Engineering, and Web and Mobile Test.
NODEJS, THE JOOMLA FRAMEWORK, AND THE FUTURE IAN MACLENNAN.
Remote Unit Testing Milestone III Alex Riordan Brian Pruitt-Goddard.
Software Testing Life Cycle
Advanced Web Design Scripting Tutorial Chapters. Scripting Intro The scripting part of the forthcoming Advanced Web Design textbook introduces you to.
JavaScript is a client-side scripting language. Programs run in the web browser on the client's computer. (PHP, in contrast, is a server-side scripting.
Testing in Extreme Programming
Design Patterns Phil Smith 28 th November Design Patterns There are many ways to produce content via Servlets and JSPs Understanding the good, the.
10/8/20151 Mobile Apps and QAD Stephen McHugh Broom Street Software 03-17,2013.
Improving e:Vision user interface using Bootstrap and jQuery
DEV-5: Introduction to WebSpeed ® Stephen Ferguson Sr. Training Program Manager.
Feedback #2 (under assignments) Lecture Code:
StockWatch Developers: Nimrod Hagay Hagai Barkan Supervisors: Assaf Solomovitch Viktor Kulikov June 2009.
Sponsors Gold Silver Bronze Custom REST services and jQuery AJAX Building your own custom REST services and consuming them with jQuery AJAX.
CS 494 Web Development Class Size: Winter, 214: 97 Spring, 214: 81 Summer, 2014: 69.
Modern JavaScript Develop And Design Instructor’s Notes Chapter 1 - (Re) Introducing JavaScript Modern JavaScript Design And Develop Copyright © 2012 by.
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
Development Process Agile/XP Planning + Issue Tracking Google Code provided efficient + effective project management Bug and defect reports Project planning.
Chapter 4: Working with ASP.NET Server Controls OUTLINE  What ASP.NET Server Controls are  How the ASP.NET run time processes the server controls on.
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
Systems Development Life Cycle
Web Development Process The Site Development Process Site Construction is one of the last steps.
Using Test Driven Development Jon Kruger Blog: Twitter: JonKruger.
14 1 Chapter 14 Web Database Development Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
By Godwin Alemoh. What is usability testing Usability testing: is the process of carrying out experiments to find out specific information about a design.
INTRODUCTION JavaScript can make websites more interactive, interesting, and user-friendly.
SPI NIGHTLIES Alex Hodgkins. SPI nightlies  Build and test various software projects each night  Provide a nightlies summary page that displays all.
UNDERSTANDING YOUR OPTIONS FOR CLIENT-SIDE DEVELOPMENT IN OFFICE 365 Mark Rackley
Overview Web Technologies Computing Science Thompson Rivers University.
Mobile Applications With JQuery Mobile and VDF 17.1.
1 Punishment Through Continuous Delivery If it hurts, do it more often…
Submitted by: Moran Mishan. Instructed by: Osnat (Ossi) Mokryn, Dr.
This was written with the assumption that workbooks would be added. Even if these are not introduced until later, the same basic ideas apply Hopefully.
INTRODUCING HYBRID APP KAU with MICT PARK IT COMPANIES Supported by KOICA
17 Copyright © 2006, Oracle. All rights reserved. Information Publisher.
Mobilizing Your SAS® Business Analytic Reports Falko Schulz Sr. Systems Engineer SAS Australia & New Zealand.
Ognjen Bajić Ana Roje Ivančić Ekobit Efficient Application Testing.
Testing and delivery Web design principles. Web development is software development.
Case Study: Application Modernization June 27, 2016 Rob Marshall.
Content Management System
WEB BASED CENTRAL LIBRARY
PHP Training at GoLogica in Bangalore
Software Engineering for Internet Applications
Front End Application Development We at Kushub Media have a group brimming with website specialists who comprehend the functional side of things and have.
Design and Maintenance of Web Applications in J2EE
Web Browser server client 3-Tier Architecture Apache web server PHP
CIS16 Application Development – Programming with Visual Basic
ARCH-1: Application Architecture made Simple
An introduction to jQuery
An introduction to jQuery
Presentation transcript:

QUnit JavaScript Testing in the Enterprise David Lee Oct. 11, 2011

Getting to Know You How many of you work on Websites that use JavaScript? How many currently have a Unit Testing strategy? About me.

Outline for Today’s Talk What’s All This About Unit Testing? What Do You Mean By JavaScript Unit Testing? The QUnit Framework The End Result

What is Unit Testing? What is all this hullaballoo about?

What is Unit Testing? When the rubber meets the road testing is… Developers code tests that describe desired functionality, access this functionality, then verify that this functionality meets expectations Reporting Should include reporting And scheduled test runs

Unit Testing Takes Time Unit testing requires up front time Later this saves time for development and QA Time spent up front includes: – Developer time: Test creation --- coding of tests – Infrastructure Setup: Automation of tests Configuration of testing reports

Unit Testing Has Many Benefits Let’s see what some of these are…

Unit Testing Benefits Fewer bugs

Unit Testing Gets Your Attention Immediate feedback when code goes wrong (in a good way)

A Time Saver Overall the process of development, testing and dealing with bugs takes less time

And What else... Intercepts errors before they happen Keeps developers focused on the requirements Reduces workload on QA / Dev

JavaScript Unit Testing? Why test JavaScript? Typical unit testing strategies JavaScript unit testing strategies Problems being near the UI

Why JavaScript Testing? More and more technologies bring the logic client-side: – JSON – JQuery – AJAX – HTML5 – HTML5 for Mobile devices Richer client-side experiences lead to more JavaScript

Why JavaScript Unit Testing? With more JavaScript in the client there is more opportunity for code errors in JavaScript Relevant behaviors remain untested when ignoring JavaScript

Typical Unit Testing Strategies Typically unit testing is done on application code residing in the middle layer User Interface Application Code Data Access Unit Testing

JavaScript Unit Testing Strategies But JavaScript unit testing is done on script that resides in or near the user interface User Interface Application Code Data Access Unit Testing JavaScript

Problems being near the UI JavaScript & HTML are hard to separate Problems relying on HTML

JavaScript &HTML are hard to separate Historically JavaScript & HTML are inseparable JQuery make it harder to separate JavaScript from HTML $(".className > div").empty();

Problems Relying on HTML Testing strategies say to test logic and not the User Interface If we rely on HTML it can cause problems: – HTML is fluid (changeable) Controls, add-ins, database records, etc. all change HTML – Designers & Programmers (two hands in the mix)

How to test, but include HTML? Option 1: Copy HTML for our tests? Option 2: Run our tests directly against the web page? Option 3: Not test JavaScript that has a relationship to HTML Option 4: Some sort of hybrid approach

Option 1: Copy HTML for our tests? HTML may be required, so should we copy it for our tests? Static HTML may become old and irrelevant

Option 1: Copy HTML for our tests? Copy HTML

Option 2: Run tests against the page Tests could modify or significantly change the behavior / look /feel of a web page Example: running a test that inserts a block of text… what happens at the end of the test.

Option 3: Avoid HTML Altogether We ruled this out because it limited the number of tests we were able to create. Many pages with significant JavaScript would remain untested.

The QUnit Framework A look at QUnit examples

The End Result Our HTML Hybrid Testing Strategy Our JavaScript Testing Strategy

Our HTML Hybrid Testing Strategy Runs tests in an IFRAME Copies HTML from the actual page immediately

Our JavaScript Testing Strategy Make it easy to wire in tests Use site-wide hooks to keep the developer’s job easy Put test failures and successes in plain view

And Some Final Thoughts… Unit Testing is a valuable resource for YOU! The Use of JavaScript Unit Testing is timely and relevant given today’s technologies. To either deny or use HTML in your JavaScript tests will take forethought. In many cases it is not a simple decision. The provided libraries and sample tests will hopefully give you a jump start into the world of JavaScript Unit Testing.

Questions Questions?

QUnit JavaScript Testing in the Enterprise Thank you!