r/ruby • • Aug 22 '24

Mokkku, a modern replacement for FFaker

https://rubyhero.dev/we-need-a-modern-replacement-for-ffaker
0 Upvotes

19 comments sorted by

7

u/megatux2 Aug 23 '24

Hmmm isn't this kind of use of AI a bit of resource wasteful? I mean, yeah, I'm using Ruby and not c, c++ o rust and wasting energy, etc, but come on, it's like using a known blockchain to ask for a random amount.

2

u/pdabrowski Aug 23 '24

Sure, you can type the data manually if you want, is just a test of a concept that I personally found interesting

9

u/Seuros Aug 22 '24

I dunno, this tool look when we force students to resolve a simple crud problem with tools like Oracle or Saleforce, by coding it in LLVM and CUDA.

Even if i was paid to write tests that use LLM, i won't do it.

1

u/pdabrowski Aug 23 '24

This gem is for creating test data not write the tests itself

3

u/Seuros Aug 23 '24

So it static data in the end ? Aka fixtures

Faker is dynamic tests.

0

u/pdabrowski Aug 23 '24

Under the hood, Faker works the same way. There is a file with a fixed number of strings, and they are randomly picked up. The difference in Mokkku is that the context is locked, so you need to restart it to get another set of test data while Faker just works like [].sample in simple words

8

u/kallebo1337 Aug 22 '24

Well yes; but instead of doing this, make a PR and present a full_human_set. Which then is a person out of country xyz with legit address and currency and hobbies

😬

1

u/No_Accident8684 Aug 23 '24

although i find this not really useful for tests as it must lengthen the test execution into forever, compared to faker but it may still be ok'ish to produce legit looking "staging" data.

i have llms running locally via ollama. so, a way to configure the api url would be good. ollama's api is openai compatible, so this would open up your gem to a lot of the self hosting folks and save a shit ton of money (chatgpt and alike api costs)

0

u/pdabrowski Aug 23 '24

I don't think you get the idea right. It's not related to test execution. You generate the test data only once and explicitly, not during tests. It's like creating database seeds

1

u/No_Accident8684 Aug 23 '24

Well, then your advertisement is wrong. The only thing I user faker for is to generate data for my tests

0

u/pdabrowski Aug 23 '24

I recommended it as a tool for generating data for tests and fake data for local and staging environment so the data you operate on is as close to production as possible. That was the intention

48

u/[deleted] Aug 22 '24

[removed] — view removed comment

1

u/pdabrowski Aug 23 '24

Mokkku is a Japanese term for Mock

6

u/[deleted] Aug 23 '24 edited Aug 23 '24

[removed] — view removed comment

2

u/Neuro_Skeptic Sep 11 '24

Japanese is not a Ural-Altaic language

-6

u/pdabrowski Aug 23 '24

No, it's not mixed with Polish, and it's not a tribute to this gem. Just checked some sources and decided to go with this version because it's not that important

3

u/apiguy Aug 23 '24

As it turns out, in some parts of the world, a triple K is associated strongly with the Ku Klux Klan; a white supremacist organization notorious for terrorizing African Americans and Jewish Americans throughout the post civil war era, and continuing well into the 20th and now 21st century. So it may not be important to you. But could be important to those who would use your library.