Let's suppose a developer writes software for a company which wants to open source the project. One might assume that the knowledge of the code being publicly available might have a psychological effect on the developer. This might lead him to writing higher quality code than if it was just an internal project where only a few members could read the code.

Are there studies that conclude such a behaviour or prove that this is not the case? I'm thinking of something like the Hawthorne Effect, where individuals modify their behaviour, because they are aware that they are under observation. In this case the individual is not under observation, but rather the result of his/her work.

  • 2
    Is there a generally-agreed metric for quality of code? Without that, I would think it's going to be difficult to answer this question with any degree of rigour.
    – MadHatter
    Oct 28 '19 at 16:19
  • 1
    I think what you are asking about is referred to as Linus's Law coined by Eric Raymond "ESR". More information in that article.
    – Brandin
    Oct 29 '19 at 14:30
  • @MadHatter, how about "bugs per statement"? That seems like an objective measurement that is independent of style issues. If you want, count only the bugs that made it into a release. Oct 29 '19 at 16:13
  • @BartvanIngenSchenau excellent idea, but I didn't ask if it were possible; I asked if there was a generally-agreed metric, because if there isn't, there won't be any studies. If you have reason to believe that bugs-per-statement is a widely-used metric, I'd love to know it.
    – MadHatter
    Oct 29 '19 at 18:58
  • @BartvanIngenSchenau You might make this objective by clarifying it as "defects per statement, where defect is defined as a deviation between actual and expected results." But in practice, this will requite 100% code coverage with tests, which is rare. Even if you have complete code coverage, there are often unexpected cases. For example, what if the code delivers expected results on Linux and Windows, but deviates from expected results on macOS? Is it a defect? Is it 1/3 of a defect?
    – Brandin
    Oct 30 '19 at 11:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.