问题
I am working on porting a library over from C++ to Java. I want to know the first / initial steps to begin this port. I am not sure how will I test / debug? I could just start with the "main" file and begin rewriting code, but how and when do I test what I am doing? When I am done the COMPLETE port? How do I start about this, any help would be great.
Any cross platform / etc compiler would help? let me know the steps please
回答1:
You can wrap the old library in JNI and call it from your unit test to ensure the ported code does exactly the same thing as the old code.
回答2:
You can port piece-by-piece, bottom-up, and test each piece individually with junit or testng.
来源:https://stackoverflow.com/questions/6748778/how-to-port-c-code-into-java-starting-instructions