From 3 weeks to 30 minutes – a journey through the ups and downs of test automation.

Slides:



Advertisements
Similar presentations
© Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice. Can’t Live With It, Can’t.
Advertisements

Performance and Reliability 101 Brent Cromarty Ping Identity
Why Use Test Driven Development (TDD)?.  Why the need to change to TDD.  Talk about what TDD is.  Talk about the expectations of TDD.
Prashant Lambat Sr. Manager SQA Engineering Symantec Corporation, Pune Date: 29 th January 2011.
Software Modeling SWE5441 Lecture 3 Eng. Mohammed Timraz
Roadmap to Continuous Integration Testing and Benefits Gowri Selka, Walgreens Natalie Koltun, Walgreens May 20th, 2014 ©2013 Walgreen Co. All rights reserved.
1 Design and Integration: Part 1. 2 What’s a metaphor? Ward Cunningham cites George Lakoff’s book, Metaphors We Live By: Lakoff argues that the assumptions.
Mike Azocar Sr. Developer Technical Specialist Microsoft Corporation
Swami NatarajanJune 17, 2015 RIT Software Engineering Reliability Engineering.
SE 450 Software Processes & Product Metrics Reliability Engineering.
Chapter 3.1 Teams and Processes. 2 Programming Teams In the 1980s programmers developed the whole game (and did the art and sounds too!) Now programmers.
Software Development Overview CPSC 315 – Programming Studio Spring 2008.
Agile Testing with Testing Anywhere The road to automation need not be long.
Test-Driven Development Gary Brown Building better software one test at a time.
2007 Adobe Systems Incorporated. All Rights Reserved. 1 Joe Berkovitz VP Engineering Allurent, Inc. Continuous Integration with Flex, FlexUnit, and Ant.
QWise software engineering – refactored! Testing, testing A first-look at the new testing capabilities in Visual Studio 2010 Mathias Olausson.
Chapter 3 – Agile Software Development Lecture 2 1Chapter 3 Agile software development.
Chapter 3 Agile Software Development (2/2) Yonsei University 2 nd Semester, 2013 Sanghyun Park.
Agile Software Development Chapter 3 – Lecture 1 Adrián Susinos.
Craig Berntson
Alcatel-Lucent CDC Workshop, Coaching & Knowledge Transfer Project Management.
Creating a Maintainable Software Ecosystem Jeremy D. Miller November 27th, 2007.
資工 4A 陳怡秀 Microsoft Visual Studio’s Journey to Continuous Delivery.
Chapter 3 – Agile Software Development Pepper modification of Sommerville presentation & Colm O’hEocha – AgileInnovation Ltd presentation 1Chapter 3 Agile.
CS 360 Lecture 3.  The software process is a structured set of activities required to develop a software system.  Fundamental Assumption:  Good software.
1 Today’s Plan In Class Exam – Quick Review Thoughts on your Junior Projects, cntd People and Roles on Projects.
 CS 5380 Software Engineering Chapter 8 Testing.
T Iteration Demo Team WiseGUI I2 Iteration
May 29 th, 2003 Curtis Anderson Sivaprasad Padisetty.
Chapter 3 – Agile Software Development Lecture 2 1Chapter 3 Agile software development.
Dr. Tom WayCSC Testing and Test-Driven Development CSC 4700 Software Engineering Based on Sommerville slides.
Chapter 8 – Software Testing Part 2 1Chapter 8 Software testing.
OHTO -99 SOFTWARE ENGINEERING “SOFTWARE PRODUCT QUALITY” Today: - Software quality - Quality Components - ”Good” software properties.
From Quality Control to Quality Assurance…and Beyond Alan Page Microsoft.
Fifth Lecture Hour 9:30 – 10:20 am, September 9, 2001 Framework for a Software Management Process – Life Cycle Phases (Part II, Chapter 5 of Royce’ book)
A Practical Guide To Unit Testing John E. Boal TestDrivenDeveloper.com.
Chapter 2 Software processes. Topics covered Software process models Process activities Coping with change.
Software Development Overview CPSC 315 – Programming Studio Spring 2013.
ECE450 - Software Engineering II1 ECE450 – Software Engineering II Today: Introduction to Software Architecture.
AP-1 4. Agile Processes. AP-2 Agile Processes Focus on creating a working system Different attitude on measuring progress XP Scrum.
MIS 7003 MBA Core Course in MIS Professor Akhilesh Bajaj The University of Tulsa Introduction to S/W Engineering © All slides in this presentation Akhilesh.
(1) Test Driven Development Philip Johnson Collaborative Software Development Laboratory Information and Computer Sciences University of Hawaii Honolulu.
T Iteration Demo Software Trickery I2 Iteration
Phoenix Scrum User Group Simplifying Scrum Online May 21 st 2009.
1 SYS366 Week 1 - Lecture 1 Introduction to Systems.
Software Development Process CS 360 Lecture 3. Software Process The software process is a structured set of activities required to develop a software.
The Kiev Experiment Evolving Agile Partnerships. Who are we? Simon Sasha Peter.
Benjamin Day Get Good at DevOps: Feature Flag Deployments with ASP.NET, WebAPI, & JavaScript.
Benjamin Unit Testing & Test-Driven Development for Mere Mortals.
1 © Agitar Software, 2007 Automated Unit Testing with AgitarOne Presented by Eamon McCormick Senior Solutions Consultant, Agitar Software Inc. Presented.
Rapid Launch Workshop ©CC BY-SA.
N-Tier Architecture.
Work Package 4 Software Integration and Distribution
The Software Development Cycle
E2E Testing in Agile – A Necessary Evil
Unit Testing & Test-Driven Development for Mere Mortals
Unit Testing & Test-Driven Development for Mere Mortals
Get Good at DevOps: Feature Flag Deployments with ASP
IMPACTED TESTS BASED ON
Testing and Test-Driven Development CSC 4700 Software Engineering
Software Testing and Maintenance Maintenance and Evolution Overview
TechEd /7/2018 6:07 AM DEV-B331 Brownfield Development: Taming Legacy Code with Better Unit Testing and Microsoft Fakes David Starr Senior Program.
Quality Assurance in an Agile Development Team Michelle Wu 2018 PNSQC
Software Testing & Quality Management
CSE 303 Concepts and Tools for Software Development
Unit Testing & Test-Driven Development for Mere Mortals
Agile Development – a new way of software development?
SOFTWARE DEVELOPMENT LIFE CYCLE
Requirements Engineering
The Software Development Cycle
Presentation transcript:

From 3 weeks to 30 minutes – a journey through the ups and downs of test automation

Who am I? Peter Thomas – Chief Software Engineer – Operations IT, UBS Investment Bank Developer (mostly) I do some architecture I have done Testing I talk a lot (Mentor/Coach) From the dark side (consulting) but getting better

Where did we start? Existing mainframe legacy application 3 week manual PPT testing cycle 12 week delivery cycle

What did we want to do? Belief there was a better way to deliver software Incremental development to deliver business value quickly Address the rapidly changing business landscape with flexibility in delivery Build quality into the solutions Deliver the software rapidly, but in a cost effective manner Put the fun back into software delivery

New YorkLondonKievHyderabadHong Kong 2M trades per day 100 billions settling per day in all major currencies 50+ exchanges across EMEA and APAC 15 scrum teams/120 people 9 applications Production releases every 2 weeks

New YorkLondonKievHyderabadHong Kong 200 commits per day 1000 artefacts updated per day 1 commit every 5 minutes peak

New YorkLondonKievHyderabadHong Kong 24 Build Targets 60+ Test Targets 800 Automated Functional Tests 10, 000 Unit/Integration Tests 7, 000 Behavioural Tests

But……..

Our tests were….. Complicated Obscure Random failures Slow to run Difficult to fix

“The TDD rut” Complicated Obscure Random failures Slow to run Difficult to fix

Test the Right Thing and Test the Thing Right When all you have is a hammer, everything looks like a nail

Why do you test?

Because TDD tells me so? Because (insert favourite method here) says I should? So I meet the 80% coverage metric?

Why do you test? To accept the solution To understand and document the solution To prove its not broken To find the unknown unknowns To help us design and build new features To help us explore what is really needed To show it won’t crash under load, to show it is secure (to test the ‘ilities) …?

Why do you test? Agile testing Quadrants – Lisa Crispin, Janet Gregory

Testing Purposefully

The Right Thing At The Right Level Unit Component System

The Right Thing At The Right Level Unit Component System Tests a single class with no dependencies If dependencies like Spring Context, Database used then called Unit Integration Tests technical correctness and robustness Very specific, a failing test indicates an issue in a specific class Difficult to perform on poor quality code Very fast to run, should run on the developer’s desktop in the IDE

The Right Thing At The Right Level Unit Component System Tests a group of components which are integrated to perform a business relevant function Can test technical or business correctness, but should be expressed in Domain concepts Specific, a failing test indicates problems in that component Easier to perform on poor quality code, provided component boundaries are clear Can be quick to run, doesn’t need the full application, should run on developers desktop

The Right Thing At The Right Level Unit Component System Tests a system at its boundaries as a ‘black box’ Primarily testing for business correctness Not Specific, a failing test could be caused anywhere in the system flow Easy to perform on legacy applications, requires little code modification Slow to run, can be fragile, may not run on developers desktop

What We Wanted

What We Had Unit tests which weren’t really Unit Tests End to End tests when unit tests would have been sufficient Duplicate and redundant End to End tests

The TDD Cycle

public void shouldBeEmtpyAfterCreation() { ReportObject aTrm = new ReportObject(); assertNull(aTrm.getEligibleTrm()); assertNull(aTrm.getProcessedEvent()); assertNull(aTrm.getPayloadXml()); public void shouldCorrectlySetAttributesViaConstructor() { ReportObject aTrm = new ReportObject(eligibleObject, REPORTABLE_XML); assertEquals(eligibleObject, reportableTrm.getEligibleTrm()); assertEquals(REPORTABLE_XML, reportableTrm.getPayloadXml()); public void shouldCorrectlySetFieldsViaSetters() { ReportObject aTrm = new ReportObject(); aTrm.setEligibleTrm(eligibleObject); aTrm.setProcessedEvent(child); aTrm.setPayloadXml(REPORTABLE_XML); assertEquals(eligibleObject, aTrm.getEligibleTrm()); assertEquals(child, aTrm.getProcessedEvent()); assertEquals(REPORTABLE_XML, aTrm.getPayloadXml()); }

The Hollow Egg

98 Tests 2.5K LOC 98 Tests 2.5K LOC 30 Tests 200 LOC 30 Tests 200 LOC

RSpec model

Outside In - The TDD Spiral

Make the Intent Clear How to achieve acceptance without showing your IDE or log file to the users

Unit Test Naming? testProcessError() whenWorkItemIsManuallyAssignedThenClientRuleShouldBeSetToManualOverride() shouldAllowAnActioningWorkItemToBeUpdated()

Test Data Nightmare

What Do You Demo?

Executable Specification

Improve Testing Stability Avoiding the Broken Windows syndrome

Separate Progress & Regression Tests

Speed-up Through Parallelism

Identify Unstable Tests

Quarantine Unstable Tests

Avoid External Dependencies

Introduce Fakes

Avoid Time-Dependent Tests

Test Isolation

Asynchronous Testing Headache

Don’t! Does your test need to be asynchronous? 80/20 rule? Create synchronous test runner harness

Asynchronous Testing using Events

So…?

Treat your Tests Like you Treat your Code “it’s just a test class” is not an excuse Clean Code applies to tests too

Think about Why You are Testing Specification tests for internal quality Business tests for external quality

Think about Who You are Testing For More people are interested in your tests than you may think

Zero Tolerance to Instability “It runs OK on my machine” is not a valid response

Interested in a career at peterrhysthomas.wordpress.com