Enterprise Test Automation: The Foundation
written by Andrew Shay on 2019-02-17
During my professional career as a Software Engineer I have worked in Enterprise Test Automation (ETA).
In my short time in ETA I have seen absolutely awful automation, and highly effective automation with a strong strategy.
In this article I will layout the foundation for strong ETA that will lead to success.
Audience for this article: Anyone who is new to Enterprise Test Automation or preparing to setup an automation team or plan. If you are experienced with ETA, then you won't get much from this.
Read Full Post
TDD vs BDD. Does TDD test implementation or behavior?
written by Andrew Shay on 2019-01-09
About a year ago I wanted to learn more about good testing habits and specifically Test Driven Development (TDD) because I had heard about it so much. While reading about these topics I came across Behavior Driven Development (BDD). I came to the conclusion that there is confusion around TDD and especially when compared to BDD, however TDD is simple and a highly effective development strategy when understood correctly.
Read Full Post
Quickly setup a minimal Python CI system using Jenkins and GitHub
written by Andrew Shay on 2018-09-27
This article discusses how to quickly and easily setup a Python CI system using GitHub and Jenkins.
This is useful for anyone who does not have a dedicated CI tool (Travis CI, TeamCity etc.) and just want to get something up and running with minimal effort.
When a GitHub Pull Request is "Opened", "Reopened", or a commit is made, a webhook will be sent to the Jenkins job. The Jenkins job will create a virtual environment, install several tools for running tests and linters, then run those tools against the code base. The output of the tools will be gathered and posted as a comment to the Pull Request via the GitHub API.
This was created to offer Python projects a simple and easy CI system without having to install and maintain dedicated CI software.
Requirements: Jenkins with Python 3.6, GitHub
Read Full Post
Simple Strap - New theme for lektor
written by Andrew Shay on 2018-09-19
How to create a gauge / speedometer graphic with Python
written by Andrew Shay on 2018-06-30
This article discusses how to easily create a speedometer / gauge image in Python with only the Pillow library.
View source code and images on GitHub: python-gauge
The gauge graphic is separated into two images. The first image is the needle that points to a number on the gauge. The second image is the gauge without the needle. The final gauge image is generated by rotating the needle image then pasting it on the gauge.
The script is simple. The gauge is half a circle therefore the needle needs to rotate between 0 and 180 degrees. The gauge goes from 0 to 100. So if you want the gauge to point to 20, the script just takes 20% of 180 degrees to rotate the needle.
""" Copyright (C) 2018 FireEye, Inc., created by Andrew Shay. All Rights Reserved. """ import PIL from PIL import Image percent = 20 # Percent for gauge output_file_name = 'new_gauge.png' # X and Y coordinates of the center bottom of the needle starting from the top left corner # of the image x = 825 y = 825 loc = (x, y) percent = percent / 100 rotation = 180 * percent # 180 degrees because the gauge is half a circle rotation = 90 - rotation # Factor in the needle graphic pointing to 50 (90 degrees) dial = Image.open('needle.png') dial = dial.rotate(rotation, resample=PIL.Image.BICUBIC, center=loc) # Rotate needle gauge = Image.open('gauge.png') gauge.paste(dial, mask=dial) # Paste needle onto gauge gauge.save(output_file_name)
To modify the gauge image, modify
gauge.png should be the gauge without the needle (hide the needle layer).
needle.png should only be the needle on a transparent background and should point at 50 (hide all layers except needle).