I'm looking for a programming language to recommend to a friend considering teaching herself software testing. I have a friend who is interested in learning software testing, and I believe strongly that today's testers absolutely have to have automation skills if they don't want to hit a glass ceiling after a few years (or become super-star exploratory testers . . . but not everyone wants the stress of having to be a super-star).

I can't look to my own experiences, because I did a 4-year CSE degree that was geared toward developers, and my education isn't light-weight enough. I want something relatively easy to learn that will give the tester the greatest bang for their buck in developing good, maintainable automation.

I know Ruby is used for a couple of test tools - Watir and Cucumber - and something that works with Selenium, WatiN, or Watir would be good. The two favorite languages locally for developers seem to be Java and C#, and she will be working locally. Whatever she learns needs to have good resources for novices at programming to self-teach, whether those be books, online tutorials, or online communities. Something that isn't too expensive to learn would probably be preferred ('free IDEs are available and there are good free tutorials and information to learn from' is ideal). Also, something that is harder to write bad code in would be good, since I want her to be able to avoid brittle, unmaintainable tests. She is highly motivated to learn, so a very useful language that will take 6 months of hard work to get a usable level of skill is preferable to a slightly useful language that she could use in a single month. At the same time, any time she spends learning to program is time she could be spending practicing exploratory testing or learning other great test skills - so ease of learning does matter.

Also - I do realize that programming is one very small piece of being a good tester. I just have a better handle on self-teaching the rest of the testing skills, since I self-taught myself those areas and can pass on what worked for me or what I wish I'd known. I don't want anyone to think I believe you can learn to be a good tester by just learning to program; rather, I just don't have a good handle on the easiest way to start programming as a tester since I started testing as a programmer.

Thanks for the answers so far! I'm leaning towards a combination of Java and Python right now. Java will prepare her well to work with both Java and C#, which are the languages most developers here will be using, and Python sounds like a good 'utility' language with a number of testing tools. I'll start hunting around for some good tutorials :)
–
Ethel EvansAug 23 '11 at 18:14

14 Answers
14

I kind of have the opposite experience: I learned some coding first then became a tester. My advice is that any programming/coding experience is beneficial for testing. Any way you can better understand what the application is doing in front of you, the better you can test it. Plus, specific tools and languages come and go in use and popularity: learning the fundamentals will age quite well in the long run.

Programming languages comes in all shapes and sizes, but have some main things in common (usually) so seeing more is good. Plus if she's willing to learn, then larger ideas such as Object Oriented Programming, web and command scripting, programming style and code reuse will be helpful overall. Definitely look at scripting languages like Python or Perl: they can be indispensable for daily testing tasks.

As for specific suggestions, Python is a good language to start with. It's easily available and platform independent, which is great in the long run. It also has some mature testing tools (nose, unittest) and a large range of other libraries and tools (BeautifulSoup for HTML processing, Selenium tools). It also has a good community for help, and straightforward syntax. I've also heard good things about Ruby for similar reasons, and maybe the testing tools (Watir in particular) are more mature. I've recently learned a small bit of C#, and it's good as well.

I agree that any programming language experience would be beneficial. I also agree that Python might be a good place to start. I have a Python expert on my team, and he is able to use it in a wide variety of test contexts.
–
Joe StrazzereAug 23 '11 at 14:48

2

Python entered my head w/ Ruby, and it looks like it works w/ Selenium (both RC and IDE). I'm definitely biased towards a language that can be used to teach OOP. I'll have to look into its testing tools. Thanks, this looks promising.
–
Ethel EvansAug 23 '11 at 18:05

"I'm definitely biased towards a language that can be used to teach OOP." Why?
–
Joe StrazzereAug 24 '11 at 11:41

1

Hi Joe, a couple of reasons. Because understanding OOP makes understanding developer code easier, and that opens up possibilities for white-box testing and enhances debugging abilities. Because writing maintainable automated tests is often made easier if the tester understands even basic OOP (e.g., Page Objects for UI testing). And there's probably an unreasoning bias mixed in from my own dev-heavy background :p
–
Ethel EvansAug 24 '11 at 17:27

I don't think any specific language is better or worse than any other, although I will say (from experience) that going from Java or any other "pointerless" language to one that does have pointers is not a pleasant experience.

Apart from that - the important parts of automation and coding are recognizing the problem that the code needs to solve, and being able to express the solution in a way that can be handled with a logical series of steps.

Object-oriented and data-driven are nice ways to handle the data that drives the steps, but the core is finding the bits the automation has to interact with, and the logic processing.

My recommendation here would be to pick something that's got a lot of support and wide application, make sure the logical structures are learned (if-else, case statements, the various looping types and so forth), and it won't matter past what's currently most practiced what the language is.

I learned programming this way, and I've never had much difficulty picking up new languages (I first learned Java, then Javascript with HTML, various other scripting languages, VBScript with ASP.NET, and I'm currently working with a script flavor of Delphi)

Definitely a good tip on languages with/without pointers. Of course, going the other way (C++ to C# for example) is awesome!
–
joshin4coloursAug 23 '11 at 19:21

joshin4colours - yes! Starting with Java and then trying to work in C++ was not a pleasant experience. If I had to do that professionally, I'd have to sit down and learn pointers and how they work.
–
Kate PaulkAug 24 '11 at 15:18

I would recommend a slightly different approach. Rather than initially focusing on a particular language, I would recommend focusing on programming concepts.

Some good books include Programming Langugae Concepts by Carlo Ghezzi, or Prelude to Programming: Concepts and Design by Elizabeth Drake. (Another great book is Programming in the Key of C Sharp by Charles Petzold. It uses C# to teach programming concepts.)

If someone learns the semantics of basic operations, and the basics of data types, control structures, program design, and data structures then learning a particular language is reduced to learning the syntax for that language.

You don't learn to think or rationalize ideas by simply learning how to repeat words in another language.

There's a good argument for trying to use whatever language the devs are using, so to that end I'd suggest C#.

I don't think that I really subscribe to the idea that you should start out with a 'gateway' language and work your way up - at the beginning learning programming you can tend to be very hung up on the syntax, rather than concepts, so trying to learn more than one language is a complication.

C# has the free express visual studio IDEs, which are going to be packed with auto-completion and help files. I think there is some decent context for automated testing in C# from some of the microsoft testing blogs also.

This language is not too complicated for beginners to start writing some very basic code. From the other hand it is a powerfull language that is used not only for client side but also for server side development. This language has a hidden potential and the popularity of its still growing, see http://langpop.com/

Also person knowing JavaScript can learn Java or C# , but in this case good understanding of OOO concept will be required

As a language it is used in different automation tools, like Selenium and there are a tone of tutorials (just google for 'JavaScript tutorial' and select what you want)

Get the OOPS concept first, Start with Java Script, VB Script. Before that it is good to know HTML, CSS styles. Once you are expert on these then go to Ruby Scripts, C#, later on to PERL scripts if you want to learn Security testing.

The language's utility depends upon the type of automation. For driving applications from the outside, or for interacting with a command line interface, a scripting language like Bash or PERL is hard to beat. For interacting with an API, the API's own language is never a bad choice, especially if one has well-documented examples to learn from. (I personally think Clojure is a better language than Java for testing a Java API, but I am not sure I would recommend this to a beginner.) For testing web interfaces, JavaScript might the right language, or it might be a "bigger" language environment like Java or C#, assuming there are well-documented examples (or willing teachers) to learn from.

Thanks, the point about interacting w/ APIs is a good point. That hints strongly at Java or C#, then, since those languages are heavily used around here (and moving from Java to C# is really pretty easy, IME). Java plus some scripting in Python or Perl might be a pretty potent combination.
–
Ethel EvansAug 23 '11 at 18:08

I would recommend 3 that iconic of how bugs are created:
C# - this will show a modern object oriented approach, hard to have bugs that are pure typos.
Objective C, managing resources and the unique C syntax, so easy to mess up and wonderful bugs are easily created
JavaScript - this or some variant of will be useful in automated testing tools as well has understanding loosely typed languages.

Overall I think it helpful to have some knowledge of the language you AUT is written in.

I would recommend starting with a scripting language. It could be Perl, Python, Ruby. It’s easy to start with this languages and they allows to easily solve many standard problems, like HTML report generation, sending emails, generate test data etc. Those languages could be used with Selenium RC to create the automated Web tests. First of all, a beginner need to understand what he can do with programming language. The dynamic languages shows a lot of advantages for daily work.

Only than I would recommend to start with strongly typed languages, like C# or Java. There are a lot of important details in that languages that makes it hard to understand.

(note: this comment is from @mohammed-sameeh - it was added as an answer because a new user doesn't have enough points to comment yet. I think it's a good question, I wondered that too!) "dmitry Zhariy why Windows Batch Files scripting is important for tester"
–
testerab♦Feb 29 '12 at 20:14

1

The Windows Batch scripting saves a lot of time. I am installing my application under test using the msiexec, copying the predefined config files automatically after the installation, downloading the recent builds from the overseas servers, backuping and restoring the oracle DB in one click. Why should I do all this routine operations manually? I am automating them with batch files and command line tools. Instead of Batch files you also can use Powershell, JScript etc. but I prefer to automate my tasks using batch.And it saves my working hours each day.
–
Dmytro ZhariiMar 13 '12 at 16:03

If you want your friend to start one option is the Head First Programming book, it uses Python to teach programming and some design. I did it a little while ago to sort of strengthen some basics I wanted to have in programming, although considering I had been doing it in a testing capacity on my own for awhile I got a few good things from it. For someone who has not programmed it looked to me like a good introduction.

I am fairly new in Software Testing and been trying to self study automated testing too. I've been using this free software testing course at Udacity.com. It has notes and forums which are really helpful as well. It uses Python. Hope this helps!

I started to make use of a tool called "Autoit" for my automation.
it is a slight deviation of VB and the user codes in SCITE. That being said, 100% opensource.

The major benefit is the community/Forum. Whenever a question is asked there, no answers are given unless the user actually pasted a piece of the code that they have struggled with, thus forcing the user to learn. It's also VERY WELL documented so the need to ask questions is kept down to a minimum if you are prepared to do some research first.

If I have not said this before, If you can click on it or use you keyboard, the Autoit can automate it!..

I currently use it to run a series of tests on each deployment we have, If something fails, then the deployment stops and All devs are notified. (we run nightly deployments..)

Ill gladly supply more information and assistance if needed and deem this the best to give access to both worlds, (programming and Testing)