TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Test Data Generation with Prolog

12 pointsby gowanover 10 years ago

3 comments

brontyover 10 years ago
RUGE [1] is another open source PROLOG framework for functional and load testing. Brendon McCarthy originally developed it for testing financial applications at American Express.<p>Brendon presented it at the 2013 Workshop on Domain-Specific Languages for Financial Systems [2]. One observation made by the Haskellers was that PROLOG approaches such as these are attempting to solve a problem that has already been solved by QuickCheck [3].<p>[1] <a href="http://bmccarthy.bitbucket.org/ruge/faq.html" rel="nofollow">http:&#x2F;&#x2F;bmccarthy.bitbucket.org&#x2F;ruge&#x2F;faq.html</a> [2] <a href="http://dslfin.org/" rel="nofollow">http:&#x2F;&#x2F;dslfin.org&#x2F;</a> [3] <a href="https://en.wikipedia.org/wiki/QuickCheck" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;QuickCheck</a>
评论 #8778064 未加载
saosebastiaoover 10 years ago
Findall is just a cartesian product...something easily available in pretty much any language out there. Not that I think Prolog is a bad fit for test data generation, just that this example is entirely too simple to show its power.<p>Where Prolog becomes really powerful for this use case is modeling the underlying business rules and selectively creating test cases that acknowledge those rules. A tiny bit of familiarity with Prolog goes a long way here. I&#x27;ve modeled about 95% of the underlying logic of 50k SLOC Java business rule systems using less than a hundred lines of Prolog. And the ability to infer both forward and backwards is extremely powerful (ex. if you have created F(X,Y) = Z, then you implicitly have a rule for determining X given Y and Z).
评论 #8777549 未加载
gcb0over 10 years ago
so the trick is to use findall? and the problem is that nobody knows prolog?<p>why not then just implement findall for other languages? it&#x27;s like 2 or 3 loops anyway, if you don&#x27;t care about performance. which you don&#x27;t since this generates test data