-8

I had this question closed for the reason:

This question does not appear to be about programming within the scope defined in the help center.

I understand the primary reason for closing it was because it had no code, but I'm unable to provide the algorithm for personal reasons.

Despite this I think I made it clear enough in the question what I'm asking for, especially since I'm not particularly looking for an answer in code, just a pointer in the right direction about which testing methods among several in Laravel I would use for what I want to do. With that in mind, I feel it's both on-topic (testing code is related to programming) and answerable in its current form to someone who knows Laravel/PHPUnit.

15
  • 1
    It looks pretty close to a request for a library/framework/resource, and such requests aren't on-topic, see meta.stackoverflow.com/q/385479 - might not be a good fit for SO, but I'm sure there are other communities where you could get good input on it Mar 9, 2022 at 20:07
  • 1
    @CaptainPerformance It's not a resource request, the testing "frameworks" referred to in Laravel are just packages for different types of testing - unit, feature, etc. - and I'm essentially asking what type of testing I would need for what I want. All of them use PHPUnit under the hood. Mar 9, 2022 at 20:11
  • 6
    @HashimAziz To me (with no knowledge of PHP) it very much looks "suggest a method that I would like" type of question which are generally impossible to answer (as OP do not provide concrete reasons to pick one over another). Your comment here paints very different picture of what you are looking for ("what type of testing I need") - also I'm not sure it is more suitable for SO either as boundaries between testing types are very opinionated too... "How to text X, I tried Y" may be safer way to ask. Mar 9, 2022 at 20:36
  • 1
    If the generality is overwhelming and the documentation is too terse, you could look for examples on Stack Overflow and elsewhere. That is, to use what others have done as (indirect) recommendations. Mar 10, 2022 at 14:26
  • Why the downvotes in this question tho? Because he made a mistake? Is the question a bad one? And why?
    – S. Dre
    Mar 11, 2022 at 11:31
  • 1
    @S.Dre meta votes on questions cannot be explained. If you ask four people, you will get four different explanations for why they place a vote to begin with. It's usually not quality, more often it is agreement/disagreement. It is a side effect of meta being an actual opinionated discussion platform but it uses the same software as the Q&A repository... the software features don't really fully match up with what we do here.
    – Gimby
    Mar 11, 2022 at 13:40
  • @Gimby Although, I've read that the rules stablish that should only be on future requests related posts, and the rest of meta questions should follow the standard SE procedure. meta.stackoverflow.com/a/254113/17089665
    – S. Dre
    Mar 11, 2022 at 13:41
  • 2
    @S.Dre Don't waste time discussing votes. "Upvote": someone considered a post useful. "Downvote": somoeone didn't. That's it.
    – yivi
    Mar 11, 2022 at 13:43
  • @yivi I understand the concept but I don't understand the usefulness of votes if their meaning is not defined, if I go to a question, what do I care about something completely subjective? Maybe it's on me to just ignore votes and that's it. Thanks for the time though guys.
    – S. Dre
    Mar 11, 2022 at 13:46
  • 1
    @S.Dre Individual votes are inherently completely subjective. It's exactly as it's meant to be. One can extract meaning from the aggregate score, though. "X users, individually and subjectively, found this post useful".
    – yivi
    Mar 11, 2022 at 13:47
  • @yivi Yeah, I mean, if you find it useful, then that is it, it might differ from people to people but the fact it was useful to you is objective. Now, it someone says "this question is so easy for me -> downvote", well, that's easy for him, the fact is that the guy didn't get why his question is off-topic and he is asking following the rules so I don't know exactly what to extract from this question's points. The only reason I can take is that people think it is so easy to find it on the guideline that the OP made little to no effort.
    – S. Dre
    Mar 11, 2022 at 13:55
  • 1
    I mean, if I see a downvoted question, usually I understand, this is not useful, I'll skip it, as is going to make me lose time. If people downvote because "they didn't like it" then we have to check every question because I have to check if my opinion is the same and thus voting doesn't help to filter. Or am I missing something?
    – S. Dre
    Mar 11, 2022 at 13:57
  • 2
    Yes, you are missing something. Usefulness is subjective, is not objetive. Do not assume that users downvote "because they do not like things", but that they they think a particular post is not a useful addition to the repository. It's a personal judgement, @S.Dre. That's it. If what you want to take out from that is "I should ignore votes and scores"... well, that's up to you. All that being said, I did upvote this question, even if I disagree with the OP, because I think that it's good and useful to discuss these things. Other users may not agree and voted differently, that's all there is.
    – yivi
    Mar 11, 2022 at 14:01
  • 1
    I don't think it is "subjective". I differs from people, but that doesn't make it subjective. Something either has been useful to you, or not. Maybe you can argue that what people understands as useful differs but that might be the case with everything in this world, even for things that are considered objective such as colors.And for gray lines there is probably the option to not vote, if someone is not sure. But yeah, I mean, if people are happy with the system, that's ok to me, even if I don't agree.
    – S. Dre
    Mar 11, 2022 at 14:10
  • 1
    "I[t] differs from people, but that doesn't make it subjective." - Umm ... that's almost the definition of subjective! (According to the online OxfordLanguages dictionary: "'subjective': adjective - based on or influenced by personal feelings, tastes, or opinions".)
    – Stephen C
    Dec 15, 2022 at 2:09

2 Answers 2

14

The question is off-topic because it lacks details or clarity.

You say you need to test that some "algorithmic output" matches certain expectations. For something like that, as described on the question, the choice of framework or testing framework should be irrelevant. You simply test that "for X input I expect Y output", "for Z input I expect an exception to be raised", etc. And that's it.

Testing an algorithm is as framework agnostic as it can be.

Maybe there is something more to the issue at hand, but without additional details to understand what makes this in any way "special", the question does not make a lot of sense, nor it's constrained in any way that would make it feasible to give a reasonable answer.

Note that even if you provided enough detail and clarity, that alone would not make the question immediately on-topic. That could simply make clear that the question is opinion-based, that needs focus, or anything else. But as it is, it would be the close reason I would pick if I encountered the question and it wasn't yet closed.


I'm not particularly looking for an answer in code, just a pointer in the right direction

More often than not, something like the phrase above is a huge red flag for a question.

7
  • And how would I go about testing "that 'for X input I expect Y output'" using one of the Laravel "frameworks"? What assertions I would use? As already mentioned I use framework here in the general sense, not the sense of a library - each of Laravel's testing packages offer a different type of testing (unit, feature, etc.), all of them using PHPUnit, and it's not clear to me a) how to go about testing or b) what type of testing I should be using for it. Mar 9, 2022 at 21:36
  • 1
    Again, without additional details it’s impossible to answer. But most likely, it’s irrelevant. If you are testing algorithmic output, framework integration is likely not what you need. Once more we face the insufficient details on the question.
    – yivi
    Mar 9, 2022 at 21:59
  • 2
    This question is not off topic, the topic is code testing/coverage, which is unique to software development. It's however unclear and opinion based. There's no indication of what would be a wrong answer.
    – Braiam
    Mar 10, 2022 at 15:05
  • 2
    @Braiam Topicality is not defined by subject matter alone. Questions that ask for off-site resources or are opinion based are both off-topic, even if about a “practical programming issue”. Off-topic and on-topic are only shorthands for “should be closed” or not. The exception are duplicates, that are on-topic and need be closed anyway. A question being “good one” or not is a matter of upvotes/downvotes, not of close/reopen votes.
    – yivi
    Mar 11, 2022 at 3:56
  • 1
    @yivi opinion based is not a matter of topic, opinion based will be opinion based here or in cooking.se. Off-site resources are not accepted because community guidance, but not because they aren't relevant to programming. I can ask for off site resources for cooking or chef-lang recipes, one is off topic, the other is on topic but not the kind of questions we want to support. Nothing in the help center refers to the topic. See this FR which is why off topic isn't used anymore.
    – Braiam
    Mar 11, 2022 at 13:52
  • @Braiam I won't repeat my last comment, I'll continue using 'off-topic' until a better alternative is presented. "not a good question" is not that. Bye.
    – yivi
    Mar 11, 2022 at 13:54
  • 1
    You already have one: unclear. The question is not off topic because is unclear. Is just unclear. A question that should be closed could be because it is: unclear, off topic, opinion based, too broad, duplicate, etc. Off topic is not a short hand for should be closed, off topic is one of the reasons why something should be closed. Closing is a short hand for "this question is not one that we want you to be asking"
    – Braiam
    Mar 11, 2022 at 14:39
5

Lets address your issues in order:

Are questions about testing software off topic?

No, they are not off topic. Testing software is something unique to software development, heck it's several specializations in software development depending on what and how it is tested.

Are questions without code off topic?

Again no. There are plenty of examples of questions that are on topic that has no code at all.

Can questions about testing something be answered without showing what should be tested?

Well, here's where the things gets dicey. You are asking us to test a black box without understanding what the black box is supposed to do. We don't have any indication of what is an acceptable or unacceptable set of inputs or outputs. When testing something, usually you test for many things: valid inputs, valid outputs given a specific input, error codes given invalid inputs, invalid outputs given valid inputs, etc. Without said knowledge, we can't tell you what the tests should look like.

We can't authoritatively answer that question, without that information, so that's why it was closed.

What can you ask instead? Well, try writing a test for something simple, and ask only when you have problem with that. Instead of asking us about how conceptually test something, ask about the code that you threw together that doesn't produce the desired result.

What I recommend you to do? Ask your supervisor about contracting someone who knows Lavarel and how to create unit tests in Lavarel.

You must log in to answer this question.

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