hildSpacing(first);max-width:100%;min-width:1.8em;overflow:hidden;text-align:center;text-overflow:ellipsis;transition:inherit;white-space:nowrap}.StylableButton2545352419__root.StylableButton2545352419--isMaxContent .StylableButton2545352419__label{text-overflow:unset}.StylableButton2545352419__root.StylableButton2545352419--isWrapText .StylableButton2545352419__label{min-width:10px;overflow-wrap:break-word;white-space:break-spaces;word-break:break-word}.StylableButton2545352419__icon{-archetype:icon;-controller-part-type:LayoutChildDisplayDropdown,LayoutFlexChildSpacing(last);flex-shrink:0;height:50px;min-width:1px;transition:inherit}.StylableButton2545352419__icon.StylableButton2545352419--override{display:block!important}.StylableButton2545352419__icon svg,.StylableButton2545352419__icon>span{display:flex;height:inherit;width:inherit}.StylableButton2545352419__root:not(:hover):not([disalbed]).StylableButton2545352419--hasIconColor .StylableButton2545352419__icon svg{fill:var(--corvid-icon-color)!important;stroke:var(--corvid-icon-color)!important}.StylableButton2545352419__root:hover:not([disabled]).StylableButton2545352419--hasHoverIconColor .StylableButton2545352419__icon svg{fill:var(--corvid-hover-icon-color)!important;stroke:var(--corvid-hover-icon-color)!important}.StylableButton2545352419__root:not(:hover)[disabled].StylableButton2545352419--hasDisabledIconColor .StylableButton2545352419__icon svg{fill:var(--corvid-disabled-icon-color)!important;stroke:var(--corvid-disabled-icon-color)!important}.a9YhBi{bottom:0;left:0;position:absolute;right:0;top:0}.dX12nb{cursor:pointer}.AKxYR5{-webkit-tap-highlight-color:rgba(0,0,0,0);fill:var(--corvid-fill-color,var(--fill));fill-opacity:var(--fill-opacity);stroke:var(--corvid-stroke-color,var(--stroke));stroke-opacity:var(--stroke-opacity);stroke-width:var(--stroke-width);filter:var(--drop-shadow,none);opacity:var(--opacity);transform:var(--flip)}.AKxYR5,.AKxYR5 svg{bottom:0;left:0;position:absolute;right:0;top:0}.AKxYR5 svg{height:var(--svg-calculated-height,100%);margin:auto;padding:var(--svg-calculated-padding,0);width:var(--svg-calculated-width,100%)}.AKxYR5 svg:not([data-type=ugc]){overflow:visible}.VZYmYf *{vector-effect:non-scaling-stroke}@supports(-webkit-hyphens:none){.AKxYR5.vv0uGt{will-change:filter}}.HcOXKn{-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%}ol.font_100,ul.font_100{color:#080808;font-family:"Arial, Helvetica, sans-serif",serif;font-size:10px;font-style:normal;font-variant:normal;font-weight:400;letter-spacing:normal;line-height:normal;margin:0;text-decoration:none}ol.font_100 li,ul.font_100 li{margin-bottom:12px}ol.wix-list-text-align,ul.wix-list-text-align{list-style-position:inside}ol.wix-list-text-align h1,ol.wix-list-text-align h2,ol.wix-list-text-align h3,ol.wix-list-text-align h4,ol.wix-list-text-align h5,ol.wix-list-text-align h6,ol.wix-list-text-align p,ul.wix-list-text-align h1,ul.wix-list-text-align h2,ul.wix-list-text-align h3,ul.wix-list-text-align h4,ul.wix-list-text-align h5,ul.wix-list-text-align h6,ul.wix-list-text-align p{display:inline}.ONIxfn{cursor:pointer}.WUKwEB{clip:rect(0 0 0 0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.QxJLC3 [data-attr-richtext-marker=true]{display:block}.QxJLC3 [data-attr-richtext-marker=true] table{border-collapse:collapse;margin:15px 0;width:100%}.QxJLC3 [data-attr-richtext-marker=true] table td{padding:12px;position:relative}.QxJLC3 [data-attr-richtext-marker=true] table td:after{border-bottom:1px solid currentColor;border-left:1px solid currentColor;bottom:0;content:"";left:0;opacity:.2;position:absolute;right:0;top:0}.QxJLC3 [data-attr-richtext-marker=true] table tr td:last-child:after{border-right:1px solid currentColor}.QxJLC3 [data-attr-richtext-marker=true] table tr:first-child td:after{border-top:1px solid currentColor}@supports(-webkit-appearance:none) and (stroke-color:transparent){.lq2cno>*>:first-child{vertical-align:top}}@supports(-webkit-touch-callout:none){.lq2cno>*>:first-child{vertical-align:top}}.SlP1QZ :is(p,h1,h2,h3,h4,h5,h6,blockquote,ul,ol) [class$=rich-text__text],.SlP1QZ :is(p,h1,h2,h3,h4,h5,h6,blockquote,ul,ol)[class$=rich-text__text]{color:var(--corvid-color,currentColor)}.SlP1QZ :is(p,h1,h2,h3,h4,h5,h6,blockquote,ul,ol) span[style*=color]{color:var(--corvid-color,currentColor)!important}.uGVkMG{direction:var(--text-direction);min-height:var(--min-height);min-width:var(--min-width)}.uGVkMG .edKzOf{word-wrap:break-word;height:100%;overflow-wrap:break-word;position:relative;width:100%}.uGVkMG .edKzOf ul{list-style:disc inside}.uGVkMG .edKzOf li{margin-bottom:12px}.SxM0TO blockquote,.SxM0TO h1,.SxM0TO h2,.SxM0TO h3,.SxM0TO h4,.SxM0TO h5,.SxM0TO h6,.SxM0TO p{letter-spacing:normal;line-height:normal}.nJYhU3{min-height:var(--min-height);min-width:var(--min-width)}.nJYhU3 .edKzOf{word-wrap:break-word;height:100%;overflow-wrap:break-word;position:relative;width:100%}.nJYhU3 .edKzOf ol,.nJYhU3 .edKzOf ul{letter-spacing:normal;line-height:normal;margin-inline-start:.5em;padding-inline-start:1.3em}.nJYhU3 .edKzOf ul{list-style-type:disc}.nJYhU3 .edKzOf ol{list-style-type:decimal}.nJYhU3 .edKzOf ol ul,.nJYhU3 .edKzOf ul ul{line-height:normal;list-style-type:circle}.nJYhU3 .edKzOf ol ol ul,.nJYhU3 .edKzOf ol ul ul,.nJYhU3 .edKzOf ul ol ul,.nJYhU3 .edKzOf ul ul ul{line-height:normal;list-style-type:square}.nJYhU3 .edKzOf li{font-style:inherit;font-weight:inherit;letter-spacing:normal;line-height:inherit}.nJYhU3 .edKzOf h1,.nJYhU3 .edKzOf h2,.nJYhU3 .edKzOf h3,.nJYhU3 .edKzOf h4,.nJYhU3 .edKzOf h5,.nJYhU3 .edKzOf h6,.nJYhU3 .edKzOf p{letter-spacing:normal;line-height:normal;margin-block:0;margin:0}.nJYhU3 .edKzOf a{color:inherit}.SxM0TO,.c9GqVL{word-wrap:break-word;direction:var(--text-direction);min-height:var(--min-height);min-width:var(--min-width);mix-blend-mode:var(--blendMode,normal);overflow-wrap:break-word;pointer-events:none;text-align:start;text-shadow:var(--textOutline,0 0 transparent),var(--textShadow,0 0 transparent);text-transform:var(--textTransform,"none")}.SxM0TO>*,.c9GqVL>*{pointer-events:auto}.SxM0TO li,.c9GqVL li{font-style:inherit;font-weight:inherit;letter-spacing:normal;line-height:inherit}.SxM0TO ol,.SxM0TO ul,.c9GqVL ol,.c9GqVL ul{letter-spacing:normal;line-height:normal;margin-inline-end:0;margin-inline-start:.5em}.SxM0TO:not(.YQcXTT) ol,.SxM0TO:not(.YQcXTT) ul,.c9GqVL:not(.YQcXTT) ol,.c9GqVL:not(.YQcXTT) ul{padding-inline-end:0;padding-inline-start:1.3em}.SxM0TO ul,.c9GqVL ul{list-style-type:disc}.SxM0TO ol,.c9GqVL ol{list-style-type:decimal}.SxM0TO ol ul,.SxM0TO ul ul,.c9GqVL ol ul,.c9GqVL ul ul{list-style-type:circle}.SxM0TO ol ol ul,.SxM0TO ol ul ul,.SxM0TO ul ol ul,.SxM0TO ul ul ul,.c9GqVL ol ol ul,.c9GqVL ol ul ul,.c9GqVL ul ol ul,.c9GqVL ul ul ul{list-style-type:square}.SxM0TO blockquote,.SxM0TO h1,.SxM0TO h2,.SxM0TO h3,.SxM0TO h4,.SxM0TO h5,.SxM0TO h6,.SxM0TO p,.c9GqVL blockquote,.c9GqVL h1,.c9GqVL h2,.c9GqVL h3,.c9GqVL h4,.c9GqVL h5,.c9GqVL h6,.c9GqVL p{margin-block:0;margin:0}.SxM0TO a,.c9GqVL a{color:inherit}.YQcXTT li{margin-inline-end:0;margin-inline-start:1.3em}.Vd6aQZ{overflow:hidden;padding:0;pointer-events:none;white-space:nowrap}.mHZSwn{display:none}.lvxhkV{bottom:0;left:0;position:absolute;right:0;top:0;width:100%}.QJjwEo{transform:translateY(-100%);transition:.2s ease-in}.kdBXfh{transition:.2s}.MP52zt{opacity:0;transition:.2s ease-in}.MP52zt.Bhu9m5{z-index:-1!important}.LVP8Wf{opacity:1;transition:.2s}.VrZrC0{height:auto}.VrZrC0,.cKxVkc{position:relative;width:100%}:host(:not(.device-mobile-optimized)) .vlM3HR,body:not(.device-mobile-optimized) .vlM3HR{margin-left:calc((100% - var(--site-width))/2);width:var(--site-width)}.AT7o0U[data-focuscycled=active]{outline:1px solid transparent}.AT7o0U[data-focuscycled=active]:not(:focus-within){outline:2px solid transparent;transition:outline .01s ease}.AT7o0U .vlM3HR{bottom:0;left:0;position:absolute;right:0;top:0}.HlRz5e{display:block;height:100%;width:100%}.HlRz5e img{max-width:var(--wix-img-max-width,100%)}.HlRz5e[data-animate-blur] img{filter:blur(9px);transition:filter .8s ease-in}.HlRz5e[data-animate-blur] img[data-load-done]{filter:none}.I5zqsT{display:block;height:100%;width:100%}.WzbAF8 .mpGTIt .O6KwRn{display:var(--item-display);height:var(--item-size);margin:var(--item-margin);width:var(--item-size)}.WzbAF8 .mpGTIt .O6KwRn:last-child{margin:0}.WzbAF8 .mpGTIt .O6KwRn .oRtuWN{display:block}.WzbAF8 .mpGTIt .O6KwRn .oRtuWN .YaS0jR{height:var(--item-size);width:var(--item-size)}.WzbAF8 .mpGTIt{height:100%;position:absolute;white-space:nowrap;width:100%}:host(.device-mobile-optimized) .WzbAF8 .mpGTIt,body.device-mobile-optimized .WzbAF8 .mpGTIt{white-space:normal}.big2ZD{display:grid;grid-template-columns:1fr;grid-template-rows:1fr;height:calc(100% - var(--wix-ads-height));left:0;margin-top:var(--wix-ads-height);position:fixed;top:0;width:100%}.SHHiV9,.big2ZD{pointer-events:none;z-index:var(--pinned-layer-in-container,var(--above-all-in-container))}
top of page

Code coverage is a bad metric 👎

Updated: Aug 25



It is often seen as the gold standard for testing, but is it really? 🤷‍♂️


Unfortunately, test coverage does not reflect how well the code is tested. All test coverage does is show the amount of lines of code executed. It does not indicate that the functionality under test is actually correct.


In fact, you can achieve 100% of test coverage without actually testing anything. How? By simply not doing assertions in your tests, but still invoking the methods.


Test coverage is a good negative metric, but a bad positive one. Test coverage is useful for highlighting gaps (e.g., 0% coverage signals untested code), but it can be misleading when used to claim thorough testing.


A bit of an improvement over line coverage is branch coverage. The branch coverage report indicates the amount of conditional statements traversed. This metric is a bit harder to “trick” in comparision to line coverage. 


However, even branch coverage does not guarantee the quality of your tests. The only way to do it is to actually write the proper assertions that verify relevant outcomes.


🚨 So, don’t be fooled by high test coverage, it does not guarantee in any way that the code is safe. Write tests that verify the needed outcomes and run them often, preferrably on your CI / CD. ✅


Focus on writing meaningful tests with solid assertions. High coverage is nice, but it’s quality testing that keeps your code safe.

19 views0 comments

Comments


bottom of page