vincent15000's avatar

2 different codes with the same functionalities => how to test them ?

Hello,

I have an old code and a new code, with new functions but exactly the same functionalities.

To test if the new code gives the same results than the old code, is there a specific way to write the tests ? Or do I just have to write the tests twice (once for the old cold and once for the new code) ?

Thanks for your advice.

V

0 likes
2 replies
hondnl's avatar
hondnl
Best Answer
Level 5

SInce you want to test if the output is exactly the same , I would first write tests for the old code. Then copy those tests to your new (code) project adapt the tests , but make sure the output tested is exactly the same.

Now you will know if old project results will also be returned for the new project.

1 like
vincent15000's avatar

@hondnl Ok thank you ;). This was effectively my first idea, I wondered if there was another better way.

Please or to participate in this conversation.