JacquesCarette / Drasil

Generate all the things (focusing on research software)
https://jacquescarette.github.io/Drasil
BSD 2-Clause "Simplified" License
140 stars 26 forks source link

Expanding generated README content #3159

Open peter-michalski opened 1 year ago

peter-michalski commented 1 year ago

A subset of the following information is currently generated in each example's src README files:

Considering expanding what information is generated in these files, Categorizing the Content of GitHub README Files suggested by @smiths lists some common README file information based on a study of GitHub repos. I have also reviewed some GitHub repos dedicated to sample README templates. I have combined the suggestions from the paper and the repos into one file. There is considerable overlap. The paper does break down frequency of sections and information quite nicely.

Some common README file information:

The remainder of this issue will add justification for why some of the information commonly found in README files should or should not be generated with our examples. Once the updated README file content is decided, another issue can be created to investigate how to encode the information. Some of the information could already be specified in the examples.

peter-michalski commented 1 year ago

Information that should be part of the README files:

What:

Why:

How:

When:

Who:

References:

Contribution:

Other:

smiths commented 1 year ago

Thank you @peter-michalski. Great summary.

During our last Drasil meeting (#3184) I mentioned that I was going through the generated code for the Projectile example. I also noticed the absence of the "what" information. In the README file for Projectile we never actually say what Projectile does.

@peter-michalski, can you please look into what would be involved in adding "what" to our generated README files. We have the "what" information in the SRS, but it is unclear if it is easily separated from the other information in the SRS.

For the license information you are correct that we already generate it in the example README files, but as far as I know we only allow for one choice of license. That isn't a very Drasil approach. :smile: It would be nice if we let the users select their license.

For code of conduct, we could also offer the option of selecting from currently available codes, without having to generate our own.

Some of the information in the Prana et al README files can also appear in different documents. For instance, if we wanted to include contributing information, this could be in a separate CONTRIBUTING file. With the Drasil approach, the user should be able to specify where they want the information to appear.

JacquesCarette commented 1 year ago

This is indeed great. It also kick-starts something that I've thought about in the past: the concept of a "project" (not the best word, I'd like to find a better one); I think of Projective, but also Drasil, as a project. This is higher-level than the SRS. I think this is what SystemInformation was heading towards, but that too was too low-level!

A lot of the information above is both about the 'project' and the software. Some of the information should likely be in the SRS as well as the README.

Every single concept mentioned in both of @peter-michalski 's descriptions deserves a proper analysis!

peter-michalski commented 1 year ago

A comment in CreateMd.hs suggests how to add a Purpose section in the generated README files. It also points to #2224, which indicates that there used to be a Purpose section, but it was removed. Am I right to assume that this deprecated Purpose section held information that should be in a What section?

2195, linked from #2224, sounds like the above from @JacquesCarette. It appears that we are circling back to that issue here.

I can add a separate What section (and other sections) to the generated README files now (after tinkering a bit with example specific information) using SystemInformation, so that these files convey important information that is missing. I can then proceed to try to pull SystemInformation apart (apart from SRS anyway), this may require some time to conceptualize first of course. There is a lot of information in #2195 to consider.

smiths commented 1 year ago

Maybe I'm not looking into this deeply enough, but I think it may have just been the heading purpose that was removed. I don't think we generated content for this section in the README. @peter-michalski, you may want to look deeper into the code history to see if I'm wrong about that.

If it isn't too much work, I would be fine with hacking together a purpose section for the README based on SystemInformation. I know that SystemInformation needs to be rethought, but it might help us see how to fix SystemInformation if we see how the information in SystemInformation is used, especially how the information is used outside of the SRS.

JacquesCarette commented 1 year ago

Yes, that's right, it's just the header that was removed.

Figuring out what such a purpose section should actually contain, and adding it in now (even if it's hacked in a little) does sound like a good idea.

peter-michalski commented 1 year ago

Prana et al. chose to classify the 'purpose' of a project under the 'Why' category. Regarding the inclusion of 'purpose' in READEME files, they note that

Despite 'purpose' information being rare in README files, according to their study, we certainly can add this information back into our generated README files. Looking at Projectile's SRS, the first paragraph of the introduction section appears to have information we can reuse in the README for this purpose. It notes why it is useful to have such a projectile motion program. Information from the Problem Description section could also apply here although it could also be used in the 'What' section.

For the 'What' section, we could reuse information from the SSD section of the SRS, namely from Problem Description and Goal Statements, as well as from the Functional Requirements. This would cover the program introduction, as well as its inputs and outputs. The version information and blurb about Drasil also fall under the 'What' section according to Prana et al., but I think that their current location in the README file is adequate and should be left as is.

Of course this approach might not be appropriate with our other examples.

smiths commented 1 year ago

The information from Prana et al is definitely useful, but we don't have to follow their recommendations exactly. I think the purpose is just what the software does. The purpose is a brief abstract statement that characterizes what the software does. The other chunks of information that Prana et al mention should also be captured, and possibly even be documented in a "purpose" section, but we should keep our purpose as atomic as possible. Based on what @peter-michalski wrote above, the other chunks of information that we can capture include:

The Introduction of the SRS doesn't really say the purpose of the Projectile program. The information given, like "Projectile motion is a common problem in physics" isn't the purpose of the projectile program, it is more in the category of motivation or background. The purpose is currently given in the last sentence of the scope section: "Given the appropriate inputs, Projectile determines if the projectile hits the target." (I think it should be rephrased to "Given the appropriate inputs, Projectile determines if the projectile hits a given target.")

I actually don't like the purpose showing up in the scope. The purpose being the last sentence of the introduction would be a better fit.

Looking at the SRS, the separate pieces (chunks?) of information that we have are as follows:

If we had each of those pieces of information separately codified, we could reuse the ones that are relevant in the README file, or elsewhere. The purpose in particular would make sense in the code files.

JacquesCarette commented 1 year ago

@smiths provides a superb, in-depth analysis of the situation. This is a great model to follow.

peter-michalski commented 1 year ago

Purpose

The purpose is currently given in the last sentence of the scope section: "Given the appropriate inputs, Projectile determines if the projectile hits the target."

I'm not seeing this verbatim in the SRS. I see something else entirely in the Scope of Requirements section.

The 'purpose' you are suggesting is a fusion of the information under the Goal Statements section of the SSD. Specifically the lone goal in this example as well as phrases passed directly into the SRSDecl of Body.hs.

https://github.com/JacquesCarette/Drasil/blob/84272acccc09574dec70d8d96c6ea994f15f8b22/code/drasil-example/projectile/lib/Drasil/Projectile/Goals.hs#L9-L15

In this case, we should look at the relationship between purpose and goals, each as "groups of fragments of information", to see if we can encode them in a way that eliminates duplicate fragments.

The purpose is a brief abstract statement that characterizes what the software does.

This overlaps with our goals. We can see this relationship by looking at other examples:

SWHS:

GlassBR:

Looking at the syntax, a simple change to the capitalization of the goals would allow us to combine them into a purpose. They can then be re-capitalized when printing the information as goals.

Background (What) and Motivation (Why)

It looks like we will want to generate both the motivation (Why) and background (What) information in the READMEs.

For projectile, as @smiths suggested, the start of the introduction section can be used for the motivation.

A background blurb will also need to be added. It will need to sit in Body.hs for now. I don't think it's appropriate to add it to any of the other files.

For the other examples, it looks like we can pick out part of the introduction for our motivation, specifying the need for the software. Background will also need to be added to each example, with the semantics suggested by @smiths in #3206. The background will list common examples of the problem being addressed by the software.

Other SI fields

I will go ahead and add the the following fields into SI

Roadmap of Introduction section

This would probably be artifact specific, and not in the SI.

I will also update README generation to add the following blurb to the project name: "The program documented here is called"

Example Projects

This is higher-level than the SRS. I think this is what SystemInformation was heading towards

It is probably a good idea to start thinking about splitting apart the current content of Body.hs, separating artifact specific details from the meta-information that will be used in multiple artifacts.