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.

Ask HN: How to generate random test data (valid and noise too)?

5 pointsby azatomover 2 years ago
I need random data in block of 700 bytes, what is full with valid common binary&#x2F;plaintext data structures with common data. Sometimes included with common errors making them invalid. In a range from simple bit patterns (eg.: 0x55aa) to just uncompressible noise.<p>(So.. just everything, I hope it is not too much to ask:)<p>What won&#x27;t work:<p>- &#x2F;dev&#x2F;urandom: it is just not random.. always noisy :)<p>- A corpus like dumped wikipedia: even if with added some random biterror, it is just too specific, besides impractically big.<p>- markovchain of &#x2F;dev&#x2F;sda of freshly installed system: still not enough real world data&#x2F;errors.<p>- markovchain of my &#x2F;dev&#x2F;sda: although it contains enough real data and errors :) there is sensitive data<p>- I collect painstakingly common patterns: the whole point is finding something what I don&#x27;t expect<p>As always, there has to be existing solution, I just can&#x27;t find it.

1 comment

qsortover 2 years ago
It might be that I don&#x27;t understand your problem and if so I apologize, but from what I gather this is a classic XY problem.<p>Use property-based tests instead. Like quickcheck&#x2F;jqwik&#x2F;hypothesis.
评论 #34833673 未加载