
On 10/30/07, Duncan Coutts
On Fri, 2007-10-26 at 10:48 +0000, Duncan Coutts wrote:
So what's next...
We want to write some specifications
Spencer, Lennart, Thomas and I had a joint hacking session in which we made some progress on this issue today. Specifically we can now generate random dep graphs for use in QuickCheck tests. For example:
Very nice :)
We can tune the size and 'density' of these graphs. As you can see we get cycles in the graphs. We'll have to filter out cycles. Any suggestions on a simple way to do that? It's ok to depend on Data.Graph for this kind of test code.
I noticed that. You could do a DFS and prune the back edges.
So the first testing strategy we're going for is to generate random dep graphs.
I'm thinking it may be possible to make a finite base set of test cases that represent of all possibilities, but I'm not sure about that.
From there we will write out a suitable selection of the files and run the make algorithm. We then inspect the resulting event trace and final state to check that everything worked correctly. So we'll be making the dependency generator from this random dep graph too.
So this is for testing make in isolation. For the next bit of testing our rule sets for building Haskell projects we'll have to generate dep graphs that use files mentioned in our rule sets. That's probably a bit harder.
I have an good idea about what's necessary here. Ideally, GHC would could give us a list of imports for a given sourcefile. (That way we don't have to do ad-hoc parsing.) The same thing goes for C2HS. I guess actually you might not be thinking that far ahead yet :) If you have anything specific in mind I can work on, feel free to let me know. Pete