Generated Test Files

Firstly, hi everyone!

Secondly, the problem.

I am aware that fsutil via cmd line can create file types of any particular size and format, but what I have been trying to source is test files that contain context as opposed to jibberish.

Idealistically, i would be able to access some open source test documents that are numbered 1MB, 5Mb, 10MB, etc and listed in varying formats. Otherwise to manually create these will be a bit of a pain if I am to make them precise for the proposed testing.

Any thoughts/feelings/suggestions greatly appreciated.

1 Like

Hi Dan!

You could try with https://www.gutenberg.org. I cannot access the site at the moment as the whole of Germany is blocked there now but they have public domain e-books of various sizes and if I remember correctly they offered at least 4 different formats including PDF and hmm, was it MOBI, but also plain text and HTML. Iโ€™m not sure how large you can go with the documents there but you can always concatenate some if you need.

Thanks for the prompt reply, I shall have a mooch over there today!

:metal:

1 Like

Bumping this thread because I have this issue recently. Iโ€™m testing that the system can accept file uploads up to a certain limit like 10MB so my approach was to do boundary testing. (9.9MB, 10MB 10.1MB, whatever that is in bytes)

That means I need to generate files of various formats like docx, pdf, png, but itโ€™s difficult to get it very exact to the bytes. I tried to do generate a file through Powershell then change the file extension. However, the system I am testing can read the MIME type and wonโ€™t accept a dummy file generated this way.

I did also look at the project gutenberg site posted by @maos, but I still need to scour different books to find the exact sizes I need which is time consuming.

Any help is appreciated.

2 Likes

My suggestion is to combine the different ideas:

  1. select a book from the Gutenberg project, which size of the plain text file is bigger than needed.
  2. copy the text in your favourite word processor.
  3. save the file in PDF format.
  4. If the size is too big, then delete some paragraphs. Go to the step 3.
  5. If the size is too small, then add some text. Go to step 3.
  6. If the size is right, then you have the right file.

Other ideas for text conversion like PDF to epub are mentioned in
https://kimgarst.com/format-ebook-for-publishing/

1 Like

You can always use real files as a starting point and โ€œwriteโ€ just the content of the real files into the beginning of each dummy file? Have to ask why 10MB? Also, is it a web based app?

Think on whatโ€™s the real cost to the business if it fails? Could you do this same valuable thing through another way, for example by unit/component testing?