Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I had legacy code that was originally build for some quite old version of compiler. We are talking about native code, not managed. Now it is ported to almost newest version of the compiler. Every compile error was fixed and now the product is properly compiling and running.

But:

  • although it compiles and even runs... how can I be sure is is working as expected?
  • can I be sure that underlying runtime does not change in a way that it introduces new and unexpected runtime bugs?
  • what are best practices when upgrading to newer version of the compiler?
share|improve this question

closed as too broad by gnat, MichaelT, World Engineer Mar 17 at 14:15

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

4  
Testing, testing, testing. –  delnan Mar 19 '13 at 15:16

1 Answer 1

up vote 9 down vote accepted

although it compiles and even runs... how can I be sure is is working as expected?

The same way that you made sure the original code was working as expected. By extensively testing it.

can I be sure that underlying runtime does not change in a way that it introduces new and unexpected runtime bugs?

You can never be 100% sure of that, but if it is a well-established compiler, you can be sure that both the compiler and the runtime environment have been extensively tested prior to their release.
This does not mean you are free of potential problems. It is still possible that you originally (unintentionally) depended on some undocumented/undefined behaviour that has been changed in the new release. You can only find that out by extensively testing your product.

what are best practices when upgrading to newer version of the compiler?

You should treat it as a major systems change, similar to porting the application to a completely new platform.

share|improve this answer
    
hmmm... right! otherwise you need some 'formal' mathematical method to prove that new compiler does the same thing as previous one for the code. Testing is better way. Thanks for the valuable comment –  fen Mar 19 '13 at 15:50
    
If you are willing to pay the price, there are compilers for which such proofs are available. –  Jörg W Mittag Mar 19 '13 at 21:51

Not the answer you're looking for? Browse other questions tagged or ask your own question.