There is a particular requirement that has two versions. The first version has proven to be more challenging than the subsequent version to both describe the specification and compose; and also currently contains a known bug for only a specific inputs, though outputs the expected result for all other inputs. The second version produces the expected output for that specification.

Am considering posting a question containing both versions of the code for review.

I have read these, though I'm still not certain if posting a question that contains a known bug is on-topic for Code Review:

The prospective question will not ask how to fix the known bug. I would prefer to not have the question closed for being off-topic due to the known bug. I will fix the bug of the first version of the code/specification before posting a question here, if that is required.


  • Does the code in a question require there to be no known bugs?
  • If the question does not ask for the known bug to be addressed is the question on-topic for Code Review SE?
  • Should the bug be fixed before posting the question?
  • 2
    \$\begingroup\$ relevant Also a good test of readiness (sorry can't find source): Would you deploy the code to production with this known small bug? \$\endgroup\$
    – Summer
    Commented Dec 17, 2018 at 5:41
  • 1
    \$\begingroup\$ @bruglesco Relevant to the linked question and accepted answer list items 2, 3, 4 apply. That depends on the venue and what is meant by "deploy" and "production" in the given environment; e.g., a proof of concept does not need to be absolutely bug free to demonstrate that a specific requirement is possible; the "publication" of any code could strictly be considered "deploy" and "production". \$\endgroup\$ Commented Dec 17, 2018 at 6:43
  • \$\begingroup\$ A proof-of-concept usually borders on example code though. It still has to solve a stated problem statement the way it was intended. \$\endgroup\$
    – Mast Mod
    Commented Dec 18, 2018 at 15:00
  • \$\begingroup\$ @Mast Not sure what you mean by "borders on example code" relevant to a POC? The code for the first version of the specification solves the problem statement for all test cases except for two similar cases. Am aware of the line in the code which produces the bug. And again, the question will not be asking for a fix for that bug, but rather, whether the approaches used are sound as they are or can be improved. This question asks whether such an inquiry is on-topic at Code Review SE to avoid having this discussion at comments if the question is posted at main site. Can you answer this question? \$\endgroup\$ Commented Dec 18, 2018 at 15:10
  • \$\begingroup\$ Do you have a specific question in mind? \$\endgroup\$
    – Mast Mod
    Commented Dec 18, 2018 at 16:40
  • \$\begingroup\$ @Mast Yes, as described at OP. A question which asks for review of the implementations of two similar specifications to achieve a concrete task. One of the implementations currently contains a known bug that is evident for a specific test case. Though the question here will not be asking for a fix for that bug. \$\endgroup\$ Commented Dec 18, 2018 at 16:42
  • \$\begingroup\$ In short, you want us to talk about this question again? \$\endgroup\$
    – Mast Mod
    Commented Dec 18, 2018 at 16:46
  • \$\begingroup\$ @Mast No. The question is this users' own. \$\endgroup\$ Commented Dec 18, 2018 at 16:47
  • \$\begingroup\$ Do you have a link with your specific question? The links in your meta question refer to other meta questions. \$\endgroup\$
    – Mast Mod
    Commented Dec 18, 2018 at 16:48
  • \$\begingroup\$ @Mast Have not posted the question. Asked here at meta first if posted the question that contains the bug described above is on-topic for Code Review. \$\endgroup\$ Commented Dec 18, 2018 at 16:49
  • 1
    \$\begingroup\$ It depends, see my answer. If you have more questions, find me and other regulars in The 2nd Monitor. \$\endgroup\$
    – Mast Mod
    Commented Dec 18, 2018 at 17:05
  • \$\begingroup\$ @Mast Currently banned from chat at all SE sites. \$\endgroup\$ Commented Dec 18, 2018 at 17:18

1 Answer 1


If I read your question and the help center correctly, the code has to work as intended. If the bug prevents that, it's out. If the bug is considered acceptable, there is no problem.

Should the bug be fixed before posting the question?

If the bug prevents intended usage, absolutely. If not, it's still preferred.

However, it's all about expectations. If you describe there's plenty wrong with the code but all tested usage is within parameters and acceptable, it's surprisingly easy to ask a decent question about lousy code.

For example, take a look at an Elevator Management System work-in-progress I wrote years ago (and it's still not entirely finished). It did exactly what it had to at that point in time. No more, no less. The code quality is crap, it hardly does anything useful, but the base works and and all known behaviour was acceptable at that time. It completed the specification.

If your code fulfils the specification, it can be reviewed. However, if it has known-bugs preventing that, it isn't.

You have to realize though, a review about a buggy piece of code will be far less useful than a review on working code. Think about what you want to get out of a review and you might not get it under the best of circumstances. After all, a request for review is open-ended and you'll get what you get, not necessarily what you want.

Make sure you manage to make your question interesting enough to review despite the bugs it has.

  • \$\begingroup\$ Yes, the bug prevents intended usage for 2 of 16 test cases. \$\endgroup\$ Commented Dec 18, 2018 at 17:21
  • 2
    \$\begingroup\$ @guest271314 In that case I'd say it's too early for a review. Fix the code first, put it up for review after that. \$\endgroup\$
    – Mast Mod
    Commented Dec 18, 2018 at 17:40
  • \$\begingroup\$ Fixed the bugs. Running tests reveals another bug for another test case. Could very well be related to floating point rounding issues. \$\endgroup\$ Commented Dec 18, 2018 at 20:52
  • \$\begingroup\$ stackoverflow.com/questions/54433007 \$\endgroup\$ Commented Jan 30, 2019 at 4:56

You must log in to answer this question.

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