Showing posts with label testing. Show all posts
Showing posts with label testing. Show all posts

Sunday, May 18, 2014

Pytest - Python Testing Tool - Testing Framework for Python

Python is a great language that allows you to accomplish things efficiently and effectively in little time. There are many frameworks out there for various purposes and objectives, and in a recent project I have used yet another one for testing, whose flexibility from the command line and extensibility possibilities merited a mention here.

Where to download Chrome Driver for use with Selenium WebDriver - Chrome Driver Download

Saturday, August 31, 2013

What I took from IT Security and used on QA Testing

I have met over the years many types of testers. Many types of professionals, with various core skills. Overall, they all fill a group that aims for the same objective, and together, with those various skills, create a more effective team.

I have a developer and very technical background, and worked on IT Security as well. I have brought many of my experiences from there to the Quality Assurance world.

Deep understanding of software, and SFDC, is also a key factor to complement your professional profile, ultimately helping you to be more effective and even efficient, because you may know where to look for bugs, errors, mistakes, and may know in advance how to trigger them due to your experience.

Some of the things I took from IT Security:

  • Breaking software, files, outputs, packets, formats.
  • Secure code.
  • Validate all inputs, always, from everyone.
  • Pay extra attention to how the memory is being used/managed. This greatly changes from language to language.
  • Certain non-functional requirements, often not defined, can make a difference for the acceptance criteria of any software development.

Wednesday, April 24, 2013

Introduction - Basic testing in Python - Using doctest for function tests

You can use doctest to assert that your functions are returning or producing the output you expected.

Here is a very simple function that just returns (as a float type) the multiplication of 2 integers:

def multiply(a,b):
    """ (int,int) -> float

    >>> multiply(2,3)
    6.0
    >>> multiply(3,4)
    12.0
    """
    return float(a*b)

if __name__ == '__main__':
    import doctest
    doctest.testmod()

The important thing to keep from this basic example is that the function returns the multiplication of 2 ints, and converts its result to a float type. The documentation of the function (enclosed by the three ") explains that the function receives 2 ints and returns a float.

Doctest uses the docstring to test the function.

In this case, the call ">>> multiply(2,3)" runs internally in the Python interpreter, and compares the result with the one we wrote. Then it does the same with the second test. If you pay attention you will see that it is as if we were writing those calls in the console ourselves, but in this case using them from the function documentation (Python calls it docstring).

To put it simply, the body of the "if" function is executed if our module, the one with the "multiply" function, is executed directly, and NOT imported. If it is imported, you will be able to use the "multiply" function, but no tests will be run, nor any code in the body of the if statement.

Finally, all these tests run because we used the "import doctest" and "doctest.testmod()" to run these tests. doctest is the module that has the behavior to execute these test cases.

It is very simple, only to serve as a reference to anyone new to the language. Python is being actively used in the scientific community, so a lot of professionals without actual programming experience are using Python. To them, I will aim some of my introductory posts.

Thursday, March 28, 2013

Python testing tools

Here you will find a lot of Python specific tools for testing different technologies and environments.


You can learn and read more about Python on its main website, http://www.python.org/.

Test Heuristics Cheat Sheet - Data Type Attacks & Web Tests

This document is always useful. It shows techniques and specific checks you can perform while testing certain variable types, systems and data sets.

Even though with time you always kind of know where to find errors, mistakes, bugs and security holes in software and computer systems, there might always be certain things that you just don't have as fresh as you once did. That is why reviewing past experiences and documentation is always crucial to accomplish the best you can do.

You can find the document shared here: Google Docs Shared PDF - Test Heuristics Cheat Sheet

The document was originally created by Elizabeth Hendrickson with some others, her blog: http://testobsessed.com/.

QA Automation Testing Introduction

This blog aims to share information and knowledge about QA, Testing, and Testing Automation.

Even though there are lots of blogs, books, websites and available information on the subject out there, my goal is to keep this content clear, specific and summarized, in the hopes of be a reference in the future for certain cases, for myself and others.

Testing is always needed to ensure that what we are creating or developing works as it should, from a functional perspective (if we are using verification (did we build the product right?) and also, very often, if it is what the end-user, customer or client really required and needed (validation (did we build the right product?)), and with the desired quality.

Testing Automation, also referred just as "automation", is the application of automation processes to perform testing. In Testing, we find that certain tests need to be repeated often and might be simple and/or time consuming. If, for example, you ever worked in a project and needed to perform testing and QA, you know how automation would be useful when performing a regression. This is more notorious on environments and projects where you have new versions and sub-versions of the software often, such as in projects using agile methodologies.