Python Scripting for Software Testers

Workshop Objectives

Python is an elegant, powerful, object-oriented, high level programming language. It’s known for its use in developing applications rapidly and still resulting in maintainable, easy to read code. It has easy bindings with other language platforms like Java, Dot Net, C/C++ etc.

It can very well be the primary language of a software tester which he/she employs for day-to-day test automation needs as well as in design of general purpose test automation frameworks.

This 5-day workshop focuses on building a strong hold over the Python language so that beyond this workshop the participants can explore the language further and are able to put the language to a given use.

Learning Objectives

  • Introduction to Python
    • High Level Striking Features of Python
    • Interactive Python Command line
    • Running Python Scripts using the interpreter
    • Intermediate compiled formats and their optimization
    • Significance of the mandatory white space
    • Python statements – Single line, Multiple Line
    • Printing Output in Various Formats
    • The Multi-line String and its uses
    • Handling User Input
    • Python Modules Versus Python Scripts
    • Manipulating Python path
    • Declaring Python Variables
    • A First Look At Error Handling versus Exceptions
    • A First Look at In-Built Python Exceptions
  • Python Data Types – I
    • Numeric Types
    • Boolean
    • Complex Numbers
    • Strings
    • Understanding Raw Strings and their uses
    • Understanding doc strings and their uses
    • Python doesn’t Interpolate in strings
    • Mutability Versus Immutability in Python
    • What does immutable really mean?
  • Python Type Conversion
    • How Python determines type of a variable
    • First Look at How Everything is an object in Python
    • Python Garbage Collection
    • Python types module for Types Checking
    • Python Type Exceptions
    • Type Conversion Functions
    • Python Manifesto
    • Python values Explicit than Explicit
  • More Python Arithmetic
    • Understanding Python Division Operator
    • Operator Overloading In Python
    • How Overloading reduces Python Learner’s Memory requirement
    • Default Overloaded Operators
    • Python decimal module
    • Operator Precedence
  • Python Data Types – II
    • Python Sequence Types – Lists and Tuples
    • Declaring and Using Lists
    • String as a Sequence Type
    • Declaring and Using Tuples
    • When to Use Lists versus When to Use Tuples
    • Tuples as immutable lists
    • Python’s implicit use of tuples
    • Sequence unpacking
    • Sequence slicing
    • Sequence indexing
    • Sequence Update
    • Sequence Deletion
    • Sequence assignments
    • First Look At Python Nested Data Structures
    • Sequence Appending and Extending
    • range() method and its variants
    • xrange() method and benefits
    • Python Mapping Type – Dictionary
    • Creating Dictionaries
    • Updating Dictionaries
    • Unsorted nature of dictionaries
    • Constraints on Keys
    • Building Nested Data Structures using Dictionaries
    • When to use a dictionary
    • Uses of tuples in a dictionary
  • Python Control Structures I – Conditional Structures
    • if/elif/else
    • Relational Operators in Python
    • Operator Overloading in relational operators
    • Nesting conditional paths
  • Python Exception Handling
    • try/except/else/finally
    • raise keyword
    • Python’s built-in exception hierarchy
    • Compounding conditions using logical operators
    • The Python None type
    • Nested calls and exceptions – stack unwinding
    • Using Stack unwinding in debugging Python code
    • How exceptions can be used in building logic
    • Understanding traceback module
  • Python Control Structures II – Looping Constructs
    • while loop
    • for loop
    • Variants of for loop
    • Concept of Iterables and iter() function
      Basic List comprehension in Python
    • Python’s Exceptions related to looping
    • Looping over index and value at the same time
  • Creating and Using Functions in Python
    • Function calling basics
    • Call by Object Reference
    • Default Arguments
    • Keyword arguments
    • Lambda
    • Does Python support function overloading?
    • How to do “call by value”?
    • Dynamic Function calls
  • Python Modules and packages
    • importing existing modules
    • Variants of import statements
    • Caveats in imports
    • Putting test code inside a module
    • Packaging modules inside a package
  • Object Oriented Programming in Python
    • Introduction to OOP
    • Which OOP features Python supports
    • class keyword
    • Inheritance
    • Multiple Inheritance and Mixins
    • Overriding
    • Operator Overloading
    • Making a class behave as a dictionary
    • Overriding string representation of an object
    • Power of Introspection
  • File handling in Python
    • Treating File As An Array
    • Treating File As a Dictionary
    • Treating File as a Bank Locker
  • Useful Modules
    • os
    • os.path
    • os.envrion
    • sys
    • shutil
  • Database Access with Python
    • Using file based dbs
    • PySQLite
  • Python Generators
    • Basic generators
    • Their use in test data generation
    • Their use in Fuzzing
  • Writing Web Apps With Python
    • Introduction to Web and HTTP
    • Basic CGI using Python
    • Using Django
  • Regular Expressions in Python
    • re module
    • Commonly used RegEx expressions
    • Compiled regular expressions
  • Networking
    • Introduction to socket programming
    • Writing a network client in Python
    • Writing a network server
    • HTTP client in Python
  • Process Handling in Python
    • Subprocess  module
    • Sharing envrionment variables
    • Reading STDOUT/STDERR
  • Testing Python Code
    • PyUnit
    • Doc test
    • Nose
    • profiler
    • Freshen
    • Fitnesse and PyFIT
  • XML Processing in Python
    • ElementTree module
  • Putting it all together
    • Understanding how the concepts learned so far can be used in building a general purpose test framework
    • Discussing about test automation architecture and how Python features can be used in the building the same

9 responses to “Python Scripting for Software Testers”

  1. Anindya

    How can I learn all of the above topics? I am currently in Hyderabad with 7 years of software testing experience but with no coding/scripting backgorund. Kindly suggest.

  2. Rahul Verma

    @Anindya,

    I hope you found the call useful and would stick to the learning schedule we talked about.

  3. Anindya

    Yes I will Rahul. Thanks.

  4. Sahil

    Hi Rahul,
    I am having the same question!
    How can i learn the above topics? There is need of urgency for me to learn this at the earliest.
    Can you help me please!

  5. Rahul Verma

    @Sahil,

    You can start here: How Would Pareto Learn Python!

  6. Naveen

    Hi Rahul,
    I am planning to learn Python.
    I am in B’lore. Possible to meet you & discuss about the course?
    How many days it takes to complete the above topics?

    Regards
    Naveen

  7. Rahul Verma

    @Naveen,

    I’ve responded to you on your email.

  8. vsairam

    Hi Rahul

    To learn the python we need to have any basic idea about any laungaues like cand c++ …………….because i am not having any idea about them………..is possible to me to learn python with knowing them.
    if possible pls tell me how to start .

    Regards
    sairam
    9535113251

  9. Rahul Verma

    @Sairam,

    Python is a language of its own and you can learn it independently of other languages.

    You can start here How Would Pareto Learn Python! on Testing Perspective website.

    There is a also a beginners’ book by Swaroop: A Byte of Python, which is a good one.

Leave a Reply

Copyright © Testing Perspective,