SlideShare una empresa de Scribd logo
1 de 45
Descargar para leer sin conexión
Script Recipes for
      Testers
            Adam Goucher
Manager of Quality, Zerofootprint Software

            adam@goucher.ca
          http://adam.goucher.ca
About Me

• Testing for 10 years
• Tool-smithing for most of them
• Scripting has been and important part of
  both my career and testing success
About You


• Want to be a better tester
• Who to find better bugs
• More efficiently
About This Tutorial


• Reusable scripts explained
• Tips for your own scripts
So Why Script?

• Provide new insight into your product
• Generate test data
• Automate repetitive / common / complex
  tasks
• Replace expensive tools with ones tailored
  to your environment
Language Choice


• Is far too often a religious choice
• Use what is right for the task
Language Choice
• Do you know the language?
• Could you learn it?
• Is it supported on all your (current)
  platforms?
• Are those platforms all considered first-class
  citizens?
• Can it interact with your database?
Language Choice
•   Does it control your other tools? (Selenium, Watir,
    etc.)

•   Can you recycle code (Java jars or .NET assemblies)
    from elsewhere in your application?

•   Does it support Unicode as a core data type?

•   Is there seamless interaction with the operating
    system?

•   Is there an active member community (to whom you
    can turn to for help)
Language Choice
Developer Notes

• hack, broken, kludge are not things I like
  seeing in code I am testing
• fixme and todo in comments imply hidden
  knowledge
• style
A better grep

• grep is a unix tool for searching for things
  inside files
• The ‘developer notes’ script is like a cross-
  platform grep
How to run

• Set the source_base to point to the root of
  your project source code
• Set the interesting value to the types of file
  you want to check
• Add items you want to check to the notes
  list; all lowercase
Future Changes


• Faster
• Use regex
Tip: Complexity


• If you don’t have to do something in a
  complicated way, don’t.
Tip: Common Case


• Converting both sides of a comparison to a
  common case means you don’t have to
  worry about case
Tip: Performance


• Unless performance really matters, don’t
  worry about it
• Optimizations add complexity
LOUD

• i18n and l10n are hard things to get right
• But is pretty easy to test
• Since we (the testers) are not responsible
  for content; the translators are
LOUD
• The ‘loud’ screen alters the text which is
  shown on the screen - ^LOUD$
  • Everything that should be translated
    should be UPPERCASED
  • Everything that shouldn’t be is not
  • Blocks of text should not be split into
    different LOUDed strings
How to run


• This script needs to be customized for your
  organization’s method of creating resource
  bundles
Tip: Use fake ‘files’

• Rather than using your real resource bundle
  to build the script, use a variable that looks
  like a file
• It is faster, and you cannot accidently delete
  your master copy while on the train without
  an internet connection
Audible Log Monitoring

• Log files provide a wealth of information
• If your eyes are on a log while doing a test
  they cannot be somewhere else
• Use your ears instead
How to run


• in watchlist.txt, create a list of strings or
   regexes which it needs to watch for
• and the wav file it will play when it finds it
Tip: Package for
        Convenience
• Some people are scared of anything that
  looks like ‘code’
• More often than not these are ones who are
  not ‘unix people’
• A tool is only useful if it is used
• All scripting languages have the ability to
  compile themselves into .exe
Tail’ing the Event Log
• Another tool I miss on windows is tail
• When on remote unix machines I am
  constantly tailing logs
• ‘Proper’ windows applications however log
  to the Event Viewer which cannot be tailed
  (even if you have a windows version
  installed)
How to run


• Once you have installed the Python Win32
  Extensions, just run the script
Future Changes


• Merge with Audible Log Monitoring
Tip: Platform neutrality


• Platform neutrality is a noble goal
• But the goal should be abandoned if the
  situation makes sense
Browser Percents

• When testing web applications, one of the
  key decisions to make is how much to test
  with what browser
  • Aggregate 3rd party information, or
  • Information from your actual webserver?
How to run

• I only run this script every so often so the
  filename is in the script
• The regex in the script is written for the
  Apache access log format
• If you are using a different webserver you
  just have to change the regex
Tip: Reinvent the wheel

• There are a tonne of libraries and tools
  which parse log files
• Reinvent the wheel if
 • you can learn something
 • you want specific information and don’t
    need anything else
Tip: Filter the data


• Your access log is going to be littered with
  your own office; filter it out to get a real
  information
Algorithmic Oracles

• Oracles can be people, specifications (like an
  RFC) or a comparable product
• Or if something is an algorithm it can be an
  alternative implication
• In something like a script
How to Use
• Implement your algorithm as a verification
  task
• Run what your developers produce through
  the script
• Warning: If you implement it wrong, then
  you will could be ignoring bugs or creating
  red herring ones
Test Case Generation

• This is the opposite of the Oracle script
• One of the main reasons I create test data
  ahead of time is to not have to think under
  pressure
• Script that thinking
How to Use


• Just implement the algorithm
• Warning: If you implement it wrong and you
  will be using bad data
Tip: Random


• Real world data is random
• Create your test data the same way
• The infamous Pesticide Paradox
Tip: Dual Purpose


• I put the oracle and generation scripts for
  the same algorithm in the same script
Excel manipulation

• Excel is a really convenient tool for data
  creation
• It is also really powerful and comes with its
  own scripting language
Tip: Layers


• If something has a native scripting layer, use
  it
GUI Automation

• Commercial GUI automation tools are
  budget killers
• For a number of application types the open-
  source alternatives are just as effective
• You just need to fall back on manual
  scripting sooner
GUI Automation
• Here are the 4 steps I use when automating
  a UI
  1. Record the test
  2. Add the testing conditions
  3. Traditional data driving
  4. Give the script smarts
• 2 - 4 tend to require scripting
Metaframeworks


• Metaframeworks are frameworks which run
  different test frameworks and aggregates the
  results
Meta why?

• Imagine from one command getting the
   results of your JUnit, Selenium, homebrew
   and Watir at once?
• This is a big bit of scripting...
Tip: Language Variants

• A lot of the major scripting languages have
  been ported to other interpreters
  • Java: Jython, JRuby
  • .NET: IronPython, IronRuby
Go Forth and Script!

Más contenido relacionado

La actualidad más candente

Automation testing
Automation testingAutomation testing
Automation testingkamilkaide
 
PHP Mega Meetup, Sep, 2020, Anti patterns in php
PHP Mega Meetup, Sep, 2020, Anti patterns in phpPHP Mega Meetup, Sep, 2020, Anti patterns in php
PHP Mega Meetup, Sep, 2020, Anti patterns in phpAhmed Abdou
 
BDD Testing Using Godog - Bangalore Golang Meetup # 32
BDD Testing Using Godog - Bangalore Golang Meetup # 32BDD Testing Using Godog - Bangalore Golang Meetup # 32
BDD Testing Using Godog - Bangalore Golang Meetup # 32OpenEBS
 
The Power Of Refactoring (PHPNW)
The Power Of Refactoring (PHPNW)The Power Of Refactoring (PHPNW)
The Power Of Refactoring (PHPNW)Stefan Koopmanschap
 
Dot all 2019 | Testing with Craft | Giel Tettelar
Dot all 2019 | Testing with Craft | Giel TettelarDot all 2019 | Testing with Craft | Giel Tettelar
Dot all 2019 | Testing with Craft | Giel TettelarGiel Tettelaar
 
Apache spark as a gateway drug to FP concepts taught and broken - Curry On 2018
Apache spark as a gateway drug to FP concepts taught and broken - Curry On 2018Apache spark as a gateway drug to FP concepts taught and broken - Curry On 2018
Apache spark as a gateway drug to FP concepts taught and broken - Curry On 2018Holden Karau
 
TDD in Go with Ginkgo and Gomega
TDD in Go with Ginkgo and GomegaTDD in Go with Ginkgo and Gomega
TDD in Go with Ginkgo and GomegaEddy Reyes
 
Angular Vienna - Use React tools for better Angular apps
Angular Vienna - Use React tools for better Angular appsAngular Vienna - Use React tools for better Angular apps
Angular Vienna - Use React tools for better Angular appsMartin Hochel
 
TGT#20 - Automated Tests Only For Testers - Kasper Kulikowski
TGT#20 - Automated Tests Only For Testers - Kasper KulikowskiTGT#20 - Automated Tests Only For Testers - Kasper Kulikowski
TGT#20 - Automated Tests Only For Testers - Kasper KulikowskiTrójmiejska Grupa Testerska
 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using SwiftDiego Freniche Brito
 
Programming language environments
Programming language environmentsProgramming language environments
Programming language environmentsMr McAlpine
 
Continuous performance: Load testing for developers with gatling
Continuous performance: Load testing for developers with gatlingContinuous performance: Load testing for developers with gatling
Continuous performance: Load testing for developers with gatlingTim van Eijndhoven
 
Functional Programming for Busy Object Oriented Programmers
Functional Programming for Busy Object Oriented ProgrammersFunctional Programming for Busy Object Oriented Programmers
Functional Programming for Busy Object Oriented ProgrammersDiego Freniche Brito
 
Essential debugging php debugging techniques, tips & tricks
Essential debugging php debugging techniques, tips & tricksEssential debugging php debugging techniques, tips & tricks
Essential debugging php debugging techniques, tips & tricksKaloyan Raev
 
Managing Modules Without Going Crazy (NPW 2007)
Managing Modules Without Going Crazy (NPW 2007)Managing Modules Without Going Crazy (NPW 2007)
Managing Modules Without Going Crazy (NPW 2007)brian d foy
 

La actualidad más candente (19)

Fast end-to-end-tests
Fast end-to-end-testsFast end-to-end-tests
Fast end-to-end-tests
 
Automation testing
Automation testingAutomation testing
Automation testing
 
PHP Mega Meetup, Sep, 2020, Anti patterns in php
PHP Mega Meetup, Sep, 2020, Anti patterns in phpPHP Mega Meetup, Sep, 2020, Anti patterns in php
PHP Mega Meetup, Sep, 2020, Anti patterns in php
 
BDD Testing Using Godog - Bangalore Golang Meetup # 32
BDD Testing Using Godog - Bangalore Golang Meetup # 32BDD Testing Using Godog - Bangalore Golang Meetup # 32
BDD Testing Using Godog - Bangalore Golang Meetup # 32
 
The Power Of Refactoring (PHPNW)
The Power Of Refactoring (PHPNW)The Power Of Refactoring (PHPNW)
The Power Of Refactoring (PHPNW)
 
Dot all 2019 | Testing with Craft | Giel Tettelar
Dot all 2019 | Testing with Craft | Giel TettelarDot all 2019 | Testing with Craft | Giel Tettelar
Dot all 2019 | Testing with Craft | Giel Tettelar
 
Apache spark as a gateway drug to FP concepts taught and broken - Curry On 2018
Apache spark as a gateway drug to FP concepts taught and broken - Curry On 2018Apache spark as a gateway drug to FP concepts taught and broken - Curry On 2018
Apache spark as a gateway drug to FP concepts taught and broken - Curry On 2018
 
TDD in Go with Ginkgo and Gomega
TDD in Go with Ginkgo and GomegaTDD in Go with Ginkgo and Gomega
TDD in Go with Ginkgo and Gomega
 
Angular Vienna - Use React tools for better Angular apps
Angular Vienna - Use React tools for better Angular appsAngular Vienna - Use React tools for better Angular apps
Angular Vienna - Use React tools for better Angular apps
 
Why golang
Why golangWhy golang
Why golang
 
TGT#20 - Automated Tests Only For Testers - Kasper Kulikowski
TGT#20 - Automated Tests Only For Testers - Kasper KulikowskiTGT#20 - Automated Tests Only For Testers - Kasper Kulikowski
TGT#20 - Automated Tests Only For Testers - Kasper Kulikowski
 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
 
Programming language environments
Programming language environmentsProgramming language environments
Programming language environments
 
Go fundamentals
Go fundamentalsGo fundamentals
Go fundamentals
 
The Power of Refactoring
The Power of RefactoringThe Power of Refactoring
The Power of Refactoring
 
Continuous performance: Load testing for developers with gatling
Continuous performance: Load testing for developers with gatlingContinuous performance: Load testing for developers with gatling
Continuous performance: Load testing for developers with gatling
 
Functional Programming for Busy Object Oriented Programmers
Functional Programming for Busy Object Oriented ProgrammersFunctional Programming for Busy Object Oriented Programmers
Functional Programming for Busy Object Oriented Programmers
 
Essential debugging php debugging techniques, tips & tricks
Essential debugging php debugging techniques, tips & tricksEssential debugging php debugging techniques, tips & tricks
Essential debugging php debugging techniques, tips & tricks
 
Managing Modules Without Going Crazy (NPW 2007)
Managing Modules Without Going Crazy (NPW 2007)Managing Modules Without Going Crazy (NPW 2007)
Managing Modules Without Going Crazy (NPW 2007)
 

Destacado

Vsam interview questions and answers.
Vsam interview questions and answers.Vsam interview questions and answers.
Vsam interview questions and answers.Sweta Singh
 
Unix shell scripting basics
Unix shell scripting basicsUnix shell scripting basics
Unix shell scripting basicsManav Prasad
 
Manual software-testing-interview-questions-with-answers
Manual software-testing-interview-questions-with-answersManual software-testing-interview-questions-with-answers
Manual software-testing-interview-questions-with-answersTripti Shergill
 
Quality center interview questions and answers
Quality center interview questions and answersQuality center interview questions and answers
Quality center interview questions and answersGaruda Trainings
 
3, regular expression
3, regular expression3, regular expression
3, regular expressionted-xu
 
Cobol questions and answers
Cobol questions and answersCobol questions and answers
Cobol questions and answersSweta Singh
 
Project manager interview questions and answers
Project manager interview questions and answersProject manager interview questions and answers
Project manager interview questions and answersSweta Singh
 
Linux or unix interview questions
Linux or unix interview questionsLinux or unix interview questions
Linux or unix interview questionsTeja Bheemanapally
 
Manual testing interview questions and answers
Manual testing interview questions and answersManual testing interview questions and answers
Manual testing interview questions and answerskaranmca
 
QA interview questions and answers
QA interview questions and answersQA interview questions and answers
QA interview questions and answersMehul Chauhan
 
Ibm db2 interview questions and answers
Ibm db2 interview questions and answersIbm db2 interview questions and answers
Ibm db2 interview questions and answersSweta Singh
 
Practical unix utilities for text processing
Practical unix utilities for text processingPractical unix utilities for text processing
Practical unix utilities for text processingAnton Arhipov
 
Siebel 8.1 Certifications Question Answers
Siebel 8.1 Certifications Question AnswersSiebel 8.1 Certifications Question Answers
Siebel 8.1 Certifications Question AnswersSweta Singh
 
Linux User Space Debugging & Profiling
Linux User Space Debugging & ProfilingLinux User Space Debugging & Profiling
Linux User Space Debugging & ProfilingAnil Kumar Pugalia
 
Cts informatica interview question answers
Cts informatica interview question answersCts informatica interview question answers
Cts informatica interview question answersSweta Singh
 
Mobile Hacking using Linux Drivers
Mobile Hacking using Linux DriversMobile Hacking using Linux Drivers
Mobile Hacking using Linux DriversAnil Kumar Pugalia
 

Destacado (20)

Spsl II unit
Spsl   II unitSpsl   II unit
Spsl II unit
 
Vsam interview questions and answers.
Vsam interview questions and answers.Vsam interview questions and answers.
Vsam interview questions and answers.
 
Unix Basics For Testers
Unix Basics For TestersUnix Basics For Testers
Unix Basics For Testers
 
Unix shell scripting basics
Unix shell scripting basicsUnix shell scripting basics
Unix shell scripting basics
 
Manual software-testing-interview-questions-with-answers
Manual software-testing-interview-questions-with-answersManual software-testing-interview-questions-with-answers
Manual software-testing-interview-questions-with-answers
 
Quality center interview questions and answers
Quality center interview questions and answersQuality center interview questions and answers
Quality center interview questions and answers
 
3, regular expression
3, regular expression3, regular expression
3, regular expression
 
Cobol questions and answers
Cobol questions and answersCobol questions and answers
Cobol questions and answers
 
Project manager interview questions and answers
Project manager interview questions and answersProject manager interview questions and answers
Project manager interview questions and answers
 
Linux or unix interview questions
Linux or unix interview questionsLinux or unix interview questions
Linux or unix interview questions
 
Manual testing interview questions and answers
Manual testing interview questions and answersManual testing interview questions and answers
Manual testing interview questions and answers
 
QA interview questions and answers
QA interview questions and answersQA interview questions and answers
QA interview questions and answers
 
Ibm db2 interview questions and answers
Ibm db2 interview questions and answersIbm db2 interview questions and answers
Ibm db2 interview questions and answers
 
Advanced Shell Scripting
Advanced Shell ScriptingAdvanced Shell Scripting
Advanced Shell Scripting
 
Practical unix utilities for text processing
Practical unix utilities for text processingPractical unix utilities for text processing
Practical unix utilities for text processing
 
"make" system
"make" system"make" system
"make" system
 
Siebel 8.1 Certifications Question Answers
Siebel 8.1 Certifications Question AnswersSiebel 8.1 Certifications Question Answers
Siebel 8.1 Certifications Question Answers
 
Linux User Space Debugging & Profiling
Linux User Space Debugging & ProfilingLinux User Space Debugging & Profiling
Linux User Space Debugging & Profiling
 
Cts informatica interview question answers
Cts informatica interview question answersCts informatica interview question answers
Cts informatica interview question answers
 
Mobile Hacking using Linux Drivers
Mobile Hacking using Linux DriversMobile Hacking using Linux Drivers
Mobile Hacking using Linux Drivers
 

Similar a Scripting Recipes for Testers

How the JDeveloper team test JDeveloper at UKOUG'08
How the JDeveloper team test JDeveloper at UKOUG'08How the JDeveloper team test JDeveloper at UKOUG'08
How the JDeveloper team test JDeveloper at UKOUG'08kingsfleet
 
Dynamic Languages In The Enterprise (4developers march 2009)
Dynamic Languages In The Enterprise (4developers march 2009)Dynamic Languages In The Enterprise (4developers march 2009)
Dynamic Languages In The Enterprise (4developers march 2009)Ivo Jansch
 
Static Analysis Techniques For Testing Application Security - Houston Tech Fest
Static Analysis Techniques For Testing Application Security - Houston Tech FestStatic Analysis Techniques For Testing Application Security - Houston Tech Fest
Static Analysis Techniques For Testing Application Security - Houston Tech FestDenim Group
 
Professional PHP: an open-source alternative for enterprise development [Kort...
Professional PHP: an open-source alternative for enterprise development [Kort...Professional PHP: an open-source alternative for enterprise development [Kort...
Professional PHP: an open-source alternative for enterprise development [Kort...Combell NV
 
Enterprise PHP Development - ZendCon 2008
Enterprise PHP Development - ZendCon 2008Enterprise PHP Development - ZendCon 2008
Enterprise PHP Development - ZendCon 2008Ivo Jansch
 
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorialoscon2007
 
Monitoring and automation
Monitoring and automationMonitoring and automation
Monitoring and automationRicardo Bánffy
 
Presentations Unusual Java Bugs And Detecting Them Using Foss Tools
Presentations Unusual Java Bugs And Detecting Them Using Foss ToolsPresentations Unusual Java Bugs And Detecting Them Using Foss Tools
Presentations Unusual Java Bugs And Detecting Them Using Foss ToolsGanesh Samarthyam
 
The 7 Sins of Software Engineers in HEP
The 7 Sins of Software Engineers in HEPThe 7 Sins of Software Engineers in HEP
The 7 Sins of Software Engineers in HEPIoannis Baltopoulos
 
Laird Best Practices Ajax World West2008
Laird Best Practices Ajax World West2008Laird Best Practices Ajax World West2008
Laird Best Practices Ajax World West2008rajivmordani
 
Property-based testing an open-source compiler, pflua (FOSDEM 2015)
Property-based testing an open-source compiler, pflua (FOSDEM 2015)Property-based testing an open-source compiler, pflua (FOSDEM 2015)
Property-based testing an open-source compiler, pflua (FOSDEM 2015)Igalia
 
Jun Heider - Flex Application Profiling By Example
Jun Heider - Flex Application Profiling By ExampleJun Heider - Flex Application Profiling By Example
Jun Heider - Flex Application Profiling By Example360|Conferences
 
Enterprise PHP (php|works 2008)
Enterprise PHP (php|works 2008)Enterprise PHP (php|works 2008)
Enterprise PHP (php|works 2008)Ivo Jansch
 
Better Perl Practices
Better Perl PracticesBetter Perl Practices
Better Perl PracticesJay Shirley
 
Working With People Adl Uni
Working With People Adl UniWorking With People Adl Uni
Working With People Adl UniMatthew Landauer
 
Best Practices with Zend Framework - Matthew Weier O'Phinney
Best Practices with Zend Framework - Matthew Weier O'PhinneyBest Practices with Zend Framework - Matthew Weier O'Phinney
Best Practices with Zend Framework - Matthew Weier O'Phinneydpc
 
What can possibly go wrong if i dont e2 e test my packages?
What can possibly go wrong if i dont e2 e test my packages?What can possibly go wrong if i dont e2 e test my packages?
What can possibly go wrong if i dont e2 e test my packages?Juan Picado
 

Similar a Scripting Recipes for Testers (20)

How the JDeveloper team test JDeveloper at UKOUG'08
How the JDeveloper team test JDeveloper at UKOUG'08How the JDeveloper team test JDeveloper at UKOUG'08
How the JDeveloper team test JDeveloper at UKOUG'08
 
Dynamic Languages In The Enterprise (4developers march 2009)
Dynamic Languages In The Enterprise (4developers march 2009)Dynamic Languages In The Enterprise (4developers march 2009)
Dynamic Languages In The Enterprise (4developers march 2009)
 
Static Analysis Techniques For Testing Application Security - Houston Tech Fest
Static Analysis Techniques For Testing Application Security - Houston Tech FestStatic Analysis Techniques For Testing Application Security - Houston Tech Fest
Static Analysis Techniques For Testing Application Security - Houston Tech Fest
 
Professional PHP: an open-source alternative for enterprise development [Kort...
Professional PHP: an open-source alternative for enterprise development [Kort...Professional PHP: an open-source alternative for enterprise development [Kort...
Professional PHP: an open-source alternative for enterprise development [Kort...
 
Enterprise PHP Development - ZendCon 2008
Enterprise PHP Development - ZendCon 2008Enterprise PHP Development - ZendCon 2008
Enterprise PHP Development - ZendCon 2008
 
4gl code parser
4gl code parser 4gl code parser
4gl code parser
 
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorial
 
Monitoring and automation
Monitoring and automationMonitoring and automation
Monitoring and automation
 
Presentations Unusual Java Bugs And Detecting Them Using Foss Tools
Presentations Unusual Java Bugs And Detecting Them Using Foss ToolsPresentations Unusual Java Bugs And Detecting Them Using Foss Tools
Presentations Unusual Java Bugs And Detecting Them Using Foss Tools
 
The 7 Sins of Software Engineers in HEP
The 7 Sins of Software Engineers in HEPThe 7 Sins of Software Engineers in HEP
The 7 Sins of Software Engineers in HEP
 
Laird Best Practices Ajax World West2008
Laird Best Practices Ajax World West2008Laird Best Practices Ajax World West2008
Laird Best Practices Ajax World West2008
 
Property-based testing an open-source compiler, pflua (FOSDEM 2015)
Property-based testing an open-source compiler, pflua (FOSDEM 2015)Property-based testing an open-source compiler, pflua (FOSDEM 2015)
Property-based testing an open-source compiler, pflua (FOSDEM 2015)
 
Jun Heider - Flex Application Profiling By Example
Jun Heider - Flex Application Profiling By ExampleJun Heider - Flex Application Profiling By Example
Jun Heider - Flex Application Profiling By Example
 
Enterprise PHP (php|works 2008)
Enterprise PHP (php|works 2008)Enterprise PHP (php|works 2008)
Enterprise PHP (php|works 2008)
 
Better Perl Practices
Better Perl PracticesBetter Perl Practices
Better Perl Practices
 
Working With People Adl Uni
Working With People Adl UniWorking With People Adl Uni
Working With People Adl Uni
 
Test
TestTest
Test
 
Best Practices with Zend Framework - Matthew Weier O'Phinney
Best Practices with Zend Framework - Matthew Weier O'PhinneyBest Practices with Zend Framework - Matthew Weier O'Phinney
Best Practices with Zend Framework - Matthew Weier O'Phinney
 
PHP - Introduction to PHP Bugs - Debugging
PHP -  Introduction to  PHP Bugs - DebuggingPHP -  Introduction to  PHP Bugs - Debugging
PHP - Introduction to PHP Bugs - Debugging
 
What can possibly go wrong if i dont e2 e test my packages?
What can possibly go wrong if i dont e2 e test my packages?What can possibly go wrong if i dont e2 e test my packages?
What can possibly go wrong if i dont e2 e test my packages?
 

Más de Adam Goucher

Lightsabers, Time Machines and other Automation Heuristics
Lightsabers, Time Machines and other Automation HeuristicsLightsabers, Time Machines and other Automation Heuristics
Lightsabers, Time Machines and other Automation HeuristicsAdam Goucher
 
SeleniumConf London 2019 - "Part 3: Practice what you Preach"
SeleniumConf London 2019 - "Part 3: Practice what you Preach"SeleniumConf London 2019 - "Part 3: Practice what you Preach"
SeleniumConf London 2019 - "Part 3: Practice what you Preach"Adam Goucher
 
Is your Automation Infrastructure ‘Well Architected’?
Is your Automation Infrastructure ‘Well Architected’?Is your Automation Infrastructure ‘Well Architected’?
Is your Automation Infrastructure ‘Well Architected’?Adam Goucher
 
Your Job Is To Collect Stories
Your Job Is To Collect StoriesYour Job Is To Collect Stories
Your Job Is To Collect StoriesAdam Goucher
 
[Automation] Trick-or-Treat Style
[Automation] Trick-or-Treat Style[Automation] Trick-or-Treat Style
[Automation] Trick-or-Treat StyleAdam Goucher
 
Proxy and Executor
Proxy and ExecutorProxy and Executor
Proxy and ExecutorAdam Goucher
 
Maintainable Automation FTW
Maintainable Automation FTWMaintainable Automation FTW
Maintainable Automation FTWAdam Goucher
 
Selenium Page Objects101
Selenium Page Objects101Selenium Page Objects101
Selenium Page Objects101Adam Goucher
 
Selenium IDE - The future if plugin-y
Selenium IDE - The future if plugin-ySelenium IDE - The future if plugin-y
Selenium IDE - The future if plugin-yAdam Goucher
 
You're doing it wrong
You're doing it wrongYou're doing it wrong
You're doing it wrongAdam Goucher
 
Everything I learned about Agile I learned from Pirates
Everything I learned about Agile I learned from PiratesEverything I learned about Agile I learned from Pirates
Everything I learned about Agile I learned from PiratesAdam Goucher
 
Agile Test Case Management
Agile Test Case ManagementAgile Test Case Management
Agile Test Case ManagementAdam Goucher
 
The Many Hats of a Tester
The Many Hats of a TesterThe Many Hats of a Tester
The Many Hats of a TesterAdam Goucher
 
Testing inspiration
Testing inspirationTesting inspiration
Testing inspirationAdam Goucher
 
Agile Hats Art Show
Agile Hats Art ShowAgile Hats Art Show
Agile Hats Art ShowAdam Goucher
 
Quality through the lens of Astrophysics
Quality through the lens of AstrophysicsQuality through the lens of Astrophysics
Quality through the lens of AstrophysicsAdam Goucher
 
Legend of Zealot Anarchist Robot
Legend of Zealot Anarchist RobotLegend of Zealot Anarchist Robot
Legend of Zealot Anarchist RobotAdam Goucher
 

Más de Adam Goucher (20)

Lightsabers, Time Machines and other Automation Heuristics
Lightsabers, Time Machines and other Automation HeuristicsLightsabers, Time Machines and other Automation Heuristics
Lightsabers, Time Machines and other Automation Heuristics
 
SeleniumConf London 2019 - "Part 3: Practice what you Preach"
SeleniumConf London 2019 - "Part 3: Practice what you Preach"SeleniumConf London 2019 - "Part 3: Practice what you Preach"
SeleniumConf London 2019 - "Part 3: Practice what you Preach"
 
Is your Automation Infrastructure ‘Well Architected’?
Is your Automation Infrastructure ‘Well Architected’?Is your Automation Infrastructure ‘Well Architected’?
Is your Automation Infrastructure ‘Well Architected’?
 
Your Job Is To Collect Stories
Your Job Is To Collect StoriesYour Job Is To Collect Stories
Your Job Is To Collect Stories
 
[Automation] Trick-or-Treat Style
[Automation] Trick-or-Treat Style[Automation] Trick-or-Treat Style
[Automation] Trick-or-Treat Style
 
Proxy and Executor
Proxy and ExecutorProxy and Executor
Proxy and Executor
 
Maintainable Automation FTW
Maintainable Automation FTWMaintainable Automation FTW
Maintainable Automation FTW
 
Selenium Page Objects101
Selenium Page Objects101Selenium Page Objects101
Selenium Page Objects101
 
Selenium IDE - The future if plugin-y
Selenium IDE - The future if plugin-ySelenium IDE - The future if plugin-y
Selenium IDE - The future if plugin-y
 
You're doing it wrong
You're doing it wrongYou're doing it wrong
You're doing it wrong
 
Namesmatter
NamesmatterNamesmatter
Namesmatter
 
Everything I learned about Agile I learned from Pirates
Everything I learned about Agile I learned from PiratesEverything I learned about Agile I learned from Pirates
Everything I learned about Agile I learned from Pirates
 
Agile Test Case Management
Agile Test Case ManagementAgile Test Case Management
Agile Test Case Management
 
Mitigation
MitigationMitigation
Mitigation
 
The Many Hats of a Tester
The Many Hats of a TesterThe Many Hats of a Tester
The Many Hats of a Tester
 
Testing inspiration
Testing inspirationTesting inspiration
Testing inspiration
 
Archetypes
ArchetypesArchetypes
Archetypes
 
Agile Hats Art Show
Agile Hats Art ShowAgile Hats Art Show
Agile Hats Art Show
 
Quality through the lens of Astrophysics
Quality through the lens of AstrophysicsQuality through the lens of Astrophysics
Quality through the lens of Astrophysics
 
Legend of Zealot Anarchist Robot
Legend of Zealot Anarchist RobotLegend of Zealot Anarchist Robot
Legend of Zealot Anarchist Robot
 

Último

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 

Último (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

Scripting Recipes for Testers

  • 1. Script Recipes for Testers Adam Goucher Manager of Quality, Zerofootprint Software adam@goucher.ca http://adam.goucher.ca
  • 2. About Me • Testing for 10 years • Tool-smithing for most of them • Scripting has been and important part of both my career and testing success
  • 3. About You • Want to be a better tester • Who to find better bugs • More efficiently
  • 4. About This Tutorial • Reusable scripts explained • Tips for your own scripts
  • 5. So Why Script? • Provide new insight into your product • Generate test data • Automate repetitive / common / complex tasks • Replace expensive tools with ones tailored to your environment
  • 6. Language Choice • Is far too often a religious choice • Use what is right for the task
  • 7. Language Choice • Do you know the language? • Could you learn it? • Is it supported on all your (current) platforms? • Are those platforms all considered first-class citizens? • Can it interact with your database?
  • 8. Language Choice • Does it control your other tools? (Selenium, Watir, etc.) • Can you recycle code (Java jars or .NET assemblies) from elsewhere in your application? • Does it support Unicode as a core data type? • Is there seamless interaction with the operating system? • Is there an active member community (to whom you can turn to for help)
  • 10. Developer Notes • hack, broken, kludge are not things I like seeing in code I am testing • fixme and todo in comments imply hidden knowledge • style
  • 11. A better grep • grep is a unix tool for searching for things inside files • The ‘developer notes’ script is like a cross- platform grep
  • 12. How to run • Set the source_base to point to the root of your project source code • Set the interesting value to the types of file you want to check • Add items you want to check to the notes list; all lowercase
  • 14. Tip: Complexity • If you don’t have to do something in a complicated way, don’t.
  • 15. Tip: Common Case • Converting both sides of a comparison to a common case means you don’t have to worry about case
  • 16. Tip: Performance • Unless performance really matters, don’t worry about it • Optimizations add complexity
  • 17. LOUD • i18n and l10n are hard things to get right • But is pretty easy to test • Since we (the testers) are not responsible for content; the translators are
  • 18. LOUD • The ‘loud’ screen alters the text which is shown on the screen - ^LOUD$ • Everything that should be translated should be UPPERCASED • Everything that shouldn’t be is not • Blocks of text should not be split into different LOUDed strings
  • 19. How to run • This script needs to be customized for your organization’s method of creating resource bundles
  • 20. Tip: Use fake ‘files’ • Rather than using your real resource bundle to build the script, use a variable that looks like a file • It is faster, and you cannot accidently delete your master copy while on the train without an internet connection
  • 21. Audible Log Monitoring • Log files provide a wealth of information • If your eyes are on a log while doing a test they cannot be somewhere else • Use your ears instead
  • 22. How to run • in watchlist.txt, create a list of strings or regexes which it needs to watch for • and the wav file it will play when it finds it
  • 23. Tip: Package for Convenience • Some people are scared of anything that looks like ‘code’ • More often than not these are ones who are not ‘unix people’ • A tool is only useful if it is used • All scripting languages have the ability to compile themselves into .exe
  • 24. Tail’ing the Event Log • Another tool I miss on windows is tail • When on remote unix machines I am constantly tailing logs • ‘Proper’ windows applications however log to the Event Viewer which cannot be tailed (even if you have a windows version installed)
  • 25. How to run • Once you have installed the Python Win32 Extensions, just run the script
  • 26. Future Changes • Merge with Audible Log Monitoring
  • 27. Tip: Platform neutrality • Platform neutrality is a noble goal • But the goal should be abandoned if the situation makes sense
  • 28. Browser Percents • When testing web applications, one of the key decisions to make is how much to test with what browser • Aggregate 3rd party information, or • Information from your actual webserver?
  • 29. How to run • I only run this script every so often so the filename is in the script • The regex in the script is written for the Apache access log format • If you are using a different webserver you just have to change the regex
  • 30. Tip: Reinvent the wheel • There are a tonne of libraries and tools which parse log files • Reinvent the wheel if • you can learn something • you want specific information and don’t need anything else
  • 31. Tip: Filter the data • Your access log is going to be littered with your own office; filter it out to get a real information
  • 32. Algorithmic Oracles • Oracles can be people, specifications (like an RFC) or a comparable product • Or if something is an algorithm it can be an alternative implication • In something like a script
  • 33. How to Use • Implement your algorithm as a verification task • Run what your developers produce through the script • Warning: If you implement it wrong, then you will could be ignoring bugs or creating red herring ones
  • 34. Test Case Generation • This is the opposite of the Oracle script • One of the main reasons I create test data ahead of time is to not have to think under pressure • Script that thinking
  • 35. How to Use • Just implement the algorithm • Warning: If you implement it wrong and you will be using bad data
  • 36. Tip: Random • Real world data is random • Create your test data the same way • The infamous Pesticide Paradox
  • 37. Tip: Dual Purpose • I put the oracle and generation scripts for the same algorithm in the same script
  • 38. Excel manipulation • Excel is a really convenient tool for data creation • It is also really powerful and comes with its own scripting language
  • 39. Tip: Layers • If something has a native scripting layer, use it
  • 40. GUI Automation • Commercial GUI automation tools are budget killers • For a number of application types the open- source alternatives are just as effective • You just need to fall back on manual scripting sooner
  • 41. GUI Automation • Here are the 4 steps I use when automating a UI 1. Record the test 2. Add the testing conditions 3. Traditional data driving 4. Give the script smarts • 2 - 4 tend to require scripting
  • 42. Metaframeworks • Metaframeworks are frameworks which run different test frameworks and aggregates the results
  • 43. Meta why? • Imagine from one command getting the results of your JUnit, Selenium, homebrew and Watir at once? • This is a big bit of scripting...
  • 44. Tip: Language Variants • A lot of the major scripting languages have been ported to other interpreters • Java: Jython, JRuby • .NET: IronPython, IronRuby
  • 45. Go Forth and Script!