Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scope, motivation, and software revision information to generated software-READMEs #3248

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

peter-michalski
Copy link
Collaborator

@peter-michalski peter-michalski commented Jan 28, 2023

Contributes to #3159

@peter-michalski peter-michalski marked this pull request as ready for review January 29, 2023 20:13
@peter-michalski
Copy link
Collaborator Author

peter-michalski commented Jan 29, 2023

A few outstanding items (potential new Issues):

  1. Goal Sentences are capitalized and do not render nicely in the README. I'm wondering if Sentences in Drasil should instead be lowercase (in situations like ConceptInstance definitions) and a function could capitalize them near their final targets. This may make working with them easier.
  2. I'm wondering if annotations like purpose, background, motivation, should become a chunk.

@@ -1,4 +1,6 @@
# DblPendulum
> The program documented here is called DblPendulum.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This text seems strange in a README file. The README file doesn't document DblPendulum. I feel like the README file would just start with the program name, possibly as a title (like #DblPendulum)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You already have #DblPendulum. Do we need the sentence at all? If we need a sentence, I guess it might say something like "This program is named DblPendulum". (Seems redundant though.)

@smiths
Copy link
Collaborator

smiths commented Jan 29, 2023

With respect to your potential issues @peter-michalski, my instinct is that sentences shouldn't be capitalized so that we can put them together in different combinations. We can capitalize as needed. This reminds me of the "extra the" issue (#3234). We can reduce some problems by keeping the sentence information we codify simple.

@smiths
Copy link
Collaborator

smiths commented Feb 1, 2023

The change to the README file (to remove the part about "the program documented" here) looks good to me.

@@ -52,6 +52,8 @@ type CaseName = String
type ExamplePurpose = String
-- | Description of example
type ExampleDescr = String
-- | Motivation of example
type ExampleMotivation = String
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this information that is quite specific to the README has really gotten too large to fit in Language.Drasil.Code.Imperative.GOOL.ClassInterface. This should be split out into its own file.

It doesn't even belong to Language.Drasil.Code.Imperative, as it is quite independent of that. Finding a better home needs a design.

@@ -49,6 +49,12 @@ data CodeSpec where
purpose :: Purpose,
-- | Example Background.
background :: Background,
-- | Example Scope.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are these all Example X? The data structure is a "Code Specification". It feels like there is a mismatch.

Futhermore, are we now requiring all this information for all codes?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My guess is that these were meant to specify that it is the purpose, etc., of the example itself, but I think this is a bit redundant

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe CodeSpec just needs to carry a reference to the SystemInformation it was constructed for? Right now, these fields are carried in both, and CodeSpecs are always a clone of SystemInformations manually created ones.

@@ -104,6 +104,9 @@ si = SI {
_authors = [naveen],
_purpose = [],
_background = [],
_motivation = [],
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewing multiple examples in a row that all set these 3 things to be empty. This really does start to feel like a hack. If we're going to implement a feature, shouldn't we be using it in all the examples? Just using it in Projectile does not convince me that this is a feature that is implemented at the right level.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do have a form of this information that we write for the SRS documents, as we just recently did for #3777. It would be nice if we could share them with a chunk that defines what the purpose, background, and motivation of each case study, respectively, is.

This is also related to #3773. The specific purpose, background, and motivation of each case study are just instances of the generic concepts of purpose, background, and motivation. In other words, for our current design, these might just be unique ConceptInstances for each case study. Rather than having lists here, it might be that we just have a UID to the specific ConceptInstance.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, actually, would it be nice to share the same SRS discussion of the purp., back., and moti. in the generated READMEs? I'm not sure anymore. We might want a longer version of that in the SRS, and a shorter one here. @smiths do you have any thoughts on this? Do you think we can share them?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@balacij I think for every example we should be able (if we haven't already) to write a one sentence purpose. This one sentence purpose would fit nicely in the README. It should also be usable in the SRS. As @NoahCardoso recently did, we can reuse the purpose in the Introduction to the SRS. Although we haven't done it yet, I could see us wanting to have a longer version of the purpose for the SRS. For instance, our one sentence purpose could be something like:

The software library provides a multi-domain Lattice Boltzmann solver.

(I'm working on a project with a colleague in mechanical engineering that could be described with that sentence.) The problem with this one sentence purpose is that it introduces at least two concepts that not everyone will be familiar with. This could be fine in a README file, but in the SRS, a description of what multi-domain means and what Lattice Boltzmann means would be in order. Following #3773, we could say that the purpose is an idea definition that includes two other idea definitions. In the README we might not generate the text for the definitions of the sub-ideas, but for the SRS, this would be a natural thing to do.

We could go through a similar conversation for Motivation and Scope. I think Motivation would be fairly simple, but Scope does get more involved. There are different views of Scope. There is a simple "high level" view, and then there is the view that decomposes the Scope into Scope Decisions (things that are entirely left out) and Assumptions. The Scope can also include typical values and examples.

@samm82
Copy link
Collaborator

samm82 commented May 28, 2023

I wonder if this PR is related to #3430 at all (for example, in its capturing of motivation).

It looks like different values of sections in the README aren't being formatted
correctly; related to #3256
@samm82
Copy link
Collaborator

samm82 commented May 28, 2023

As mentioned in the commit for the merge, there seems to be an issue rendering the purpose correctly; compare:

> Purpose: efficiently and correctly predict whether a launched projectile hits its target

> Motivation: Projectile motion is a common problem in physics.

This is related to #3256

@JacquesCarette
Copy link
Owner

Yes, it is tangentially related to #3430 in that the larger topic is "what should be in an introduction?"

@smiths
Copy link
Collaborator

smiths commented May 29, 2023

I don't know if this is the best spot for this comment, but looking at the Purpose for Projectile I wonder if we should remove "efficiently and correctly"? The purpose for Projectile is given as:

"efficiently and correctly predict whether a launched projectile hits its target"

Our SRS doesn't define what we mean by efficient. Our code doesn't do anything (that I'm aware of) to be efficient. Projectile is so simple that the notion of efficiency isn't really that relevant. Even if it was a more complex problem, we really haven't been focusing on efficiency. Our first goal for Drasil code has been correctness.

I don't think we need to specifically say our purpose is to "correctly predict". It seems obvious that we wouldn't consider a prediction that was incorrect as valid. Does it really need to be made explicit?

If we distill the purpose to its essential elements, we have:

"Predict whether a launched projectile hits its target"

@JacquesCarette
Copy link
Owner

The question remains: are there useful things in this PR (not in the abstract - we know this goes in a positive direction - but in the concrete code) that ought to be adapted and merged in?

@smiths
Copy link
Collaborator

smiths commented May 30, 2023

I feel like the recent work that @hrzhuang has been doing with the "purpose" chunk of knowledge supersedes the work on this PR. There are already conflicts with the README.md files, and I think the current (main branch) versions are closer to what we want. Having said that, I'm just looking at stable. There may be something in the Drasil code changes that is useful to us. Someone else will have to comment on that.

@JacquesCarette
Copy link
Owner

Indeed, given @hrzhuang 's recent work this might be moot. Ricky, could you take a serious look at the original issue and the PR and see?

@hrzhuang
Copy link
Collaborator

I think this PR has a related goal, but is otherwise independent from my work with purpose.

Prior to my work, purpose already existed in SystemInformation, but it was not filled in for most of the examples. My work was extracting a purpose from the SRS, put it into the SystemInformation, then have the SRS pull that information from SystemInformation.

This PR introduces new fields for "motivation", "scope", and "software review" into SystemInformation, and they are mostly still blank except for the motivation of Projectile. So it is laying the groundwork similar to the introduction of purpose before I actually filled it in.

@JacquesCarette
Copy link
Owner

So does it seem worth resurrecting, or is it not worth it in its current state (so we should close it)?

@hrzhuang
Copy link
Collaborator

It doesn't seem too difficult to bring this up to date. I think it's really a matter of do we want the "motivation", "scope", and "software review" in SystemInformation and in the README files.

@smiths
Copy link
Collaborator

smiths commented Aug 17, 2023

I like the idea of having motivation and scope available for the README file, and possibly other artifacts besides the SRS. Whether System Information is the best place for this information is a question for @JacquesCarette. I'm not sure what "software review" refers to.

@balacij balacij changed the title Issue3159 si expansion Add scope, motivation, and software revision information to generated software-READMEs Jun 7, 2024
Comment on lines +6 to +10
> Motivation: Projectile motion is a common problem in physics.

------------------------------------------------------------
## What
Common examples of projectile motion include ballistics problems (missiles and bullets) and the flight of the balls in various sports (baseball, golf, football, etc.).
Copy link
Collaborator

@balacij balacij Jun 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I think of "motivation" related to software, I think that I think (lol) of strictly technical features:

  1. What makes this software special?
  2. What differentiates this software from other, similar, software?

However, this (the linked code) answers the question of "what is the motivation of the problem this software somehow solves?," which I think is more intended for a non-technical audience. So, I'm not quite sure who our audience is for this information (technical/non-technical/mix?).

If a software (assuming it were publicly available) is large/prominent enough such that it would have this kind of information, I imagine it would have a website, where this kind of marketing material would be found instead. Conversely, if the software isn't, then I imagine it would be somewhat self-evident to the audience of developers seeking out the software (they probably have a specific issue in mind, searching for a few specific keywords, and then looking at program/library documentation). If it's somewhere in the middle, it might, but I would think the non-technical discussion would remain in a "Who is this software for?" or as part of a "What can X do?" section that highlights features. It might just be that we need to rename the headings and/or move it around, that is.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addendum to this after my latest comment below: the answers to (1) and (2) in a motivation section would be terse (e.g., X was too slow / A goes fast, Y is purely CLI-based / A creates a pretty GUI, Z is... / A has..., etc.), so it would not be as complete as the potential "Software Review"/Comparison Chart.

Copy link
Collaborator

@samm82 samm82 Jun 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These could potentially be even more terse;

A solves various problems with the following alternatives: X is too slow, Y is purely CLI-based (while A creates a pretty GUI), .…

By formatting it this way, we have the flexibility to comment on A's functionality/qualities when necessary for clarity/context, but don't need to when it is redundant (although this completeness might be desired); a table may also be a nice way of formatting this data.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that's better. Though, I think the more complete, less marketing-like version, is reserved for the "Software Review" / Comparison Chart, but I agree with you. I think a good example of what we're talking about here is the Gitea project, where, in their README.md, they give very quick highlights in the Purpose, and then have a dedicated page for software comparison.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the bar for the motivation is to do something better than the competition, than none of our case study projects have a motivation. 😄 Research and commercial projects should have the kind of motivation that distinguished the project from the "competition." Although our software doesn't have this kind of motivation, since it doesn't do anything better than the competition, I still think we can motivate it. Of course we have the motivation for our Drasil research project, but that isn't the motivation I'm thinking. The motivation is for why have software to solve the kind of problems the software solves. It isn't motivation for why the current software is the best, but rather the motivation for having software to solve the problem. Projectile motion is an important physics problem. A software tool to help with projectile motion will help physicists/engineers/scientists.

If we had enough examples, either real or brainstormed, we could identify the patterns in the Motivation statements and build a language for generating motivation statements. For now, I think I'm fine with a non-parameterized statement that we make for each example.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've convinced me 😄

A software tool to help with projectile motion will help physicists/engineers/scientists.

Do you think we can replace the existing "What" section with your quote (or a variation of it)?

@balacij
Copy link
Collaborator

balacij commented Jun 7, 2024

In all honesty, I thought that "software review" was just a typo, and that "software revision" was intended.

Actually, it looks like it was intended to be "software review" and that "software review" means a comparison chart between a software (related to a README.md) and related projects. I think that "Comparison" is more appropriate, but I also don't really think this is something feasible for us to generate -- it would require an immense amount of knowledge of related popular software, and software qualities between our generated code and theirs (maintaining this does not sound feasible).

@NoahCardoso NoahCardoso changed the base branch from master to main June 14, 2024 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants