Calculate · Assess & Decide · Engineering
Defect density per module with ranked hotspots
Defect density per module against your chosen size unit, the overall density, and a ranking of the most defect-dense modules.
You receive: A reviewed defect-density calculator + the passing test report, run on your module defect and size counts.
Part of Ship MVP
Opens soon
Cost15 credits
AcceptanceAutomated check against your inputs
ProtectionHeld until verified delivery
This objective is verified and ready. It opens soon, once sign-in and payments are live.
Deliverable interface
The exact vocabulary the automated check enforces: keys, tokens, entry points, and worked examples. Generated from the verification source.
{
"constants": {},
"entryName": "compute_defect_density",
"expectNote": "expect is the comparison-space value (your return value goes through normalize first when one is published)",
"hiddenCaseCount": 6,
"hiddenCaseNames": [
"per_1000_loc",
"ranked_two_modules",
"rank_asc",
"tie_broken_by_name",
"overall_density",
"invalid_zero_size"
],
"inputKeys": [
"defects",
"density",
"modules",
"name",
"per_scale",
"rank_order",
"rounding_dp",
"size",
"size_unit"
],
"normalizeSource": "def _defect_density_normalize(r):\n if isinstance(r, str):\n return r # sentinel (invalid_module / invalid_size) passes through\n\n def n(v):\n return None if v is None else round(float(v), 6)\n try:\n return {\"rows\": [{\"name\": str(x[\"name\"]), \"density\": n(x[\"density\"])} for x in r[\"rows\"]],\n \"overall_density\": n(r[\"overall_density\"]), \"ranked\": [str(x) for x in r[\"ranked\"]]}\n except Exception:\n return repr(r)\n",
"returnShapes": [
[
"overall_density",
"ranked",
"rows"
],
"invalid_size",
"invalid_module"
],
"signature": "def compute_defect_density(inp):",
"submission": "python exposing the entry function; inp is one input object; graded on held-out cases",
"tier": "calculator",
"visibleCases": [
{
"expect": {
"overall_density": 0.02,
"ranked": [
"a"
],
"rows": [
{
"density": 0.02,
"name": "a"
}
]
},
"input": {
"modules": [
{
"defects": 20,
"name": "a",
"size": 1000
}
],
"per_scale": 1,
"size_unit": "LOC"
},
"name": "per_loc"
},
{
"expect": {
"overall_density": 20,
"ranked": [
"a"
],
"rows": [
{
"density": 20,
"name": "a"
}
]
},
"input": {
"modules": [
{
"defects": 20,
"name": "a",
"size": 1000
}
],
"per_scale": 1,
"size_unit": "KLOC"
},
"name": "per_kloc"
}
],
"vocabulary": [
"KLOC",
"defects",
"density",
"desc",
"invalid_module",
"invalid_size",
"modules",
"name",
"overall_density",
"per_scale",
"rank_order",
"ranked",
"rounding_dp",
"rows",
"size",
"size_unit"
]
}Get early access to STUD the day it goes live.