hackerexperience / burette Goto Github PK
View Code? Open in Web Editor NEWLibrary to efficiently generate random data for testing
License: Apache License 2.0
Library to efficiently generate random data for testing
License: Apache License 2.0
Should generate file_names
and file_paths
(maybe with a option to chose either Names With Mixed Casing, Spaces and operators
, lowercase_names_with_underscore
or both)
file_paths
additionaly might receive an option windows
or unix
to define the path style
Eg: instead of
iex> Burette.Calendar.future
%DateTime{year: 2017}
iex> Burette.Calendar.future year: 2050
%DateTime{year: 2050}
do
iex> Burette.Calendar.future
%DateTime{year: 2017}
iex> Burette.Calendar.future year: 1..10
%DateTime{year: 2022}
As most tests that use relative past/future use so to check that the input date is inside a certain range, eg:
test "only adults can create accounts" do
young_birth_date = DateTime.to_date(Burette.Calendar.past(year: 12..17))
adult_birth_date = DateTime.to_date(Burette.Calendar.past(year: 18..32))
refute Account.old_enough?(young_birth_date)
assert Account.old_enough?(adult_birth_date)
end
I've had some (albeit rare) collisions. As a test, i tried to run the username generator a few times like this:
Enum.reduce(1..1_000, MapSet.new(), fn _, acc ->
MapSet.put(acc, Burette.Internet.username())
end)
I explicitly used a relatively small set (because most of the times test suites will not add over a thousand of test users; will they ?) and the results were actually pretty bad...
results = Enum.map(1..500, fn _ ->
xs = Enum.reduce(1..1_000, MapSet.new(), fn _, acc ->
MapSet.put(acc, Burette.Internet.username())
end)
MapSet.size(xs)
end)
IO.puts "Median: #{Math.median(results)}"
Median: 980.0
If we increase the input amount from 1_000 to 2_500, it get worse
Median: 2388.0
This can only means one thing, Burette.Internet
needs more username patterns and username words to reduce collision chance
Lexicon
is useful to build dictionaries of possibilities and someone could find use for it on a prod environment (without needing the compile time overhead of the full Burette package), for this reason it makes sense to make the lexicon an independent repository/library/package
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.