Coffeehouse Post

Single Post Permalink

View Thread: Code Testing Using Contracts and Pex
  • User profile image

    My answer would be no. Pex and Contracts can both be applied to 3rd party/legacy code, but they really shine when used together:

        - Pex can explore any regardless whether it's 3rd party or legacy. You can use Pex to generate a regression suite for your legacy code (or use the highly experimental 'fix it' feature to infer missing preconditions).
        - Code Contracts can be defined 'out-of-band', i.e. in separate assemblies. So potentially, you could annotate 3rd party code with Contracts. This point is not so obvious though: how much effort are you willing to invest in 3rd party/legacy code?