plinth coverage
What are ways to automatically examine software source code to answer statements about the code? For example the question that I have is “given a Haskell module how can I have confidence that all the types the module exports have test value generators using `Arbitrary` module from `QuickCheck` haskell package?
In the previous post I’ve talked about about a context building exercise to find clues to certain properties of source code of a Haskell package. Through the rite of worshipping the great LLM, I received a shell script that generates a json file, which is then parsed into a list of function calls, each of which attempts to locate an Arbitrary instance when called with the list of Types the package exports. Another part of the response:
you can write a test that checks if all exported types have an `Arbitrary` instance.
That’s encouraging!
That gave me an idea of what AI actually is:
But let’s be reasonable, many bright people thought about it before and we just find the right words we’d be able to move on with this problem further than any magic could get us!
hpc
is a package provides the code coverage library for Haskell; in our context we can run it like so:
cabal test --enable-coverage
hlint
Oh! this looks neat for sure but will it work?
What’s Next?
Stay tuned for the next installment of this hacking adventure!