Lets test2014 keepinglondononthemove

38
Transport For London Keeping London on the move Anand Ramdeo / @testinggeek

description

 

Transcript of Lets test2014 keepinglondononthemove

Page 1: Lets test2014 keepinglondononthemove

Transport For LondonKeeping London on the move

!Anand Ramdeo / @testinggeek

Page 2: Lets test2014 keepinglondononthemove

Inspiration“Tester who helped TFL in

revamping their web presence and presented his

work at one of the best testing conference - Let’s

Test 2014”

Page 3: Lets test2014 keepinglondononthemove

Good to know!

• 150+ years old • 24 million Journeys every day • 1.17 billion passenger

journeys in a year • 75% Londoners use TFL

website regularly • 250 million visits a year

!

“Lifeline of London”

Page 4: Lets test2014 keepinglondononthemove

Responsive design with better!usability and consistent! platform for developers.

Revamp

Page 5: Lets test2014 keepinglondononthemove

Journey!Planner Disruptions Lines Station

InfoTimeTable

And lots of other Interesting and useful services..

External developers who build interesting apps based on the

data available from TFL.

Tight coupling, inconsistent experience

Page 6: Lets test2014 keepinglondononthemove

Journey!Planner Disruptions Station

Info

And lots of other Interesting and useful services..

Consistent Restful Interface

External developers who build interesting apps based

on the data available from TFL.

Loosely coupled, RESTful!interface

Timetable Lines

Page 7: Lets test2014 keepinglondononthemove

Bad agile, good waterfallBad Agile!

• No testers in the team

• Not enough unit tests

• No Continuous Integration

• Sprint and Scrum

Good Waterfall!

• Excellent user research

• Almost finalised design

Page 8: Lets test2014 keepinglondononthemove

Assignment“You have got 21 days

to do automated regression testing for Journey Planner. Look at the stories we have

already finished.”

Page 9: Lets test2014 keepinglondononthemove

Challenge #1 Journey Planner

New, responsive web design which consumes RESTful

interface

Page 10: Lets test2014 keepinglondononthemove

Context Revealing Questions• Who are the stakeholders?

• What’s important for them?

• What is already tested by the team?

• When is it supposed to be released?

• What would be my oracle?

• What could possibly go wrong?

• Do I have access to data, environment, people who can help me test?

http://www.developsense.com/blog/2010/11/context-free-questions-for-testing/

Page 11: Lets test2014 keepinglondononthemove

Clear PrioritiesKey stake holder!

• Technical Architect

Key concerns!

• Quality of results, reliability.

• User experience, on web, mobile & devices.

• Validate architecture & deployment on cloud.

Scope!

• API isn’t important for beta release

Page 12: Lets test2014 keepinglondononthemove

Quality of Results

How do I know if route is right or wrong?

Page 13: Lets test2014 keepinglondononthemove

Simple Oracle

“Results should be identical to the live

website.”

Page 14: Lets test2014 keepinglondononthemove

Process1. Plan a journey on the existing

website (Source, destination, time, date, mode, preference etc.)

2. Note results (Journey time, departure, arrival, options, walking, escalators, earlier, later etc.)

3. Plan same journey with same options on the new website

4. Make a note of results

5. Compare

Page 15: Lets test2014 keepinglondononthemove

Key Problems!!

• Different UI • Too Many things to check • Time consuming • Error prone • Tiring • Difficult to scale

Automation!for the !Rescue

Page 16: Lets test2014 keepinglondononthemove

Journey j = new Journey(Victoria, Waterloo)!!routesFromExistingSite = JourneyPlanner.planJourneyOnOldSite(j)!!routesFromNewSite = JourneyPlanner.planJourneyOnNewSite(j)!!compareRoutes(routesFromExistingSite, routesFromNewSite)

Domain!Objects

Abstraction Encapsulation Clean code

Robust, Reliable, Maintainable & Useful automation!

http://www.testinggeek.com/a-software-tester-s-journey-from-manual-to-political

Page 17: Lets test2014 keepinglondononthemove

Progress so far..

• Who are my stakeholders?

• What’s important for them?

• How am I going to test?

Page 18: Lets test2014 keepinglondononthemove

Which routes do we need to test?

• Popular journeys

• Which modes are missing?

• Expand coverage

• Bug bash

Page 19: Lets test2014 keepinglondononthemove

Challenge #2!Status and Disruptions

• Realtime status of all the tube lines.

• Information about disruptions across all the modes.

• Not testable - could not inject disruptions.

• Oracle - compare with the live

What’s the biggest challenge?

Page 20: Lets test2014 keepinglondononthemove

SolutionContinuous monitoring using

Jenkins, PhantomJS and GhostDriver.

Page 21: Lets test2014 keepinglondononthemove

Challenge #3!Lines

Data Migration - Every bus, train, tram, river etc.

Page 22: Lets test2014 keepinglondononthemove

WaterlooNorthern Bakerloo Jubilee

WestministerJubilee Circle District

StanmoreJubilee

Stratford Jubilee Central DLR London OG

EppingCentral

North Acton Central

West Rulslip Central

StockwellNorthern Victoria

BrixtonVictoria

Green park Victoria

Jubilee Piccadilly

VictoriaVictoria Circle District

Page 23: Lets test2014 keepinglondononthemove

TFL Spider• Start from one station

• Get all lines from this station

• Get first line and check - is data present and correct?

• If yes, get list of all stations and mark this line as processed.!

• Add unique stations in the list of stations to process.

• If no, record missing data for this line and mark this line as processed.

Follow this for all lines on current station and move to the next

station

Page 24: Lets test2014 keepinglondononthemove

Challenge #4!Public API, Internal customer

• Assumed domain knowledge

• Team’s access to API developers

• Lack of consistency

• No versioning and regard for contract

Page 25: Lets test2014 keepinglondononthemove

PAPAS BE SFO!DEED HELP GC!

DVLA PC

Page 26: Lets test2014 keepinglondononthemove

Functionality Consumability MaintainabilityPaging Domain specific names DiagnosticAuthentication Examples VersioningParameters / Payloads Easy to learn LoggingAuthorization Documentation AccessibilitySecurity

Hard to misuse PurposeBehave Ease to use ConsumerError handling Lead to readable code

Principle of least surpriseStateFilter GuessabilityOrder Consistency

http://www.testinggeek.com/testing-restful-webservices-or-api-testing-remember-papas-be-sfo-deed-help-gc-and-dvla-pc

API Testing Mnemonic!

Page 27: Lets test2014 keepinglondononthemove

Lesson LearnedPro tips?

Page 28: Lets test2014 keepinglondononthemove

Pro Tip #1Automation does not have to be binary.

Use tools in the best possible way to help you test.

Page 29: Lets test2014 keepinglondononthemove

Pro Tip #2Break problem into manageable chunks.

Define layers, focus on one thing at a time.

Page 30: Lets test2014 keepinglondononthemove

Pro Tip #3Be context driven

Question and do the right things

Page 31: Lets test2014 keepinglondononthemove

Pro Tip #4know your stakeholders. What’s important for them

and why?

Page 32: Lets test2014 keepinglondononthemove

Pro Tip #5Use automation as a safety net, but be aware of its limitations.

Page 33: Lets test2014 keepinglondononthemove

Pro Tip #6Be vocal

!Blocked? Making progress?

Done something well? !

Don’t assume people would know.

Page 34: Lets test2014 keepinglondononthemove

Pro Tip #7Find ways to make progress

Page 35: Lets test2014 keepinglondononthemove

Pro Tip #8Embrace throwaway automation and utility

scripts.

Page 36: Lets test2014 keepinglondononthemove

Pro Tip #9Make testing visible

!http://www.satisfice.com/presentations/dashboard.pdf

Page 37: Lets test2014 keepinglondononthemove

Pro Tip #10Keep asking

Are we doing the right thing? !

Remember !

Projects unfold over time in ways that are often not

predictable.

Page 38: Lets test2014 keepinglondononthemove

Thank YouAnand Ramdeo !@testinggeek!

[email protected]

!TestingGeek.com TestSpicer.com

PlannedDeparture.com !