Software Testing. Theory and Practicalities

Similar documents
TestTrack Test Case Management Quick Start Guide

Continuous Integration

Software Testing with Python

Introduction to Automated Testing

New Tools for Testing Web Applications with Python

Testing Introduction. IEEE Definitions

Automated Testing with Python

Testing Tools Content (Manual with Selenium) Levels of Testing

TEST PLAN Issue Date: <dd/mm/yyyy> Revision Date: <dd/mm/yyyy>

Survey of Unit-Testing Frameworks. by John Szakmeister and Tim Woods

depl Documentation Release depl contributors

Software Testing. Definition: Testing is a process of executing a program with data, with the sole intention of finding errors in the program.

SOFTWARE TESTING TRAINING COURSES CONTENTS

Software Quality Testing Course Material

CIS 192: Lecture 13 Scientific Computing and Unit Testing

Chapter 8 Software Testing

MANUAL TESTING. (Complete Package) We are ready to serve Latest Testing Trends, Are you ready to learn.?? New Batches Info

Certified Selenium Professional VS-1083

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

Integration test in SharePoint

TEST AUTOMATION FRAMEWORK

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

Python as a Testing Tool. Chris Withers

Automated testing of CS UI using Selenium and Python

Appium mobile test automation

CUT COSTS, NOT PROJECTS

Python programming Testing

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

Software Testing. Knowledge Base. Rajat Kumar Bal. Introduction

Static vs. Dynamic Testing How Static Analysis and Run-Time Testing Can Work Together. Outline

Performance Testing from User Perspective through Front End Software Testing Conference, 2013


Automate Your BI Administration to Save Millions with Command Manager and System Manager

Wrestling with Python Unit testing. Warren Viant

PHP Integration Kit. Version User Guide

Advanced Topics: Biopython

Software Testing Automation

Generating Automated Test Scripts for AltioLive using QF Test

STUDY AND ANALYSIS OF AUTOMATION TESTING TECHNIQUES

Product: DQ Order Manager Release Notes

GETTING STARTED WITH CONTINUOUS DELIVERY. Lana wcgp.co

Basic Testing Concepts and Terminology

CSTE Mock Test - Part III Questions Along with Answers

Test Driven Development in Python

NGASI AppServer Manager SaaS/ASP Hosting Automation for Cloud Computing Administrator and User Guide

Continuous Delivery for Alfresco Solutions. Satisfied customers and happy developers with!! Continuous Delivery!

<Insert Picture Here> When to Automate Your Testing (and When Not To)

Introduction to Software Testing Chapter 8.1 Building Testing Tools Instrumentation. Chapter 8 Outline

The V-model. Validation and Verification. Inspections [24.3] Testing overview [8, 15.2] - system testing. How much V&V is enough?

Domain Specific Languages for Selenium tests

Software Testing Lifecycle

Secure Messaging Server Console... 2

Unit and Functional Testing for the ios Platform. Christopher M. Judd

Advanced Tornado TWENTYONE Advanced Tornado Accessing MySQL from Python LAB

Testing Spark: Best Practices

Standard Glossary of Terms Used in Software Testing. Version 3.01

FSW QA Testing Levels Definitions

Logistics. Software Testing. Logistics. Logistics. Plan for this week. Before we begin. Project. Final exam. Questions?

Python and Google App Engine

Agile Testing Principles and Best Practices. Progress Software, Hyderabad, India

Module 10. Coding and Testing. Version 2 CSE IIT, Kharagpur

ALERT installation setup

You ll need to have: It d be great if you have:

Databases and SQL. The Bioinformatics Lab SS Wiki topic 10. Tikira Temu. 04. June 2013

Testing Overview and Black-Box Testing Techniques

Course Catalog for QA Software Testing Training

Opacus Outlook Addin v3.x User Guide

Points of View. CxO s point of view. Developer s point of view. Attacker s point of view

How to configure the DBxtra Report Web Service on IIS (Internet Information Server)

How To Test Your Code

IceWarp Server. Log Analyzer. Version 10

imhosted Web Hosting Knowledge Base

PowerPanel for Linux Software

About This Document 3. About the Migration Process 4. Requirements and Prerequisites 5. Requirements... 5 Prerequisites... 5

CSTE Mock Test - Part I - Questions Along with Answers

A Practical Guide to implementing Agile QA process on Scrum Projects

Introduction to Python for Text Analysis

Data Migration from Magento 1 to Magento 2 Including ParadoxLabs Authorize.Net CIM Plugin Last Updated Jan 4, 2016

Developing tests for the KVM autotest framework

Webapps Vulnerability Report

Web Applications Testing

Stripe. Chapters. Copyright. Authors. Stripe modules for oscommerce Online Merchant. oscommerce Online Merchant v2.3

Th3 - Open Source Tools for Test Management

Test Automation Integration with Test Management QAComplete

Puppet Firewall Module and Landb Integration

Installation, Configuration, and Usage

DiskBoss. File & Disk Manager. Version 2.0. Dec Flexense Ltd. info@flexense.com. File Integrity Monitor

IBM InfoSphere MDM Server v9.0. Version: Demo. Page <<1/11>>

Best Overall Use of Technology. Jaspersoft

Co-Presented by Mr. Bill Rinko-Gay and Dr. Constantin Stanca 9/28/2011

IceWarp to IceWarp Server Migration

In this Lecture you will Learn: Implementation. Software Implementation Tools. Software Implementation Tools

PHPUnit and Drupal 8 No Unit Left Behind. Paul Mitchum

Benefits of Test Automation for Agile Testing

Transcription:

Software Testing Theory and Practicalities

Purpose To find bugs To enable and respond to change To understand and monitor performance To verify conformance with specifications To understand the functionality of code

Why Study Testing Testing is an integral part of professional software engineering Know how, when and why to apply testing techniques

Classifying Testing There are many testing techniques -- a taxonomy is useful White box vs. Black box Automated vs. Manual

White vs. Black Box How deeply do you look at the implementation of the system? Black box: do not want to look at implementation Grey box - understands assumptions and limitations of system White box: full knowledge of code, deliberate use of implementation choices

Automated vs. Manual Automated: make test Manual poke poke poke Semi-automated: configure, setup, test, evaluate, retest

Test Techniques Auto API Regression Unit GUI Automation Performance Integration Conformance Smoke Load Security Man Functional Usability BB Understanding WB

Where to Apply These Roughly, the lower the level of the component, the more amenable to automation Higher level components often require significant scaffolding to test effectively Complete functional coverage of a GUI application can be very resource intensive

Unit Tests Ensure completeness and correctness of implementation Cover all public APIs and significant internal APIs Begin writing tests as soon as basic structure and some APIs are known Regression tests: bugs as a source of test

Unit Tests Use or create your own infrastructure to make writing unit tests trivial. Goal: make test yields true or false

Unit Tests (Example 1) #... main part of module... import unittest class TestURLCanonicalization(unittest.TestCase): def test_basic( self ): u = URL( "http://www.example.com" ) self.asserttrue( u.scheme == "http" ) self.asserttrue( u.host == "www.example.com" ) self.asserttrue( u.port == 80 ) self.asserttrue( u.path == "/" ) self.asserttrue( u.params == "" ) self.asserttrue( u.fragment == "" ) self.asserttrue( u.url == "http://www.example.com/" ) if name == " main ": unittest.main()

Unit Tests (Example 2) #... main part of module... import unittest class TestURLCanonicalization(unittest.TestCase): def test_nonascii_escaped_fragment( self ): u = URL( "http://www.facebook.com/?ref=home#!/pages/โครงการหาบ)านใหม-ให)ส น ข จรจ ด-มก/117976974964923?sk=wall" ) self.asserttrue( u.scheme == "http" ) self.asserttrue( u.host == "www.facebook.com" ) self.asserttrue( u.port == 80 ) self.asserttrue( u.path == "/" ) self.asserttrue( u.params == "ref=home&_escaped_fragment_=/pages/..." ) self.asserttrue( u.fragment == "" ) self.asserttrue( u.url == "http://www.facebook.com/? ref=home&_escaped_fragment_=/pages/%e0%b9%82%e0...%81/117976974964923?sk=wall" ) if name == " main ": unittest.main()

API Testing A variant of Unit testing An important component of module documentation Added emphasis on edge-cases, exceptional conditions, parameter verification, abuse Well defined APIs work well with a testfirst strategy

API Test Example """ This is the "example" module. The example module supplies one function, factorial(). For example, >>> factorial(5) 120 """ def factorial(n): """Return the factorial of n, an exact integer >= 0. If the result is small enough to fit in an int, return an int. Else return a long. >>> [factorial(n) for n in range(6)] [1, 1, 2, 6, 24, 120]... import math if not n >= 0: raise ValueError("n must be >= 0")... if name == " main ": import doctest doctest.testmod()

Complex Integration and Unit Tests Test core application logic Often requires setting up test environment Invest in stubs, mocks, and scripted test scaffolding to automate complex testing

Stubs, Mocks, and Scaffolding Stubs: downstream fn that gives a reasonable response (null, True,...) Mock: somewhat intelligent stub. e.g. Must call fnx before fny. Scaffolding: potentially complex test environment. VMs, DBs, configurations

Stubs and Mocks More of a development than testing tool Focus development on one component at a time Enable unit and integration tests to be written

Example Stub class DummyCache( object ): def lookup( self, key, default_value = None ): return default_value def remove( self, key ): pass def store( self, key, val ): pass def clear( self ): pass

Test Scaffolding Goal: a controlled version of an approximation of some real world Automate or die Scripting, tooling, system administration skills are required

Complex example GUI GUI GUI Game Model Scoring Game Model Scoring Game Model Scoring Utilities GUI Utilities GUI Utilities Game Model Utilities Scoring Game Model Utilities Scoring

Scaffolding Env Example Vagrant::Config.run do config config.vm.box = "precise64" config.vm.provision :chef_solo do chef chef.cookbooks_path = "cookbooks" chef.add_recipe "mysql" chef.add_recipe "mysql::server" end config.vm.provision :shell, :path => "./setup.sh" end #!/bin/sh # setup test DB mysql -u root -p password -e "create database test;grant ALL PRIVILEGES ON test.* TO user@localhost IDENTIFIED BY 'password';flush PRIVILEGES; # fetch test data curl http://example.com/test_data.csv > /tmp/test_data.csv # load test data mysqlimport -u root -p password --local test /tmp/test_data.csv $ make test # cd tests/vagrant # vagrant up # cd../tests/integration # python test.py...

High-Level GUI Automation Testing Robot user - automate the use of the application Understand what you are testing Can be useful, but may be brittle

Selenium Example from selenium import webdriver from selenium.common.exceptions import TimeoutException from selenium.webdriver.support.ui import WebDriverWait driver = webdriver.firefox() driver.get("http://www.google.com") inputelement = driver.find_element_by_name("q") inputelement.send_keys("cheese!") inputelement.submit() try: # wait for the page to refresh WebDriverWait(driver, 10).until(lambda driver : driver.title.lower().startswith("cheese!")) # make assertions about the context of the page here... finally: driver.quit()

Functional Testing Humans (finally!) Written scripts and checklists Levels of detail: smoke, iteration, alpha, beta, release acceptance

Often Ignored Logs Internationalization Stubbed exception handling

Summary Some testing is the developer s responsibility Automation makes powerful testing relatively simple