-
-
Notifications
You must be signed in to change notification settings - Fork 212
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
Change Wording from ‘Assertion’ to ‘Expectation’ #746
Comments
@robstoll: I’d also like to change the wording from ‘feature assertion’ to ‘feature extractor’ because they don’t really assert (or expect) anything, they only change the subject. This would also mean that it might make sense to separate feature extractors from expectations. If I remember correctly, we had that in the past but removed the split. From a naming standpoint, it would make sense though. What do you think? |
I am not sure where you want to change the wording. In the readme? the file name in the API? We actually have already a FeatureExtractor on the logic level, it's the implementation behind feature assertions in the end. So far I made the following distinction between the two (KDoc of FeatureExtractor)
|
I am mainly concerned about how we communicate, so I’d mainly change the readme. However, I thought it might make sense to reflect that distinction also in the API and the logic files. That could also make it easier to find certain functions, since so files are quite big.
I know :). However, I hadn’t read that piece of KDoc yet. I don’t find the distinction you make in the KDoc all too convincing. I think the distinction should be about intend. Let’s take From my point of view, there are no ‘feature expectations’, but only ‘feature extractors’ and ‘expectations’. Something like As I said, I am mainly concerned about the wording we use in the documentation. Consistent wording that builds a clear mental model always helps me a lot when reading docs and getting to know projects. Whether we split the files is another question. I am in favour of it, but much less concerned about it than I am about the docs. |
Those are good points and make sense. So I am in favour of renaming featureAssertions.kt in the APIs to featureExtractors.kt and we can also name it that way in the README. Also I agree that the distinction is no longer really up-to-date as we now also catch exceptions caused in However, I think you take an end-user perspective on the logic level where the logic level targets expectation function writers. Thus, I would still include in the KDoc of |
Great 👍
I am not sure what you are hinting at with this paragraph. I did not want to imply changing any KDoc. I absolutely see that distinguishing safe from unsafe extractions on the logic level makes sense. As you say, I was only concerned about the user’s perspective. Last question: Should we separate expectations from feature extractions in the logic and API files? Should we, for example, have |
That on this level we should first serve the expectation function writers and then end-users.
I would not, we had and many times still have the split in the specs and so far it was more confusing than helpful. |
Fair enough. |
@robstoll how will we proceed here? My current understanding is that you approve the change in principle, but don’t want it to affect the code too much, which leaves us in a weird half-baked situation, from my point of view.
Regarding 2, I don’t think that it would be wise to talk about both ‘Assertions’ and ‘Expectations’ in Atrium. Because:
All in all, I proposed this change because I think it would make it easier to talk about Atrium’s concept and to write clear documentation. I still think that pulling it through would improve the understandability of this project. I also think that now is a good point in time, once Atrium hits 1.0.0, such a change is much worse to pull off. However, if we are going to mix terms throughout the code base and documentation, I think we are worse off than if we went just with ‘Assertion’. So I think we should do the change, but do it all the way. What are your thoughts @robstoll ? |
But... I agree that Assertion can be quickly mixed up with
They create Assertions but also add them to the Expect. And this can cause that an exception is thrown depending on the Expect to which they add the Assertion. A lot of side effects. I would like to distinguish this from the mere creation of Assertions. Which also means, I would still rename it to expectationCreator-lambda
|
Maybe it makes sense to look at it from a reporting perspective. We wanted to introduce Reportable with subtypes: Text, Translatable, something which replaces ExplanatoryAssertionGroup and Assertion/AssertionGroup. |
Okay, I understand from what you write that you don’t insist on the term ‘Assertion’, but rather want to differentiate between the logic object and the general term ‘expectation’. I’ll write my interpretation of the terms, maybe that convinces you. First, the functions we offer through the API are currently called ‘assertion functions’. Going forward, I’d just call them ‘expectation’, not ‘expectation function’. It makes perfect sense to say that If I understood you correctly, you hesitate to call In my experience, naming the logic object according to the use case is helpful, not irritating. The use case and logic object can be clearly separated: the former is an ‘expectation’, the latter an
Yes, I am aware. And I still think we should do it, it will improve the API! But I am not sure how this is related to this discussion. |
Exactly, I don't insist on the term. I am basically with you that Assertion can be mixed-up with
I don't see yet how this will work out. In the README we will have sections like
I don't think that it is a real problem, we had assertion function and
Was just meant as input, maybe you had a good idea looking at Assertion from the reporting perspective to come up with something different. I thought about it a bit and I think my gut feeling was not wrong. Looking at it from a reporting perspective might make more sense. I try to outline two possibilities. An AssertionGroup is currently: a description + representation, a list of Assertions + the information how they should be displayed in reporting. We can see from this that an AssertionGroup is more than just a grouping and it is related to reporting. A better fitting name could be ReportGroup and an Assertion would be a Report instead. The AssertionBuilder would become the ReportBuilder. We have different kind of reports, like a RepresentationOnlyReport, a DescriptiveReport (I don't like the name as it is too general so maybe we can come up with a better name as well, maybe simply DescriptionRepresentationReport). A ReportGroup will in the end be reported by a Reporter to the user. Although I find report quite fitting because we are using it for reporting, the term might be too loaded by devs with the idea that a Report already needs to be everything and not a single unit. And we would again overload the term once we produce a HTML report next to the terminal report. Therefore, I am considering to use the term Record instead. At first glance I like it because it emphasises that we take a snapshot in time and create a record from it. The user has an expectation, we record the actual state and a Reporter in the end reports the aggregated records to the user to let him know about the outcome. Following the three possibilities (with status quo) next to each other (I also made a few further adjustments)
|
Oho... I figured I am going to start rewording |
I’ll answer your comment above at a later point because I want to give it careful consideration. Regarding your latest comment: I don’t think that anybody will have trouble understanding the term ‘expectation library’. If you are worried about SEO, maybe having ‘assertion library’ in the tags is enough? I don’t have experience with that, though. |
I have started rewriting README and other md files from assertion to expectation (and feature assertion to feature extractor): |
Sorry for the long silence.
I agree: I was too rigorous in my previous statement. I think the following would be a good policy: Talk about ‘expectations’ per default, and only use the term ‘expectation function’ when it is relevant that we are talking about the actual function.
Okay. So let’s try to find something that makes better sense to your mind. However, I would be glad if it was not Regarding the name However, I think that If we go back to the basics, what an |
No problem at all
I am still with you on this one and I think I am going to add it in 0.16.0 if we do such a bigger renaming.
I thought about your suggestion and I prefer I guess Java will in the end get That being said, I am open for alternatives to
|
Unfortunately, yes. Mainly because I do not agree with the statement
Consider this: I do fully agree with you that the reporting aspect is important. No disagreement here. However, the reporting aspect will be conveyed by the fact that My main objection against In other words: The interesting thing about
How so? My main objection against As I said above: If you insist on having the reporting aspect in the name,
I am not convinced by either of those arguments. The English language just has so many words, and one cannot stop using some of them just because they have already been used by another prominent library. I think developers are very used to the fact that the same term refers to different things in different libraries. After my arguments above, it should not surprise you that the only one of your proposal that I can agree with is In fact, I think we should give
|
That's something you need to look up. Ideally you don't need to and the name tells you enough. But yeah... it's quite often not easy to come up with good names...
I agree that this is certainly not a killer-argument but something to consider nonetheless. I also meant it as argument on top of why I would prefer to use something different than
I think that's kind of what I like about Record. The fact that it does not imply that it contains itself the checking part. I do think though, that it conveys verification functionality. Maybe for you, checking and verification is the same but I connect the checking part with throwing the AssertionError in the end. Same same for
That's what I think about when I read If we take the analogy of a car check. Overall, you expect that the car is still allowed to be driven on street, you will have different sub expectation like the break works, steering works etc. (for me this is when you write I am not sure if I can convey my point with this analogy, but now that I have wrote it down, I keep it. Does this change your mind or do you have an even better name? |
I love discussions about naming. When people are willing to talk it through (like you are), these discussions can reveal a lot about how people think about the software and its requirements. I am glad that you don’t think ‘it’s just a name’, but are willing to discuss everything to its conclusion. I am learning a lot here! I’ll proceed as follows:
There are different aspects in the description and the analogy you provided. I’ll report what I have understood below. Please correct me if I am wrong or anything is missing. For the sake of simplicity, I will refer to the type we are searching a name for (the one that holds a boolean result and extends 1. You want to convey that
|
Thanks for you input.
Not quite. First, I prefer to use
In theory I agree, if you would ask some random guy on the street, then they would probably answer the same thing, there might be subtleties between the term but they are more or less interchangeable. But... we are embedding the term in a context and if you talk about checking in the context of writing tests, then I would say most expect that checking involves that the test fails if the check fails and that's done by throwing an AssertionError in most libraries. Of course, we could say, but wait, In other words, when I talked about
What I meant is that it does not contain this side effects (throwing an Exception). Instead, it only models the effect of checking. I guess my comment will make more sense now if you re-read it and I guess you will see that we are not that far from each other.
There you have it again:
I talk about the side effect.
I agree that it would be absurd if I would have said we did not check 😆 but that's not what I wrote nor what I meant as already outlined. I try to explain it again differently. I stopped the analogy last time once the TermX was created but I guess I have to go on to make it clearer. Everything I described was happening on the logic level. The mechanics have written down their TermX and passed on the result to the person asking for it. The logic department has done its work, the actual verification. Now their paper-work is passed on and it depends on this person what happens next. If it's someone in the logic department who has asked for it, then it is most likely used as part of another TermX (yes, that's composition). But if it is a guy from the core department (oho... a See, I would like to come up with a term which does not imply that it has side effects but instead search for a term which conveys that it only models the effect of checking.
Here we have clearly a different view and that's fine... if we would have the same view, then we could use IMO a function on the API level is allowed/encouraged to imply that it contains the effect of throwing. To my mind, Last but not least, I would like to underline the difference with code:
You expect that this fails the test:
As it is currently, you might still think this will fail the test. Which means, I came to the conclusion that we have to rename those functions to something like
For me there is a clear distinction. Reportable is just a marker interface, we could also use
I agree with you and I meant to come up with a good
That's a fair point but I would say that it's clear what it records because we are using it in the context of an assertion library.
So for me it is clear that a Record is data about the evidence of a specified expectation. Yet, I see from all the counter-arguments you brought up that you seem to have a hard time to think about Record in this way. I don't know why but I am still open for other terms 🙂 So what about Evidence or Proof instead of edit I reconsidered So my new suggestion is to use Proof. Thoughts? |
@jGleitz I'll probably start this or next week with the work on the logic level. So if you have something to say against |
Once again: I am sorry that I am currently not able to participate more in atrium’s development in general, and this discussion in specific. I think we have come a long way in this discussion. And I agree with your statement that
For me, Regarding your argument that
I disagree that In conclusion, I think we agree that Maybe the argument above sways you in favour of |
Regarding the groups: We could probably find even better names. Maybe the group’s purpose will always be clear from the context, then So a) The name for |
Good, I'll go with |
#746 rename assertion to expectation in README and samples
the api is free from |
In #714, we found that it makes sense to talk about ‘expectations’ instead of ‘assertions’. Hence, we want to refactor the whole code base to reflect that naming.
The text was updated successfully, but these errors were encountered: