Programming for Testers and New Developers with Python

Programming for Testers and New Developers with Python
Start Date24th February 2015
Course CodeSS15-30
Full Fee
Duration4 Days
ProviderProfessional Training
Network Member Subsidised Fee€750.00
Download Course PDF  
  Course expired

Programme Overview

The core aim of the workshop is to give attenders confidence to use Python and to feel confident about learning more about Python programming. There will be a focus on using Python in Testing with an introduction to how Python is best applied in TDD.

The course is designed in specific sections, each of which involves a (generally) short presentation by the workshop leader followed by:

  • Pair working on one or more problems
  • Whole group working creating a model solution or comparing and contrasting work done with a pre-prepared code.
Course Objectives and Learning Outcomes

Delagetes will learn enough Python 2.6 so as to be able to:

Develop some straightforward applications.

Learn more about Python and hence be able to develop more sophisticated applications.

Understand the differences between, and consequences of, static and dynamic typing.

Appreciate the role of unit testing.

Have fun programming and gain clarity on:

  • Python basics and the tools of the trade.
  • Lists, Tuples, Dictionaries and Sets
  • Functions, classes, modules, packages.
  • Test frameworks, unit and integration testing.
  • Concurrency and parallelism – threads, processes, message passing.
  • Networking
  • XML Processing
Who should attend

The participants are likely to come from an established Python development environment and need to now become familiar with the language to become effective in TDD with Python and to work with their more experienced peers.

Course Content

Introduction and tools of the trade

  • A quick introduction to the course, the trainer.
  • Quick introduction of the attendees ( to give the trainer data to dynamically adjust the workshop)
  • A little background on Python to provide context.
  • The Python workflow; file as script, file as module.
  • Tools of the trade: editors, command lines, IDEs.
  • Documentation: pydoc, manuals.

Whirlwind Introduction to Python

A rapid introduction to some of the features of Python in two parts.

The first part introduces:

  • Strings
  • Integers
  • Loops
  • If
  • Imports
  • The object model of Python - enough to write some basic command line scripts.

The second part introduces:

  • Functions
  • Parameter passing
  • Classes
  • Exceptions
  • File handling
  • The unittest module; so as to be able to write some unit and/or system tests for the scripts written earlier.

Values, Types, Expressions and Statements

  • A rapid review of some of the built-in types of Python.
  • An opportunity to review looping and if statements and basic exception handling so as to address the notions of duck typing and EAFP.

Lists, Tuples, Dictionaries and Sets

  • An opportunity to review:
  • Lists
  • Tuples
  • Dictionaries
  • And, Introducing Sets.
  • A more detailed look at the read and write operations, emphasizing object-oriented, message passing reading.
  • Introduction to list, dictionary and set comprehensions.
  • Exercises involve some calculation problems and some file handling problems.


  • Review the basics of functions, introducing scope, the local dictionary, and (en passant) the global dictionary.
  • LEGB.
  • Parameter passing review and *args, **kwargs.
  • Higher-order functions leading to decorators. (Material on map, filter, reduce and partial evaluation is in the notes but is usually left as signposts for post workshop research rather than being covered in the workshop.)
  • Exercises involve some calculation problems and some file handling problems.


  • Review of classes, inheritance, instance data, class data.
  • There is material on the data model and the realization of message passing as calling "double underscore" methods.
  • Note: The depth of treatment is decided on with the group.
  • Exercises involve created a small class hierarchy. In the group work period the issue of value types is raised, leading to a discussion of how to use inheritance in Python.
  • File, Modules, Directories and Packages
  • A very short session reviewing files as scripts and modules, and introducing directories as packages.


  • Review the ideas of test already covered, and likely already known to attenders.
  • Introduce unittest.mock for use in unit testing if appropriate.
  • Introduce py.test and nosetest as alternatives to unittest.
  • Introduce coverage module.

Concurrency and Parallelism

  • This is a small session simply to ensure people are aware that the GIL of the current CPython and PyPy implementations of Python and the consequential single-threadedness — Jython and IronPython do not suffer the problems of a GIL.
  • Introduce multiprocessing briefly, to show that processes can be used to obtain parallelism.

XML Processing

  • A brief look at minidom, ElementTree and lxml.
  • Exercise will use ElementTree rather than the far superior lxml if it is not possible to install lxml via packages or if there is no C compiler so as to install using pip into a virtualenv.


Round off the workshop by reflecting briefly on the original aims and goals.

About the Trainer

Russel Winder - a Python and Groovy enthusiast

Russel Winder, the leader of the workshop, spent 20 years as an academic before leaving to run a venture capital funded start-up for five years. For the last 10 years, he has been working with a number of start-ups as well as being an independent consultant, analyst, author, expert witness, and trainer. He is author of “Python for Rookies”.

Since 2006, Russel has been involved in the UK and European Python communities. Initially this was through his use and involvement with SCons, and Waf, but this extended to Python training and involvement with the PyCon UK activity.