The Inaccuracy of Uniform Counting in Software Metrics: Empirical Evidence with a Weighted Remedy

preprint OA: closed
Full text JSON View at publisher
Full text 12,274 characters · extracted from preprint-html · click to expand
The Inaccuracy of Uniform Counting in Software Metrics: Empirical Evidence with a Weighted Remedy | Research Square window.SnipcartSettings = { analytics: { enabled: false } }; (function() { var accessVector = localStorage.getItem('access_vector') || ''; window.dataLayer = window.dataLayer || []; if (accessVector) { window.dataLayer.push({ user: { profile: { profileInfo: { snid: accessVector } } } }); } })(); (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-K279D39R'); Browse Preprints In Review Journals COVID-19 Preprints AJE Video Bytes Research Tools Research Promotion AJE Professional Editing AJE Rubriq About Preprint Platform In Review Editorial Policies Our Team Advisory Board Help Center Sign In Submit a Preprint Cite Share Download PDF Research Article The Inaccuracy of Uniform Counting in Software Metrics: Empirical Evidence with a Weighted Remedy Gholamali Nejad Hajali Irani This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-7199152/v1 This work is licensed under a CC BY 4.0 License Status: Published Journal Publication published 22 Aug, 2025 Read the published version in Iran Journal of Computer Science → Version 1 posted 9 You are reading this latest preprint version Abstract Count-based metrics count the number of internal elements of a class, e.g., attributes, methods, and their interactions. Such metrics are used in a variety of areas of software engineering, e.g., measuring cohesion, detecting God Classes, and refactoring assistance. This paper criticizes the shortsightedness of the metrics and proves by statistical testing that the same treatment for all the number of class elements causes them to be measured with error. We introduce weighted and context-sensitive measures to overcome these limitations. A weighting system based on scientific literature and expert feedback is utilized within our method to emphasize the deficiencies of standard measures. Using Sahand 2.0, the fine-grained code analysis tool developed specifically to perform fine-grained code analysis, we executed three big Java open-source projects (RxJava, jmt, and Hibernate), and the result showed that our proposed weighting model detects bias over uniform couting. Even though our approach is promising, calculation of optimal weights remains problematic due to the subjective nature of expert-set weights and demands for further extensive validation. Our findings emphasize that more advanced methods, such as data-driven weight calculation or machine learning, are still needed to achieve more sustainable and trustworthy software systems. Object-Oriented Design Software Metrics Quality Attributes Class Cohesion Refactoring Full Text Additional Declarations No competing interests reported. Cite Share Download PDF Status: Published Journal Publication published 22 Aug, 2025 Read the published version in Iran Journal of Computer Science → Version 1 posted Editorial decision: Revision requested 30 Jul, 2025 Reviews received at journal 30 Jul, 2025 Reviewers agreed at journal 30 Jul, 2025 Reviews received at journal 30 Jul, 2025 Reviewers agreed at journal 30 Jul, 2025 Reviewers invited by journal 28 Jul, 2025 Editor assigned by journal 28 Jul, 2025 Submission checks completed at journal 24 Jul, 2025 First submitted to journal 23 Jul, 2025 You are reading this latest preprint version Research Square lets you share your work early, gain feedback from the community, and start making changes to your manuscript prior to peer review in a journal. As a division of Research Square Company, we’re committed to making research communication faster, fairer, and more useful. We do this by developing innovative software and high quality services for the global research community. Our growing team is made up of researchers and industry professionals working together to solve the most critical problems facing scientific publishing. Also discoverable on Platform About Our Team In Review Editorial Policies Advisory Board Help Center Resources Author Services Accessibility API Access RSS feed Manage Cookie Preferences © Research Square 2026 | ISSN 2693-5015 (online) Privacy Policy Terms of Service Do Not Sell My Personal Information {"props":{"pageProps":{"initialData":{"identity":"rs-7199152","acceptedTermsAndConditions":true,"allowDirectSubmit":false,"archivedVersions":[],"articleType":"Research Article","associatedPublications":[],"authors":[{"id":492125198,"identity":"6bc9c5ef-67a6-43f4-b95d-5b827f2be8ea","order_by":0,"name":"Gholamali Nejad Hajali Irani","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAwUlEQVRIiWNgGAWjYBACNhCRUPEHSPIgiRDWcuYYCVrAgLHtMEILQcAnffjZg4fzjsmZs589JsFQYwcUOUDAYXxp5gaJ2/4YW/bkpUkwHEsGiiQQ0MLDYCaRuO1Y4oYDOWYSDGwHQCKEtLB/k0icczhxw/k3QC3/iNLCA7SlAajlBtAWxjbitJRJJBw7Zmxw412yRWJfMg9BLfI97Nskf9T8kTM4n3vwxodvdnLyPQS0oIIE4mNnFIyCUTAKRgE+AAA+XDkZcRGLUwAAAABJRU5ErkJggg==","orcid":"","institution":"University of Bonab","correspondingAuthor":true,"prefix":"","firstName":"Gholamali","middleName":"Nejad Hajali","lastName":"Irani","suffix":""}],"badges":[],"createdAt":"2025-07-23 18:38:20","currentVersionCode":1,"declarations":"","doi":"10.21203/rs.3.rs-7199152/v1","doiUrl":"https://doi.org/10.21203/rs.3.rs-7199152/v1","draftVersion":[],"editorialEvents":[{"content":"https://doi.org/10.1007/s42044-025-00319-8","type":"published","date":"2025-08-22T16:28:55+00:00"}],"editorialNote":"","failedWorkflow":false,"files":[{"id":89847559,"identity":"4164daba-71db-46b1-b402-27300d8900a5","added_by":"auto","created_at":"2025-08-25 16:43:42","extension":"pdf","order_by":1,"title":"","display":"","copyAsset":false,"role":"manuscript-pdf","size":748368,"visible":true,"origin":"","legend":"","description":"","filename":"00InaccuracyofUniformCounting.pdf","url":"https://assets-eu.researchsquare.com/files/rs-7199152/v1_covered_1215ce96-1323-4ce4-9fb1-5905b5bcd05a.pdf"}],"financialInterests":"No competing interests reported.","formattedTitle":"The Inaccuracy of Uniform Counting in Software Metrics: Empirical Evidence with a Weighted Remedy","fulltext":[],"fulltextSource":"","fullText":"","funders":[],"hasAdminPriorityOnWorkflow":false,"hasManuscriptDocX":false,"hasOptedInToPreprint":true,"hasPassedJournalQc":"","hasAnyPriority":false,"hideJournal":false,"highlight":"","institution":"","isAcceptedByJournal":true,"isAuthorSuppliedPdf":true,"isDeskRejected":"","isHiddenFromSearch":false,"isInQc":false,"isInWorkflow":false,"isPdf":true,"isPdfUpToDate":true,"isWithdrawnOrRetracted":false,"journal":{"display":true,"email":"[email protected]","identity":"iran-journal-of-computer-science","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":false,"externalIdentity":"ircs","sideBox":"Learn more about [Iran Journal of Computer Science](https://link.springer.com/journal/42044)","snPcode":"42044","submissionUrl":"https://submission.nature.com/new-submission/42044/3","title":"Iran Journal of Computer Science","twitterHandle":"","acdcEnabled":true,"dfaEnabled":true,"editorialSystem":"em","reportingPortfolio":"Springer Hybrid","inReviewEnabled":true,"inReviewRevisionsEnabled":false},"keywords":"Object-Oriented Design, Software Metrics, Quality Attributes, Class Cohesion, Refactoring","lastPublishedDoi":"10.21203/rs.3.rs-7199152/v1","lastPublishedDoiUrl":"https://doi.org/10.21203/rs.3.rs-7199152/v1","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"manuscriptAbstract":"\u003cp\u003eCount-based metrics count the number of internal elements of a class, e.g., attributes, methods, and their interactions. Such metrics are used in a variety of areas of software engineering, e.g., measuring cohesion, detecting God Classes, and refactoring assistance. This paper criticizes the shortsightedness of the metrics and proves by statistical testing that the same treatment for all the number of class elements causes them to be measured with error. We introduce weighted and context-sensitive measures to overcome these limitations. A weighting system based on scientific literature and expert feedback is utilized within our method to emphasize the deficiencies of standard measures. Using Sahand 2.0, the fine-grained code analysis tool developed specifically to perform fine-grained code analysis, we executed three big Java open-source projects (RxJava, jmt, and Hibernate), and the result showed that our proposed weighting model detects bias over uniform couting. Even though our approach is promising, calculation of optimal weights remains problematic due to the subjective nature of expert-set weights and demands for further extensive validation. Our findings emphasize that more advanced methods, such as data-driven weight calculation or machine learning, are still needed to achieve more sustainable and trustworthy software systems.\u003c/p\u003e","manuscriptTitle":"The Inaccuracy of Uniform Counting in Software Metrics: Empirical Evidence with a Weighted Remedy","msid":"","msnumber":"","nonDraftVersions":[{"code":1,"date":"2025-07-30 12:36:03","doi":"10.21203/rs.3.rs-7199152/v1","editorialEvents":[{"type":"communityComments","content":0},{"type":"decision","content":"Revision requested","date":"2025-07-30T19:51:09+00:00","index":"","fulltext":""},{"type":"editorInvitedReview","content":"","date":"2025-07-30T19:50:28+00:00","index":"hide","fulltext":""},{"type":"reviewerAgreed","content":"39378895767080049054959145582958852240","date":"2025-07-30T19:42:56+00:00","index":"hide","fulltext":""},{"type":"editorInvitedReview","content":"","date":"2025-07-30T19:42:19+00:00","index":"hide","fulltext":""},{"type":"reviewerAgreed","content":"311778109885166883700421532098572819553","date":"2025-07-30T19:39:31+00:00","index":"hide","fulltext":""},{"type":"reviewersInvited","content":"","date":"2025-07-28T16:14:09+00:00","index":"","fulltext":""},{"type":"editorAssigned","content":"","date":"2025-07-28T16:13:13+00:00","index":"","fulltext":""},{"type":"checksComplete","content":"","date":"2025-07-24T13:06:57+00:00","index":"","fulltext":""},{"type":"submitted","content":"Iran Journal of Computer Science","date":"2025-07-23T18:36:55+00:00","index":"","fulltext":""}],"status":"published","journal":{"display":true,"email":"[email protected]","identity":"iran-journal-of-computer-science","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":false,"externalIdentity":"ircs","sideBox":"Learn more about [Iran Journal of Computer Science](https://link.springer.com/journal/42044)","snPcode":"42044","submissionUrl":"https://submission.nature.com/new-submission/42044/3","title":"Iran Journal of Computer Science","twitterHandle":"","acdcEnabled":true,"dfaEnabled":true,"editorialSystem":"em","reportingPortfolio":"Springer Hybrid","inReviewEnabled":true,"inReviewRevisionsEnabled":false}}],"origin":"","ownerIdentity":"7768b769-03eb-4da9-b489-29712244414a","owner":[],"postedDate":"July 30th, 2025","published":true,"recentEditorialEvents":[],"rejectedJournal":[],"revision":"","amendment":"","status":"published-in-journal","subjectAreas":[],"tags":[],"updatedAt":"2025-08-25T16:38:37+00:00","versionOfRecord":{"articleIdentity":"rs-7199152","link":"https://doi.org/10.1007/s42044-025-00319-8","journal":{"identity":"iran-journal-of-computer-science","isVorOnly":false,"title":"Iran Journal of Computer Science"},"publishedOn":"2025-08-22 16:28:55","publishedOnDateReadable":"August 22nd, 2025"},"versionCreatedAt":"2025-07-30 12:36:03","video":"","vorDoi":"10.1007/s42044-025-00319-8","vorDoiUrl":"https://doi.org/10.1007/s42044-025-00319-8","workflowStages":[]},"version":"v1","identity":"rs-7199152","journalConfig":"researchsquare"},"__N_SSP":true},"page":"/article/[identity]/[[...version]]","query":{"redirect":"/article/rs-7199152","identity":"rs-7199152","version":["v1"]},"buildId":"8U1c8b4HqxoKbykW_rLl7","isFallback":false,"isExperimentalCompile":false,"dynamicIds":[84888],"gssp":true,"scriptLoader":[]}

Text is read by the "Ask this paper" AI Q&A widget below. Extraction quality varies by source — PMC NXML preserves structure cleanly, OA-HTML may include some navigation residue, and OA-PDF can have broken hyphenation. The publisher copy (via DOI) is the canonical version.

My notes (saved in your browser only)

Ask this paper AI returns verbatim quotes from the full text · source: preprint-html

Answers must be backed by verbatim quotes from this paper's full text. Hallucinated quotes are dropped automatically; if no verbatim passage answers the question, we say so. How this works

Citation neighborhood (no data yet)

We don't have any in-corpus citations linked to this paper yet. This is a recent paper (2025) — citers typically take a year or two to land, and the OpenAlex reference graph may still be filling in.

Source provenance

europepmc
last seen: 2026-05-20T01:45:00.602351+00:00