{ "uuid": [ { "value": "59cd5b64-d1c8-4249-ab41-2106e25df543" } ], "langcode": [ { "value": "en" } ], "type": [ { "target_id": "daily_email", "target_type": "node_type", "target_uuid": "8bde1f2f-eef9-4f2d-ae9c-96921f8193d7" } ], "revision_timestamp": [ { "value": "2025-05-11T09:00:28+00:00" } ], "revision_uid": [ { "target_type": "user", "target_uuid": "b8966985-d4b2-42a7-a319-2e94ccfbb849" } ], "revision_log": [], "status": [ { "value": true } ], "uid": [ { "target_type": "user", "target_uuid": "b8966985-d4b2-42a7-a319-2e94ccfbb849" } ], "title": [ { "value": "Is code coverage an objective or guideline?\n" } ], "created": [ { "value": "2023-11-02T00:00:00+00:00" } ], "changed": [ { "value": "2025-05-11T09:00:28+00:00" } ], "promote": [ { "value": false } ], "sticky": [ { "value": false } ], "default_langcode": [ { "value": true } ], "revision_translation_affected": [ { "value": true } ], "path": [ { "alias": "\/daily\/2023\/11\/02\/is-code-coverage-an-objective-or-guideline", "langcode": "en" } ], "body": [ { "value": "\n
Many development teams and projects use code coverage - e.g. how many lines of code are covered by automated tests - as an objective, and saying it must be 100% or another percentage.<\/p>\n\n
But is this an effective metric?<\/p>\n\n
In the same way as deleting failing tests to fix a pipeline, a code coverage amount can be faked.<\/p>\n\n
With this in mind, what if, instead of setting an objective such as 100% code coverage, you used it as a guideline?<\/p>\n\n
If you're working on a legacy project, what if you set a minimum code coverage amount as a guideline to ensure any new code has tests by not dropping under that level?<\/p>\n\n
Would that be better than saying every line of code needs to be covered?<\/p>\n\n
Code coverage is something I'm thinking of using more, so I want to know what you think.<\/p>\n\n ", "format": "full_html", "processed": "\n
Many development teams and projects use code coverage - e.g. how many lines of code are covered by automated tests - as an objective, and saying it must be 100% or another percentage.<\/p>\n\n
But is this an effective metric?<\/p>\n\n
In the same way as deleting failing tests to fix a pipeline, a code coverage amount can be faked.<\/p>\n\n
With this in mind, what if, instead of setting an objective such as 100% code coverage, you used it as a guideline?<\/p>\n\n
If you're working on a legacy project, what if you set a minimum code coverage amount as a guideline to ensure any new code has tests by not dropping under that level?<\/p>\n\n
Would that be better than saying every line of code needs to be covered?<\/p>\n\n
Code coverage is something I'm thinking of using more, so I want to know what you think.<\/p>\n\n ", "summary": null } ], "feeds_item": [ { "imported": "1970-01-01T00:33:45+00:00", "guid": null, "hash": "37779b8be562eca580a1d3eb2ead9f83", "target_type": "feeds_feed", "target_uuid": "90c85284-7ca8-4074-9178-97ff8384fe76" } ] }