Winning the Battle against Automated Testing. Elena Laskavaia March 2016



Similar documents
Escaping the Works-On-My-Machine badge Continuous Integration with PDE Build and Git

Introduction to Automated Testing

Jenkins User Conference Herzelia, July #jenkinsconf. Testing a Large Support Matrix Using Jenkins. Amir Kibbar HP

The ROI of Test Automation

TeamCity A Professional Solution for Delivering Quality Software, on Time

Build Automation for Mobile. or How to Deliver Quality Apps Continuously. Angelo Rüggeberg

Copyrighted , Address :- EH1-Infotech, SCF 69, Top Floor, Phase 3B-2, Sector 60, Mohali (Chandigarh),

Continuous Integration

Automation using Selenium

Software Automated Testing

GUI Test Automation How-To Tips

Implementing Continuous Integration Testing Prepared by:

Sonatype CLM Enforcement Points - Continuous Integration (CI) Sonatype CLM Enforcement Points - Continuous Integration (CI)

The AppSec How-To: Achieving Security in DevOps

Java Software Quality Tools and techniques

Continuous Integration Multi-Stage Builds for Quality Assurance

@jenkinsconf. Maintaining huge Jenkins clusters - Have we reached the limit of Jenkins?

Practicing Continuous Delivery using Hudson. Winston Prakash Oracle Corporation

Sreerupa Sen Senior Technical Staff Member, IBM December 15, 2013

International Journal of Advanced Engineering Research and Science (IJAERS) Vol-2, Issue-11, Nov- 2015] ISSN:

Test Driven Development Part III: Continuous Integration Venkat Subramaniam

SOFTWARE TESTING TRAINING COURSES CONTENTS

SUCCESFUL TESTING THE CONTINUOUS DELIVERY PROCESS

Automated Acceptance Testing of High Capacity Network Gateway

Achieving business benefits through automated software testing. By Dr. Mike Bartley, Founder and CEO, TVS

Developer Workshop Marc Dumontier McMaster/OSCAR-EMR

How To Test A Web Based System

Build management & Continuous integration. with Maven & Hudson

Domain Specific Languages for Selenium tests

Solution Spotlight KEY OPPORTUNITIES AND PITFALLS ON THE ROAD TO CONTINUOUS DELIVERY

Advanced Software Testing

SUCCESFUL TESTING THE CONTINUOUS DELIVERY PROCESS

Building, testing and deploying mobile apps with Jenkins & friends

Adaptive Automated GUI Testing Producing Test Frameworks to Withstand Change

Continuous Integration with Jenkins. Coaching of Programming Teams (EDA270) J. Hembrink and P-G. Stenberg [dt08jh8

Why Test Automation Fails

Fail early, fail often, succeed sooner!

GLOBAL JOURNAL OF ENGINEERING SCIENCE AND RESEARCHES

Grunt, Gulp & fabs. Build-System and Development-Workflow for modern Web-Applications

Software configuration management

Software Quality Exercise 2

Continuous Integration Processes and SCM To Support Test Automation

Continuous integration End of the big bang integration era

Development Testing for Agile Environments

Software Development Kit

WELCOME TO Open Source Enterprise Architecture

ASSURING SOFTWARE QUALITY USING VISUAL STUDIO 2010

Designing with Exceptions. CSE219, Computer Science III Stony Brook University

Improving Software Quality with the Continuous Integration Server Hudson. Dr. Ullrich Hafner Avaloq Evolution AG 8911

Quality Assurance Training Program

Introduction to Android Development. Jeff Avery CS349, Mar 2013

Best Practices for Web Application Load Testing

Testing Tools Content (Manual with Selenium) Levels of Testing

Bailey Testing Framework. An automated graphic based GUI testing framework for TDD process.

Guideline for stresstest Page 1 of 6. Stress test

Windmill. Automated Testing for Web Applications

LoadRunner and Performance Center v11.52 Technical Awareness Webinar Training

Testing, Debugging, and Verification

Mobile Test Automation Framework

Delivering Quality Software with Continuous Integration

Effective Java Programming. efficient software development

Not agree with bug 3, precision actually was. 8,5 not set in the code. Not agree with bug 3, precision actually was

AUTOMATED TESTING and SPI. Brian Lynch

Getting Things Done: Practical Web/e-Commerce Application Stress Testing

White Paper Performance Testing Methodology

Massively! Continuous Integration! A case study for Jenkins at cloud-scale

Effektiver Tool-Einsatz

Fully Automated Static Analysis of Fedora Packages

Oracle Solaris Studio Code Analyzer

Pipeline Orchestration for Test Automation using Extended Buildbot Architecture

Scalable Web Programming. CS193S - Jan Jannink - 1/12/10

JavaScript Applications for the Enterprise: From Empty Folders to Managed Deployments. George Bochenek Randy Jones

Cross Platform Mobile. -Vinod Doshi

Levels of Software Testing. Functional Testing

Educational Collaborative Develops Big Data Solution with MongoDB

Continuous Delivery at SAP: From dinosaur to spaceship. Darren Hague / SAP Global IT November 1st, 2013 Public

Test Automation -Selenium

Coverity Services. World-class professional services, technical support and training from the Coverity development testing experts

Viewpoint. Choosing the right automation tool and framework is critical to project success. - Harsh Bajaj, Technical Test Lead ECSIVS, Infosys

Keywords Continuous Integration, Engineering Pipeline, SonarQube, Test Orchestration.

Web Application Testing. Web Performance Testing

Upping the game. Improving your software development process

OTM Performance OTM Users Conference Jim Mooney Vice President, Product Development August 11, 2015

QEx Whitepaper. Automation Testing Pillar: Selenium. Naveen Saxena. AuthOr:

Enterprise Service Bus

Finally, an agile test strategy (that works)! AS OW Test Model, Objectware

Delivery. Continuous. Jez Humble and David Farley. AAddison-Wesley. Upper Saddle River, NJ Boston Indianapolis San Francisco

Transcription:

Winning the Battle against Automated Testing Elena Laskavaia March 2016

Quality Foundation of Quality People Process Tools

Development vs Testing Developers don t test Testers don t develop Testers don t have to be skilled Separate Developers and Testers Make the Test team responsible for quality

One Team Quality is a team responsibility

The Process When quality is bad let's add more steps to the process

Thousands of developers Story about the broken Trunk Continuous stability is a must Trunk is broken too often Huge show stopper for R&D People did root-cause analysis Came up with Improved Process

Pull/Update All Source Improved Pre-Commit Process Clean compile All Re-build and re-deploy whole system Manually execute sanity test cases Repeat for all hardware variants

Process is too complex Trunk is still broken. Why? Developers are lazy Developers don t know about the process Process was not followed Environment / Hardware limitations Process is too boring Process is too time consuming

Automated Pre-Commit Testing

Pre-Commit Tests with Source Management System master Fix Push Checks Peer reviews Robots checks

Randomly pick a tool Spend 6 month developing testing framework Automation Hack Need a person to run it for every build Let's slap on some automation! Oops our tester quit, who knows how to run it? It does not work at all now! Oh well we don t have any more budget and time, let go back to manual testing

Continuous Testing Continuous Quality

Cost of Tools User Training Cost of Automation Integration and Customization Writing Test Cases Executing Test Cases Maintaining Test Cases

Make one team responsible Setup continuous integration Add pre-commit hooks Jump Start Establish simple selfverifying process Add one automated test

Key Principles of successful automated testing

Gate Keeper test system must guard the gate

100% Success 100% of tests must pass. zero tolerance

NO random failures Remove such tests from automation Use repeaters to keep intermittent tests Be prepared for the noise Modify AUT to remove source of randomness for tests

No monkeys pushing buttons to start the testing No monkeys watching automated UI testing Hooks on code-submission (pre-commit, fast) Fully Automated Hooks on build promotion (overnight)

Feedback for pre-commit <=10 min Fast and Furioius Overnight is absolute maximum More tests degrade the system response time Not all tests are born equal! Use tagging and filtering Distribute or run in parallel No sleeps

Make sure tests are not hanging! Use timeouts Use external monitors to kill hanging runs Do not overestimate timeouts Timeouts

Automated test cases are programs Test Scripts are Programs Treat them as source code They must be in text form They must go to same version control system Subject to code inspection, coding standards, build checks, etc

Unit Tests Part of the process Mandatory with commit Use servers to run Easy to write Use a mocking framework Use UI bot Use test generators Inline data sources

Unit tests cannot cover all Test actual installed AUT Unit Integration Run the program as user would Use same language for unit and integration testing

Candidates Pick and Choose you should not automate everything Difficult to set-up cases Rare but important scenarios Check lists Module is actively developed Long maintenance expected

Automatically Check Code submission is properly formatted (has bug id, etc) Self-Verification: test the test system? Code submission has unit tests Total number of tests is increased Performance is not declined Code coverage is not declined

Failed Battles

Tools we used or evaluated and failed after 3 month of writing tests realized that it won t work on Linux was pretty good until it was bought and it stopped launching with new eclipse 4 years ago: database, no text for tests, no integration slow, not debuggable, blocks on support. python. domain specific language WinRunner WindowTester Jubula Squish RCPTT

Working Solution

Unit testing JUnit Source Control and Code Review Git/Gerrit Static Analysis FindBugs Continuous Integration Tools Build System maven-surefire-plugin (for unit tests) maven-failsafe-plugin (for integration tests) findbugs-plugin for static analysis Continuous Integration Server Gerrit Trigger plugin - precommit builds and voting FindBugs plugin - reports and status JUnit plugin - reports and status gui testing Maven/Tycho Jenkins SWTBot junit mocking Code Coverage Lots of custom libraries, frameworks and bots Mockito Ecl Emma Custom

Tips and Tricks

Checks that can be added to every test Auto-Bots App crashed during a test Test timeout exceeded App generated unexpected log Temp files were not cleaned up Resource or memory leaks Runtime error detection

AutoBots: Junit Rules public class SomeTest { // tests that we don t leave tmp file behind (this is custom rule not // base junit) @Rule TmpDirectoryCheck tmprule = new TmpDirectoryCheck(); } @Test void testsomething(){ } // base class with timeouts public abstract class TestBase { public @Rule Timeout globaltimeout = Timeout.seconds(1); // 1 second }

Jenkins Split Verifiers Regression testing Linux To speed up verification for pre-commit hooks set up multiple jobs which trigger on the same event (i.e. patch submitted) Regression testing Windows +1 verify Static Analysis

Inline Data Sources: Comments in Java // template<typename T2> // struct B : public ns::a<t2> {}; // void test() { // B<int>::a; // } public void testinstanceinheritance_258745() { getbindingfromfirstidentifier("a", ICPPField.class); }

Run tests with code coverage Code Coverage Not during pre-commit check Unless it has validation hooks Good tool for unit test design (IDE) Code Coverage -> Select Tests Never ask for 100% coverage Based on changed code exclude tests that do not cover the changes

Can be run independently Static Analysis Has to be a gatekeeper Spent time to tune it (remove all noisy checkers) Push to desktop (if running as you type - instantaneous feedback!) Jenkins Plugin: Code Reviewer Post defects from static analysis as reviewer comments on the patch Use alternative UX on desktop (i.e. code formatter)

Tagging and Filtering: Junit Categories // tag class with categories in test class @Category({PrecommitRegression.class, FastTests.class}) public class SomeClassTest { @Test public void sometest() { } } // in maven pom.xml <build> <plugins> <plugin> <artifactid>maven-surefire-plugin</artifactid> <configuration> <groups>com.example.precommitregression</groups> </configuration> </plugin> </plugins> </build>

Runtime Filtering: Junit Assume // skip test entirely if not running in osgi @Before public void setup() { Assume.assumeTrue( Activator.isOsgiRunning() ); }

Intermittent Test: Junit Rule You can create a runner or define a rule which repeats a test if it fails. Junit itself does not define either, you have to add it yourself (2 classes, 62 lines) of code). public class SomeClassTest { public @Rule InterimittentRule irule = new InterimittentRule(); // repeat this up to 3 times if it failing @Intermittent(repetition = 3) @Test public void sometest() {} }

One Team Simple Process Right Tools The End