Posts RSS Comments RSS Digg Technorati Blinklist Furl reddit 105 Posts and 7 Comments till now
This wordpress theme is downloaded from wordpress themes website.

Scripting & Automation

I’m creating a new category to share some notes on some things I’ve done in terms of scripting & automation.  I do not consider myself a “test monkey” or an “automation specialist” or in any way affiliated with QA (quality assurance).  However, maybe 10% of my work for my day job has involved things related to scripting, automation, or regressions.  In addition to that, I am always on the lookout for manual tasks that I can automate (or simplify) to save time in the long-run (both at work and outside of work).  In some cases, I even prefer to automate something that doesn’t necessarily save time, because it can be less error prone.

Things I might post about include: AutoIt (AutoHotKey), Linux scripts, Windows scripts, Python, regressions…  But as always, I am not very dedicated to blogging (mainly because it’s a distraction from actually doing the stuff I’d post about) (and btw I’ve also already started doing weekly status notes for my day job), so no promises about what I will end up posting 🙂

For my day job, I primarily use C++ for actual development, and a mix of other things for scripting such as (simnow’s custom scripting language, python, Linux shell, Windows shell, AutoHotKey).  For simnow, we have our own simple custom scripting language (automation commands), and can easily share these scripts with users.

We automate more complex behavior (eg control flow) usually with Python (our regressions also use Python and XML).  I also write a lot of python scripts to automate tedious tasks (or to make sure I don’t do a human error).

I use Linux one-liners a lot on Linux, and also on Windows (cygwin is popular, but I’ve been using gnuwin32).  One example is to grep any sort of text files (such as simnow log files).  An example of Linux one-liners is to search log files (for debugging our simulator) (you can do a lot with just grep and awk).

I also like AutoHotKey (or AutoIt) mainly for how it integrates easily with Windows, and I can easily mix it with Python scripts.

Here’s a quick example of an awesome AutoHotKey script I use every day at work.  The background is that our IT department provides us file servers (NSF for Linux, SAMBA for Windows) where you can see the same files on Windows and Linux, and some file shares can also be seen from a web address.  For development, I typically use a local Windows computer in my cube, and I connect via NX to a farm of Linux machines (and I can submit jobs to LSF).

Because I use both Windows and Linux heavily in this way, I wrote an AutoHotKey script that activates when I do (ctrl+win+alt+c).  The script does the following…  It copies the clipboard contents to a network file (visible on both Windows and Linux).  It runs a python script that converts the path between (Windows, Linux, web) – if it’s one of the convertible paths.  For example, if I copy the path "/foo/bar/mypath" from my NX session, then do (ctrl+win+alt+c), then ctrl+V paste I will paste “\\winfoo\bar\mypath”.

For work related scripts I normally use Python, but I’ve used C# and Java and Objective C in side projects just for the exposure (and for college projects, back in the day).

Another example is the Torque 3D project (City Hero Defense) I did that used TorqueScript – you could expose Torque engine functionality to TorqueScript.  This sort of reminded me of how simnow models are written in C++, but they can expose simple automation commands for scripting.

Trackback this post | Feed on Comments to this post

Leave a Reply