-16

With How to create a MCVE we have a great help page for (new) users concerning how to produce a MCVE. However, the word "data" does not occur a single time.

enter image description here

Perhaps it is intended to keep it very general and it might be not that crucial in main programming languages, but at least in R I find it quite essential to provide a minimal toy data set with which the problem can be reproduced.

Maybe it's too obvious for experienced community users that a MCVE automatically should include data and, thus, this was overlooked so far?

R Example

I'm thinking especially of new R users who usually post some code that we hardly can use without data. Usually the community then reacts with "please add data" whereafter the OP e.g. provides data that is not a pleasure to copy-paste like this:

            Var1   Var2                Var3
1  North America   male 1970-01-01 01:00:01
2  Latin America   male 1970-01-01 01:00:01
3  South America   male 1970-01-01 01:00:01
4  North America female 1970-01-01 01:00:01
5  Latin America female 1970-01-01 01:00:01
6  South America female 1970-01-01 01:00:01

Furthermore, we do not yet know anything about the structure of the data, if e.g. Var2 is of class "character" or class "factor".

Often we can then also read "please add dput(yourData)", which is better but fails if OP has huge data, also dput(head(yourData)) will fail if there e.g. are large groups. Besides, this method just misses the philosophy of an MCVE.

All in all, it's often a tedious debate until OP knows how to do it right and I have already skipped one or two such deficient questions.

Right now, I tend to send them both links, the MCVE and the How to make a great R reproducible example link. They are probably overwhelmed by two pages rich in content then.

Recommendation:

The providing of sample data, and also the best way to do so, should therefore be explicitly addressed on MCVE help page.

Option a) Maybe we could just insert a section like this:

Please also provide a minimal data set that others can use to reproduce your issue, see:

or Option b), a little more succinct:

See tutorials for your language: R, SQL, ...

I would be happy if I could send them just a few words and the MCVE link, which explains the topic completely and compactly.

Please note that I criticize the complete absence of an explicit reference to MCVE-data. The tutorial links are only meant as a possible solution. If you agree with the proposal but only disagree about the content or length, show your preferred content

20
  • @yivi That's a point, but in view of the relevance we might do this quite succinct, see update with more compact proposal
    – jay.sf
    Commented Jun 23, 2019 at 10:42
  • 6
    Provide all parts someone else needs to reproduce your problem in the question itself - if data is required to repro the problem, it falls under the "complete" part. If the MCVE page were to cover every single aspect that could potentially be used to create a MCVE, the page would be unnecessarily massive Commented Jun 23, 2019 at 10:59
  • 2
    @Zoe As I have written "Maybe it's too obvious for experienced community users that a MCVE automatically should include data". My experiences show that inexperienced users might not conclude like that.
    – jay.sf
    Commented Jun 23, 2019 at 11:03
  • Besides I propose to include one very essential aspect, not every single aspect.
    – jay.sf
    Commented Jun 23, 2019 at 11:12
  • 5
    Not every MCVE needs data. For user interfaces you don’t usually have any data.
    – Laurel
    Commented Jun 23, 2019 at 11:45
  • 1
    @Laurel I'm aware of that. Just inserting "Provide all parts - including all possibly required data - someone else needs to reproduce your problem in the question itself" would be very economical.
    – jay.sf
    Commented Jun 23, 2019 at 11:53
  • @jay.sf: The thing is, this could go on and on. What about "all possibly required user input" for command-line programs? Commented Jun 23, 2019 at 13:31
  • 1
    @NicolBolas How then could we improve the MCVE page to better cover topics such as data and required user input? We're repeatedly writing "please add this, please add that". To be more explicit in such an important page could be a start.
    – jay.sf
    Commented Jun 23, 2019 at 13:45
  • 4
    @jay.sf: The longer the page gets, the less likely people are to read and internalize what's there. The page tries to hit the most common and important issues. Presenting a user with a list of 30 bullet points is not effective at teaching them stuff, so you have to pick your battles. At some point, you have to assume that "Make sure all information necessary to reproduce the problem is included in the question itself:" is good enough. Commented Jun 23, 2019 at 13:48
  • 11
    You are missing ‘data’. Python answerers miss ‘complete traceback’. UI framework experts miss screenshots. Database gurus miss ‘schema’ and sample rows. Yet all those requirements are specific to the problem domain. The page is fine as it is. It needs to be concise, not exhaustively compete!
    – Martijn Pieters Mod
    Commented Jun 23, 2019 at 15:42
  • 4
    I don't really know who would be catered by this amount of spoon feeding. People who use Stack Overflow should be able to apply at least a minimum amount of thought and come to a conclusion it would be a good idea to post example data if the question cannot be answered without it. The people this advice would apply to are the people who are not going to have much success for varying other reasons I'd wager.
    – Gimby
    Commented Jun 24, 2019 at 7:38
  • 2
    @MartijnPieters: No the page is absolutely not fine as currently written. Often users argue back that their non-MCVE example is reproduclble. We need something short, non-exhaustive, but in black-and-white saying "What constitutes 'minimal data' depends on the problem domain: e.g. for Python errors, ‘complete traceback’, for UI frameworks, screenshots, for Database ‘schema’ and sample rows, etc." The second option jay.sf proposed "See tutorials for your language: R, SQL, ..." is just right length.
    – smci
    Commented Jul 8, 2019 at 3:46
  • 1
    @MartijnPieters: and in fact that page does not represent what you claimed: the "Complete – Provide all parts someone else needs to reproduce your problem in the question itself" only occurs under "Your code examples should be…". That says code, not data. Few people will read it, and the few who do will not read the code guideline to apply to data.
    – smci
    Commented Jul 8, 2019 at 4:06
  • 1
    @Gimby: it's not "spoon-feeding" since experienced users can still be borderline non-MCVE yet argue back that they're not. Don't want to have downvoting and closing where avoidable, due to the vagueness of the MCVE page - and we only need to add one line ("Option b)") to change that.
    – smci
    Commented Jul 8, 2019 at 4:23
  • 2
    @PM2Ring: yes that's a given. My point to Martijn and Gimby is that the MCVE guidelines should be changed to explicitly say so - they currently don't e.g. "obviously code is usually needed to be MCVE, sometimes data is also essential to be MCVE, depends on context". It is important for a positive new-user experience to actually change the MCVE guidelines to be explicit - they're currently not good.
    – smci
    Commented Jul 9, 2019 at 16:59

1 Answer 1

3

I agree with your proposal, but since one main reason for objecting is brevity, **your option b) is best: a succinct one-liner with a non-exhaustive list of language-specific guidelines [JS], [SQL], [HTML/CSS], [R], [Python], ...

(I agree with Martijn that the page "needs to be concise, not exhaustively complete" but disagree that "The page is fine as it is". We're only talking about adding one single line on a page that's currently three screens long.)

Justification: I encounter the exact same issues as you many times a day; see below the motivation from similar Python pandas example (I was about to post a new Meta post, until I found this when doing my research):


Should MCVE explicitly state a question is not MCVE if a needed input data file is given as an URL?

The MCVE guidelines imply but do not explicitly say that not showing input data, but only giving an URL, is not a recommended practice for reproducibility (borderline non-MCVE). To be clear, I'm talking about input data, not input code; for some categories of questions (e.g. Python pandas), input data is needed as well as code to be MCVE. Typically, a short snippet of data is good enough, so won't reduce legibility.

  • Related questions but not dupes: 1, Should a question that is meaningless without viewing an external link be closed?, since it's usually not "meaningless" depending on the context of what data, how much and how well it's described verbally. It depends. Not a dupe of 2 because we're not talking about CSS/HTML or entire files. Not a dupe of 3.

  • It's best to actually show a snippet of input data, rather than an URL:

    • e.g. in Python pandas, for a CSV file, show a multiline string dat = """Your sample CSV data snippet goes here...header_line\nline1\nline2...""" then pd.read_csv(pd.compat.StringIO(dat), ...). Don't do pd.read_csv('http://some_url...')
  • Why?

    • URLs are ephemeral, breakable, eventually go stale. URLs, websites, ISPs and companies grow old, decay, break, go out of existence. (How many questions from 10 years ago's URLs still work? Very few. Not a reusable resource for future SO users)
    • Not all users behind corporate firewalls have unrestricted internet access to arbitrary URLs, often to just a subset of whitelisted sites, for security policy. That can make this irreproducible and hence not MCVE to some users.

Recommendation: Add to MCVE guidelines something explicit the following:

"Input data should not be provided via URL wherever possible, for long-term reproducibility. If you absolutely must use an URL, use one that will survive long-term":

  1. Posting an actual snippet of data in the question is best
  2. Github et al. is second-best
  3. URLs to third-party sites are not very long-lasting
  4. URLs to code-link-sharing sites e.g. pastebin is not guaranteed to be long-lasting
  5. URLs to temporary cloud instances are very ephemeral, and discouraged
  6. Code/data-as-image or screenshots are also discouraged
  7. The only counterjustification is when users don't want to/can't post on SO to avoid the CC licensing.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .