https://kotlinlang.org logo
#feed
Title
# feed
k

Kyle Roe

12/21/2021, 8:30 AM
Hey everyone 👋 While working at different places on different projects its always been interesting how developers choose to go about creating models for unit tests. I’ve seen some projects redundantly create new models for each and every test, and some projects create factories, with static models that they then use everywhere. Long story short, at work we wanted to clean up some of these tests so two of us started working on a library that would automat this for us and generate random models with actual data. The fruits of our labor can be found below 🤓 We have been using it in production for about 6 months now 🚀 We would be eternally grateful for any feedback you might have 🙏 and to see wether it potentially fits your use cases as well. Please take a look, try it out and let us know what you think 🙌 Collaboration welcome 👩‍💻 👨‍💻 https://github.com/HelloCuriosity/model-forge
👌 1
j

Joakim Forslund

12/21/2021, 9:41 AM
Cool concept, something that is not very clear while reading the documentation is what/if any default values are generated and how they behave for each different type.
k

Kyle Roe

12/21/2021, 11:34 AM
@Joakim Forslund Thanks for the feedback and that is very true. Feel free to create an issue 🙌 alternatively I can add it too, but I’m a firm advocate of giving credit where its due, so I wouldn’t like to claim your feedback as my own 😅
j

Joakim Forslund

12/21/2021, 1:04 PM
k

Kyle Roe

12/21/2021, 1:09 PM
Thanks 🙌
d

dave08

12/21/2021, 2:28 PM
Did you have a look at KotlinFixture?
Yours is much simpler for basic needs though... sometimes over-complex frameworks are overkill.
k

Kyle Roe

12/21/2021, 4:20 PM
I didn’t know about KotlinFixtures 😅 but I will take a look at it 🙌
m

Matteo Mirk

12/22/2021, 10:52 AM
very nice!
🙌 1
3 Views