Testing: Python, Java, Groovy, etc.

Similar documents
Code Quality Assurance. Peter Kofler, Code Cop FH Technikum Wien, February 2010

Fail early, fail often, succeed sooner!

JUnit. Introduction to Unit Testing in Java

Continuous Delivery. Alejandro Ruiz

Continuous Integration

Open Source HTTP testing tool. Stefane Fermigier

Software Continuous Integration & Delivery

Practicing Continuous Delivery using Hudson. Winston Prakash Oracle Corporation

Agile ALM. Lightweight tools and Agile strategies MANNING MICHAEL HUTTERMANN. Shelter Island

Advanced Software Testing

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

Case Studies of Free Test Tools Successful Test Tool Use without a Big Budget

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

Testing Python. Applying Unit Testing, TDD, BDD and Acceptance Testing

Build management & Continuous integration. with Maven & Hudson

Tech Radar - May 2015

<Insert Picture Here> What's New in NetBeans IDE 7.2

Getting Started. UC Santa Barbara Setup public repository (GitHub, Bitbucket) Identify workflow:

}w!"#$%&'()+,-./012345<ya

How To Write Unit Tests In A Continuous Integration

Continuous integration with Jenkins CI

MSWL Development & Tool. Eclipse IDE

Kevin Lee Technical Consultant As part of a normal software build and release process

Advanced Test-Driven Development

Agile.NET Development Test-driven Development using NUnit

The Agile Movement An introduction to agile software development

Self-review 9.3 What is PyUnit? PyUnit is the unit testing framework that comes as standard issue with the Python system.

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

Smarter Testing With Spock

Jenkins Continuous Build System. Jesse Bowes CSCI-5828 Spring 2012

Continuous Integration and Delivery at NSIDC

Continuous Delivery Maturity Model

Test-Driven Development

Continuous Integration

November 12 th 13 th London: Mastering Continuous Integration with Jenkins

CSE 373: Data Structure & Algorithms Lecture 25: Programming Languages. Nicki Dell Spring 2014

Paul Barham Program Manager - Java. David Staheli (dastahel@microsoft.com) Software Development Manager - Java

TeamCity A Professional Solution for Delivering Quality Software, on Time

Beginners guide to continuous integration. Gilles QUERRET Riverside Software

Fully Leverage Agile Test Automation Technical Success and Return on Investment

Software Construction

Mastering Continuous Integration with Jenkins

Java Software Quality Tools and techniques

XP and TDD. Extreme Programming and Test Driven Development. Bertrand Meyer, Manuel Oriol Andreas Leitner. Chair of Software Engineering ETH Zurich

Software infrastructure for Java development projects

Continuous Integration and Bamboo. Ryan Cutter CSCI Spring Semester

Beginner s guide to continuous integration. Gilles QUERRET Riverside Software

soapui Product Comparison

Practical continuous deployment

Unit Testing webmethods Integrations using JUnit Practicing TDD for EAI projects

Effektiver Tool-Einsatz

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

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

<Insert Picture Here> Introducing Hudson. Winston Prakash. Click to edit Master subtitle style

Open Source vs. Collaborative Software: FOSS is Not Enough

Continuous Keylane

BEST WEB PROGRAMMING LANGUAGES TO LEARN ON YOUR OWN TIME

Python Testing with unittest, nose, pytest

Gothenburg Mainframe and Continuous Integration. Jan Marek com. CA Technologies. Session S610

GETTING STARTED WITH CONTINUOUS DELIVERY. Lana wcgp.co

Continuous Integration/Testing and why you should assume every change breaks your code

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

ARCHITECTURE OF THE PROASENSE DEVELOPMENT ENVIRONMENT

The red hat enterprise linux developer program

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

Continuous Integration

Know the Difference. Unified Functional Testing (UFT) and Lean Functional Testing (LeanFT) from HP

A Pythonic Approach to Continuous Delivery

Continuous Integration Northwestern University. Evanston, Illinois November The Business of IT

Oracle Communications WebRTC Session Controller: Basic Admin. Student Guide

Coding in Industry. David Berry Director of Engineering Qualcomm Cambridge Ltd

Towards Software Configuration Management for Test-Driven Development

Jenkins: The Definitive Guide

Continuous Integration: A case study

<Insert Picture Here> TDD on a Coherence project

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

An Introduction to text-based test automation and the TextTest tool

Upping the game. Improving your software development process

Client Overview. Engagement Situation. Key Requirements

A central continuous integration platform

Software Testing with Python

Real-world Java 4 beginners. Dima, Superfish github.com/dimafrid

Erlang in E-Commerce and Banking

sveltest: A testing language

BDD in Action. Building Software Right Building the Right Software

Waratek Cloud VM for Java. Technical Architecture Overview

Transcription:

Testing: Python, Java, Groovy, etc. Prof Russel Winder http://www.russel.org.uk email: russel@winder.org.uk xmpp: russel@winder.org.uk twitter: @russel_winder Copyright 2012 Russel Winder 1

Aims, Goals and Objects Look at some practical aspects of testing with Python, Java, and Groovy. Consider some of the practical positives and negatives of using test-driven development. Possibly look at coverage as a useful tool for programmers. If time permits. And a dangerous weapon in the hands of ignorant managers. Copyright 2012 Russel Winder 2

Structure Introduction. First part. Short break. Second part. Conclusion. Copyright 2012 Russel Winder 3

Protocol Questions or short comments during the sessions are entirely in order. Let me know you have an interjection by raising your hand, and when I come to an appropriate pause, I'll pass you the token. Questions, answers, comments, etc. appearing to get too long as interjections may get stacked to be unstacked at a break. Copyright 2012 Russel Winder 4

Introduction Copyright 2012 Russel Winder 5

Russel Winder Theoretical Physicist: quarks, strangeness, and charm. UNIX systems programmer. Academic at UCL: parallel programming, HCI, psychology of programming. Professor of Computing Science at KCL: health informatics, parallel programming. Head of Department. Starter of start-ups. Independent consultant, analyst, author, expert witness, trainer. Copyright 2012 Russel Winder 6

Interstitial Advertisement Copyright 2012 Russel Winder 7

Projects Gant GroovyBalls GPars GFontBrowser SCons Pi_Quadrature GroovyFX Sleeping_Barber Groovy Gradle OK, so it's all open source. Copyright 2012 Russel Winder 8

Testing RW Historically The FORTRAN years. The C years. Early Smalltalk and C++ years. The Fortran years. Early Java years. Test-driven Development (TDD) hegemony. Feature-Driven Development (FDD). Behaviour-driven Development (BDD). extreme Programming Copyright 2012 Russel Winder 9

A Personal Epiphany C codes needs testing. C is very difficult re testing. Use Python as long as the C is in a dynamically linked library (aka shared object). Copyright 2012 Russel Winder 10

The Two Parts Copyright 2012 Russel Winder 11

The Terms Unit test. Integration test. System test. Acceptance test. Smoke test. Mutation test. Copyright 2012 Russel Winder 12

Unit Test Test the functions and methods for correct behaviour. May well require use of mocks. Copyright 2012 Russel Winder 13

Integration Test Test that combination of bits of the system collaborate in correct ways. Probably needs some use of mocks. Copyright 2012 Russel Winder 14

System Test Test that the system as a whole works as expected. No mocks at all. Smoke test a pre-test to ensure it is worth running all the tests. Copyright 2012 Russel Winder 15

Acceptance Test Test that the purchaser makes to be happy with the system as delivered. Used to be crucial, now contracts are usually not for one-off items, but for annual support. Copyright 2012 Russel Winder 16

Code under Test Copyright 2012 Russel Winder 17

The Tools Test frameworks: Unit testing Integration testing System testing. Programming language specific. Acceptance testing usually uses a different sort of tool, FitNesse for example. http://fitnesse.org/ Copyright 2012 Russel Winder 18

Testing: A Backdrop Testing as we know it today has its roots in extreme Programming. Smalltalk sunit Python PyUnit (aka unittest) C++ cppunit, Java JUnit Every language created one or many xunit variants on the assumption it was The right thing to do even when it wasn't. Copyright 2012 Russel Winder 19

The xunit Legacy xunit is fundamentally grounded in dynamic languages reflection required. Static languages like C++ need a very different approach, hence CUTE, Catch, using template meta-programming (aka compile time reflection). Static languages like Java, can use annotations still reflection based but better. Copyright 2012 Russel Winder 20

In the Python-sphere PyUnit, aka unittest py.test, aka PyTest Nose, aka nose There are many others but the above are the ones that matter. Copyright 2012 Russel Winder 21

In the JVM-sphere Java: Groovy JUnit3 GroovyTestCase JUnit4 JUnit3 in disguise TestNG Spock Scala Clojure ScalaTest clojure.test ScalaCheck Midje Specs2 lazytest Kotlin, Ceylon, Jython, JRuby, Copyright 2012 Russel Winder 22

Being In Control For all software developments always use a version control system. Given DVCSs such as Git, Mercurial, Bazaar, there are no excuses for not managing development with a version control system. Distributed version control system. Copyright 2012 Russel Winder 23

Individuals / Teams Single developer projects need no other tools. Multi-developer projects need more infrastructure. Copyright 2012 Russel Winder 24

Continuous Integration A process via which all tests are run for all commits to the mainline repository. A continuous integration server monitors the mainline repository. Copyright 2012 Russel Winder 25

Team Workflow Deployment Server Continuous delivery Continuous deployment Developer Developer Mainline Repository System Test Server Developer Developer Developer Continuous Integration Copyright 2012 Russel Winder 26

Buildbot FOSS continuous integration framework written in Python: Single master. Multiple slaves. http://trac.buildbot.net/ http://www.scons.org/ http://buildbot.scons.org/ Copyright 2012 Russel Winder 27

Atlassian Bamboo Commercial continuous integration server, free to FOSS organizations, e.g. Codehaus http://www.codehaus.org/ http://www.atlassian.com/ http://gant.codehaus.org/ Copyright 2012 Russel Winder 28

JetBrains TeamCity Commercial continuous integration server. Free support for FOSS projects. Cloudy. http://www.jetbrains.com/ http://gpars.codehaus.org/ Copyright 2012 Russel Winder 29

The Process Fix CUT Green Red New Test Refactor Copyright 2012 Russel Winder 30

Test-driven Development Never amend your code unless you have a failing test. Unless the change is a refactoring. Run all your tests often. Copyright 2012 Russel Winder 31

Refactoring Ensure there are no pending commits prior to a refactoring. Run all the tests immediately before a refactoring ensure you get a green. Run all the tests immediately after a refactoring ensure you get a green. If a refactoring leads to a red, back out of all the changes. Run the tests and ensure you get a green. Copyright 2012 Russel Winder 32

Unit Testing and Mocks System testing done within a constrained real system not live. Unit and integration testing needs to disconnect from some resources. Copyright 2012 Russel Winder 33

A short Monty Python moment Copyright 2012 Russel Winder 34

Copyright 2012 Russel Winder 35

A Short Coding Dojo Copyright 2012 Russel Winder 36

Conclusion Copyright 2012 Russel Winder 37

Testing It's what programmers do. Copyright 2012 Russel Winder 38

Version Control It's the way programmers work. Copyright 2012 Russel Winder 39

Interstitial Advertisement Copyright 2012 Russel Winder 40

Testing: Python, Java, Groovy, etc. Prof Russel Winder http://www.russel.org.uk email: russel@winder.org.uk xmpp: russel@winder.org.uk twitter: @russel_winder Copyright 2012 Russel Winder 41