I am working on a Scala project and I want to include some sample data somewhere in the project. Specifically, my Scala project includes code that performs various natural language processing tasks on text data. I want to include a sample set of text files that the user can use to test out the program somewhere in the project structure. Right now I am putting this sample data in the resources folder (mostly because it is the only location within the project that I know how to read from). But I was wondering if this is the best location? In general what is the best practice regarding where to put sample data within the project? Alternatively, would it be a better idea to simply provide this data separately (i.e external to the project)?
1 Answer
The data should be provided in the project, but outside the library/binary.
That is the data should be provided as part of the source archive the user downloads (unless very large; large data should be provided separately), but they should take no part in the build process. So they'd go in sample or something and the user will load that data just the way they would load their own data placed anywhere on disk (following instructions in appropriate quick start document).
Additionally you could provide an automated integration test that would load those data and exercise main functions of the program. These would start the application similarly to how the user would, load the sample data and check the behaviour, still using only the end-user interface. Easiest done with shell if you have command-line interface, but there are tools for testing a GUI too.
-
So are you saying
sampleshould go inside thesrcfolder or at the same level?user1893354– user18933542014-09-01 17:39:55 +00:00Commented Sep 1, 2014 at 17:39 -
1@user1893354: At the same level as
src. It is not a source.Jan Hudec– Jan Hudec2014-09-01 18:23:08 +00:00Commented Sep 1, 2014 at 18:23