1084

Generating fake data for testing

Comments for “Generating fake data for testing”
 

Posted by Dom on Friday 19th January 2024 at 13:02 GMT

I was wondering if any Trongate users here, better acquainted with it than I am, have any suggestions for generating test data to go along with your modules.

I'm aware of FakerPhp and one or two other tools. I use Bogus extensively when working in .net.

As I'm still very much feeling my way around the Trongate framework I'm curious as to how people have tackled this particular requirement.
Level One Member

Dom

User Level: Level One Member

Date Joined: 12/01/2024

Posted by Dom on Wednesday 24th January 2024 at 08:51 GMT

Thank you for the suggestion.

I'd considered that but it lacks the convenience that fakers can bring once one accepts that they need to be configured.

I've been looking at the feasibility of creating a module to provide the functionality to do this. It would require third party dependencies but given that it would be a development rather than production tool I don't see that as being an issue. It would be possible to automate reading the database structure and table structure and I daresay it would also be possible to automate creating basic faker classes to populate each table which would just leave one to fine tune afterwards. Whilst I know exactly where I'd start in .Net using C# I'm nowhere near as competent of fluent with php so I've a lot to figure out first.
Level One Member

Dom

User Level: Level One Member

Date Joined: 12/01/2024

Posted by DaFa on Wednesday 24th January 2024 at 09:05 GMT

Sounds good Dom, looking forward to seeing that module on the module market
Founding Member

DaFa

User Level: Founding Member

Date Joined: 30/11/2018

Posted by Dom on Thursday 25th January 2024 at 09:24 GMT

After a bit of faffing around and a lot of consulting the 'api' documentation that I knocked up for the framework itself I realised that the engine had a specific hook that would make the first part of this relatively easy.
I'm currently being hampered by my own lack of real css knowledge but no doubt Dr Google will come to the rescue and that will be overcome and we can crack on with the interesting part, actually generating the data.
If I make sufficient progress with this I'll put an alpha version up on github to let those who'd like to play with it do so and hopefully as a result derive some feedback to refine it further.
It's a tool that will always require a degree of input, the question is really a matter of how much.
Level One Member

Dom

User Level: Level One Member

Date Joined: 12/01/2024

Posted by djnordeen on Thursday 25th January 2024 at 11:57 GMT

Thanks Dom
Early Adopter

djnordeen

User Level: Early Adopter

Date Joined: 20/08/2021

Posted by Dom on Thursday 25th January 2024 at 13:23 GMT

Published github repo. it can be found here;

https://github.com/domsinclair/data_creator

NB This is strictly Alpha in it's current guise.
Level One Member

Dom

User Level: Level One Member

Date Joined: 12/01/2024

×