jfs
jfs

Reputation: 16768

Language Conversion Testing

We created a tool which converts a language called P2, a language similar to assembly which I think exists only in Japan, to C#. There are at least a hundred modules written in P2 and we want to verify if the conversion to C# is right? How can we test this?

Upvotes: -1

Views: 165

Answers (2)

Marcus Downing
Marcus Downing

Reputation: 10141

Short of a formal mathematical proof (which I imagine would be difficult), the proof of the pudding is in the unit tests. You have to find a way to wrap the converted C# snippets, compile the and run them under a similar environment, then compare the output against the original. Unless you're rigorous in your testing, there's no way you can be confident of the result.

Upvotes: 1

Jon Limjap
Jon Limjap

Reputation: 95432

You don't test the converter, you test the final code.

If the code doesn't compile, clearly your converter is failing. If the code compiles and your functionality tests fail, then you can tweak the code so that it passes the test. If you are fairly successful you should see that you only need to fix the modules that actually fail.

Goodluck!

Upvotes: 2

Related Questions