title: measure pact test coverage of an API
body: <p>Given the importance of automated tests I am wondering if there are possibilities to measure the test coverage for Pact tests.</p>
  <p>Remember that for unit tests, most frameworks/IDEs provide means to check which parts of the code were executed and thus to check if at least every part of the code (say in a class) was executed by some test.</p>
  <p>Correspondingly, a Pact test (that intends to check the conformance of a provider or consumer to an API specification) gains credibility by testing <em>most</em> of the possible interactions.  If it does, then it can reduce the number of e2e tests by splitting their logic into a functional part, covered by unit and integration tests within one component, and pact tests that assert the conformity of both components to the agreed upon API. (See <a href="https://docs.pact.io/getting_started/what_is_pact_good_for/" rel="nofollow noreferrer">https://docs.pact.io/getting_started/what_is_pact_good_for/</a> for more details.)</p>
  <p>Given that it is possible to automatically discover the REST API of some web components via libraries like enunciate or swagger, I am wondering whether it is possible to compare their findings with the PACT test descriptions to see whether any important parameters or endpoints are missing in the latter.  (Also, I am not sure if it means doubling the efforts to provide enunciate annotations and a PACT contract, but it seemed to me that the enunciate annotations in Java are not that heavy, i.e. mostly identifying the REST endpoints by the REST annotations that are necessary for functionality anyway.)</p>
  <p>Please let me know if my question is too general for stackoverflow and I should rather ask it on more academic sites like stackexchange.</p>