views:

209

answers:

2

I have a collection of about 10,000 small VBScript programs (50-100 lines each) and a small collection of larger ones, and I'm looking for a way to convert them to C# without resorting to by-hand transliteration. The programs are automated test cases for a web application, written for HP/Mercury's QuickTest Pro, and I'm trying to turn them into test cases for Selenium. Luckily, the tests appear to be well-written, using a library of building blocks and idioms (the larger programs), so the test cases actually resemble a domain-specific language more than they do VBScript, and the QTP-ness is well-buried inside the libraries.

Ideally, what I'm searching for is a tool that can do the syntactic transformation from VBScript to C# for both the dsl-ish test cases and also the more complicated building-block libraries. That would leave me with a manual cleanup of the libraries, and probably very little work on the test cases. If I could find a VBScript-to-VB.NET translator, I'd take that also, as I suspect I could compile the VB.NET and then de-compile to C# using .NET Relector or something similar. Plan B is to write a translator of my own for the test cases, since they're in a very straight-line style, but it wouldn't help with the libraries.

Any suyggestions? I haven't written a compiler in at least 15 years, and while I haven't forgotten how, I'm not looking forward to it - least of all for VBScript!

A: 

GreatMigrations has a tool that does a good job converting VB6 to C# (and other languages). I know the company is willing to work with organizations to tailor the product to their specific needs.

Robaticus
+1  A: 

Most vbscript is valid VB6 code, so one option would be to just rename them from .vbs to whatever it was VB6 used and then add them all to a VB6 project and see if the VB6 - VB.Net upgrade wizard that comes with some versions of Visual Studio can help you out.

ho1
This is a good idea
Thomas