@esconfs|#esconfs Programming for Testers It is easy! EuroSTAR Webinar Tuesday 15 th September 2015 Presented by: Graham Thomas Phillip Isles 1.

Slides:



Advertisements
Similar presentations
PHP I.
Advertisements

Guy Griffiths. General purpose interpreted programming language Widely used by scientists and programmers of all stripes Supported by many 3 rd -party.
GCSE Computing Lesson 5.
Introduction to Programming using Matlab Session 2 P DuffourJan 2008.
1 CS101 Introduction to Computing Lecture 17 Algorithms II.
Intro to Python Welcome to the Wonderful world of GIS programing!
INTRODUCTION Chapter 1 1. Java CPSC 1100 University of Tennessee at Chattanooga 2  Difference between Visual Logic & Java  Lots  Visual Logic Flowcharts.
Programming Types of Testing.
Creating a Program In today’s lesson we will look at: what programming is different types of programs how we create a program installing an IDE to get.
Introduction to a Programming Environment
CS 104 Introduction to Computer Science and Graphics Problems Software and Programming Language (2) Programming Languages 09/26/2008 Yang Song (Prepared.
Software Development Unit 6.
Recitation 1 Programming for Engineers in Python.
CASE Tools And Their Effect On Software Quality Peter Geddis – pxg07u.
Introduction CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
PHP TUTORIAL. HISTORY OF PHP  PHP as it's known today is actually the successor to a product named PHP/FI.  Created in 1994 by Rasmus Lerdorf, the very.
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
ICAPRG301A Week 4Buggy Programming ICAPRG301A Apply introductory programming techniques Program Bugs US Navy Admiral Grace Hopper is often credited with.
Python: An Introduction
CS1022 Computer Programming & Principles Lecture 1.2 A brief introduction to Python.
PYTHON. Python is a high-level, interpreted, interactive and object- oriented scripting language. Python was designed to be highly readable which uses.
Natural Born Testers Are You one? If not, then become one! Graham Thomas Independent Software Testing Consultant October 31, 2013 Potsdam, Berlin, Germany.
Introduction CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
CS 425 Game Programming I Jan M. Allbeck. Outline  Introductions  Expectations  Tools and setup  Quick introduction to C++ and Visual Studio  What.
HOMEWORK REVIEW This is an if else statement layout if (condition) { code to be executed if condition is true; } else { code to be executed if condition.
Python – Part 1 Python Programming Language 1. What is Python? High-level language Interpreted – easy to test and use interactively Object-oriented Open-source.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 5: Software Design & Testing; Revision Session.
Guide to Programming with Python Chapter One Getting Started: The Game Over Program.
Fundamental Programming: Fundamental Programming K.Chinnasarn, Ph.D.
Class 1: What this course is about. Assignment Read: Chapter 1 Read: Chapter 1 Do: Chapter 1 ‘workbook’ pages not finished in class Do: Chapter 1 ‘workbook’
CS 4720 Dynamic Web Applications CS 4720 – Web & Mobile Systems.
Chapter 3: Branching and Program Flow CSCI-UA 0002 – Introduction to Computer Programming Mr. Joel Kemp.
The Software Development Process
You Need an Interpreter!. Closing the GAP Thus far, we’ve been struggling to speak to computers in “their” language, maybe its time we spoke to them in.
1 Debugging and Syntax Errors in C++. 2 Debugging – a process of finding and fixing bugs (errors or mistakes) in a computer program.
Software Development. Software Development Loop Design  Programmers need a solid foundation before they start coding anything  Understand the task.
Files Tutor: You will need ….
C++ LANGUAGE TUTORIAL LESSON 1 –WRITING YOUR FIRST PROGRAM.
Trinity College Dublin, The University of Dublin GE3M25: Computer Programming for Biologists Python Karsten Hokamp, PhD Genetics TCD, 03/11/2015.
Intermediate 2 Computing Unit 2 - Software Development.
 Software Development Life Cycle  Software Development Tools  High Level Programming:  Structures  Algorithms  Iteration  Pseudocode  Order of.
GCSE Computing: Programming GCSE Programming Remembering Python.
Graham Thomas Independent Software Testing Consultant Software Testing Secrets That We Dare Not Tell ! #esconfs.
Introduction CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
Efficiently Solving Computer Programming Problems Doncho Minkov Telerik Corporation Technical Trainer.
Programming Objectives What is a programming language? Difference between source code and machine code What is python? – Where to get it from – How to.
Overview In this tutorial you will: learn what an e-portfolio is learn about the different things e-portfolios may be used for identify some options for.
CS Class 04 Topics  Selection statement – IF  Expressions  More practice writing simple C++ programs Announcements  Read pages for next.
OCR A Level F453: The function and purpose of translators Translators a. describe the need for, and use of, translators to convert source code.
PROGRAMMING USING PYTHON LANGUAGE ASSIGNMENT 1. INSTALLATION OF RASPBERRY NOOB First prepare the SD card provided in the kit by loading an Operating System.
Getting Started With Python Brendan Routledge
Computer Programming Week 1: The Basics of CP 1 st semester 2012 School of Information Technology Website:
FILES AND EXCEPTIONS Topics Introduction to File Input and Output Using Loops to Process Files Processing Records Exceptions.
Part 1 Learning Objectives To understand that variables are a temporary named location to store data and that programmers work with different data types.
Here’s Why You Should Choose Website Builders over Other Options Squarespace allows you to add and move around your content (text, video, images, sounds,
Flowcharting Workshop
Development Environment
GCSE COMPUTER SCIENCE Practical Programming using Python
Software Development.
CS1022 Computer Programming & Principles
Data Types Variables are used in programs to store items of data e.g a name, a high score, an exam mark. The data stored in a variable is entered from.
SVTRAININGS. SVTRAININGS Python Overview  Python is a high-level, interpreted, interactive and object-oriented scripting language. Python is designed.
Learning to Program in Python
Learning to Program in Python
Learning to Program in Python
Learning to Program in Python
Unit 6 Assignment 2 Chris Boardley.
CSCI 203: Introduction to Computer Science I
Primary School Computing
Presentation transcript:

@esconfs|#esconfs Programming for Testers It is easy! EuroSTAR Webinar Tuesday 15 th September 2015 Presented by: Graham Thomas Phillip Isles 1

@esconfs|#esconfs Abstract We hear a lot these days about how testers should learn to code, become more technical, and have more development orientated skills. Unless you came into software testing as a ‘burnt out’ developer, it is unlikely that you have coding skills, or a deep understanding of the technical ins and outs of your current systems landscape. What can you do about it? Is programming hard? How can you learn to code, gain the benefits and still master your current workload, which keeps on relentlessly increasing? In this webinar, a companion piece to last year’s conference workshop, we show you how easy it actually is, as a tester, to learn how to program. The hard part, as always, is how to start. We will start with 3 simple steps and show you how to get up and running with Python. And to help you back in the office we will arm you with some of the most useful on-line references and information that is available. Each journey starts with a single step. Let us help you take your first programming step today. Key Takeaways: ◦A deeper insight into the Testers need to learn to code debate ◦Your first steps into programming ◦Experience, examples and references to help you continue your Programming Adventure 2

@esconfs|#esconfs Agenda  Our Journey  The Why?  What learning to programme can give you  The How?  It’s easy – but not really!  The next steps on your own programming journey? Nasa Hubble New Horizons 2015 Pluto 3

@esconfs|#esconfs Our Journey Began 2 years ago at Testers Retreat in September 2013, in the Netherlands. ◦Asked if we would submit for a conference ◦Said yes, but would really like to run a workshop showing testers how to program ◦Using only free tools, show testers the basics, enthuse & inspire to want to learn more Our submission was accepted for BTD and we had 3 months to prepare. ◦Decided to use; Python, Raspberry Pi, and a USB Robotic Arm! Ran a rehearsal workshop with some of Phill’s colleagues Then ran the workshop at 6 conferences, including EuroSTAR 2014 ◦So there is Tester interest and demand for programming experience Amazingly at every workshop a ‘non-programming’ tester successfully completed the final exercise, a challenge to program a USB Robotic Arm! 4

@esconfs|#esconfs 3 months to design a workshop We decided to base the workshop around Linux and Python. We wanted to show how easy it was to get started, so we chose the Raspberry Pi, a credit card sized and fully functioning Linux computer, which costs only $35. We decided to use Python as the programming language: ◦Python is free ◦Easy to use. Design philosophy emphasises readability ◦Syntax requires fewer lines of code than other languages, e.g. C ◦Powerful, scalable, and portable And to make it fun, because that is how we learn best, we decided to build some exercises around programming a USB Robotic Arm (£29.95) Raspberry Pi 2 (Quad Core) ‘IoT’ ready Python USB Robotic Arm 5

@esconfs|#esconfs Ok, I am a Tester, why should I learn to code? Well, you don’t have to learn to code. ◦You can work successfully as a tester without finding out the first thing about programming. However, the world continues to change and move forward. ◦With the advent of agile approaches which encourage an understanding of code ◦And more recently the IoT ‘revolution’, and rapid prototyping approaches Makers There are more and more opportunities for Testers who can understand code. We do not think that as a tester you will have to sit there all day writing code, however being able to read code gives you several advantages: ◦An understanding of how to write code will give you some insights into the kinds of errors that programmers make ◦And you will get a feel for where errors are likely, given an understanding of how the code has been constructed This will make you a better tester. ◦(There is also an argument that programmers should learn to test, and that will make them better programmers, but that is not for today!) RP APDR 6

@esconfs|#esconfs So what do I get if I can code? A bit better as a tester But so much more: ◦When you sit there thinking, ‘If only I could.... ‘, well now you can. ◦No longer do you have to wait for some programmer to come free to reluctantly code some ‘demeaning test utility’ ◦Write some code: ◦Control scripts ◦Data Generation ◦Data Fuzzing ◦Results checking ◦Automate a manual process ◦Any utility you can think of... ◦The possibilities are endless All you need is a lightbulb Graham: As a former programmer, I was amazed that testers couldn’t just code their own utilities. I could, did, and still do. 7

@esconfs|#esconfs A few disclaimers This is a webinar, it isn’t a highly interactive workshop, and there isn’t a 2-way discussion. Phill and I are not teachers. In the workshops we just ‘show’ the delegates how to do things. For those who are inspired to ‘have a go’, all of the code examples, a video, and a 30 page paper are freely available for download on my (Graham) website The paper will also be shared after this webinar as a EuroSTAR e-book. So if you get lost following us you know where to go and look. 8

@esconfs|#esconfs Set-up “Nothing great was ever achieved without a few software installs!” – Anon. Python ◦First, for windows users, we installed Python. This comes as standard for Linux and Mac users. Geany ◦We then installed the Geany IDE, Integrated Development Environment. ◦You could write Python code in flat text files but using an IDE brings with it some advantages such as: ◦Syntax Checking ◦Build tools ◦debugger ◦Highlighting, context actions, autocomplete, configurable ◦Fast, free and lightweight We used python 2 in the workshop, but python 3 is now the preferred option. The only difference is the print statement syntax. print (“hello world”) 9

@esconfs|#esconfs Exercise 1 - Sequence We write a program to input 2 numbers and multiply them together. As it is your first program there is a lot to do We look at: ◦shebang - #! – which sets the environment ◦comments # ◦print ◦input ◦Variables ◦str – string ◦the compiler ◦and executing the program 10

@esconfs|#esconfs Output The output doesn’t look particularly amazing. Unless, that is, you have actually coded it. There is a lot to cover in your first program, and this small program covers a lot of ground. But just to get this far is an achievement. You have gone beyond the simple print (“hello world”) stage and begun to start writing code which will build into more complex programs. Input ProcessOutput 11

@esconfs|#esconfs Exercise 2 - Iteration We write a program that counts down to zero from an inputted number. Here we see: ◦A more robust form of input – raw_input ◦Convert strings to integers ◦Look at Python indentation ◦How to construct a while loop A loops is a very powerful construct. However get it wrong and the program can continue running forever, or more commonly until it crashes. 12

@esconfs|#esconfs Output This is still a very simple program, but is also very powerful. We have formatted the output to leave a few blank lines to ease readability. (If your program runs forever, try Ctrl-C, and work out where the error is.) NB. We were asked to write a program that counted down to zero. There is a bug. A deliberate one we admit. We used a “ > ” comparator, but should have used “ >= “. The sort of error testers are looking for! In the workshop we also asked delegates to amend their program to count up to a number. That requires using the python comparator “ == “ Repeat 13

@esconfs|#esconfs Exercise 3 - Decision Already our programs are becoming longer and more complex. Ex. 3 compares 2 inputted numbers and reports which is the higher. Here we are using the if, elif and else construct. (‘elif’ is python speak for ‘else if’) And we are also formatting the output to look better on the screen. 14

@esconfs|#esconfs Output See how the output is more readable. Think how many test cases you would need to test the logic in this simple comparison program. When you have ‘tested’ it and are happy it works, try amending it to check whether the numbers are equal first, using the comparator “ == “. Armed with an understanding of sequence, iteration and decisions, you will be able to write quite complex programs even with a minimal understanding of python. Q? Action A Action B Y N 15

@esconfs|#esconfs Robot Arm - Challenge Flowchart + Code Template Challenge: Write a program to move the Robot Arm over a cup, drop an eraser held in its jaws, and report whether the eraser landed in the cup or not. 16

@esconfs|#esconfs Before you get carried away There is so much more: ◦80%+ of all code written is to handle errors and exceptions ◦The examples here are not bullet proof, as we easily demonstrate in the workshop Python is a very powerful language and we have only scratched the surface: ◦A huge amount of built-in libraries ◦A feature rich and powerful language that we haven’t begun to scratch with these exercises We wanted to take you beyond print “Hello World”, get you started, and encourage, or inspire you to want to do more. 17

@esconfs|#esconfs References Python ◦ Python Beginners Guide ◦ Programmershttps://wiki.python.org/moin/BeginnersGuide/ Programmers On-line Python Tutorials ◦ Geany ◦ Raspberry Pi Foundation ◦ Visit my (Graham) website for full links, paper, slides, exercises, video, T-Shirt, etc. ◦ And if you get stuck, try a google, bing, or Wikipedia search. Even look on YouTube for online tutorials. A word of warning though! ◦Not everything that people post online is helpful, and some of it is harmful, so if you are unsure, check a couple of references first 18

@esconfs|#esconfs Summary We hope that we have inspired you to take your own python programming adventure. Let today already be your first step. For your next steps: ◦Download the paper ◦Work through the exercises ◦Go on-line and work through tutorials ◦Find a project to start programming ◦Be that on the Raspberry Pi, or even at work Start now by building a personal development plan.... Nasa 19

@esconfs|#esconfs Thank you for listening Graham Thomas Independent Consultant Phill Isles 20