Accuracy for && and ||
See original GitHub issueHey,
in Java when the coverage is calculated it also checks if only one and
or or
statement in an if is called.
Currently as far as I can see this is not the case for solifidy coverage.
function check(string typeString, uint8 currentType)
private
pure
returns (bool)
{
return
(mapType(typeString, 2) == currentType && mapType(typeString, 4) == currentType ) ||
(mapType(typeString, 1) == currentType && mapType(typeString, 3) == currentType);
}
This is satisfied if it returns true and false once, even it has not been triggered with all possible combinations.
Maybe this is also just not displayed in the html report.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Part 1: Simple Definition and Calculation of Accuracy ... - NCBI
In this educational review, we will simply define and calculate the accuracy, sensitivity, and specificity of a hypothetical test. Definitions: Patient: ...
Read more >Classification: Accuracy | Machine Learning
Accuracy is one metric for evaluating classification models. Informally, accuracy is the fraction of predictions our model got right.
Read more >Accuracy, Precision, Recall or F1? | by Koo Ping Shung
Precision is a good measure to determine, when the costs of False Positive is high. For instance, email spam detection.
Read more >Accuracy & Precision in Data | Examples & Formula
Accuracy is how far off a measurement is from its true value. A measured value that's far from a true value is inaccurate,...
Read more >Accuracy Calculator
The accuracy calculator is a simple tool for calculating accuracy using three simple methods.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @rmeissner, thanks for raising this. (FWIW, a similar issue is open at Istanbul here.)
Agree this would increase accuracy and the
return
snippet you’ve provided is a nice example of where this could be useful.However, it would be quite difficult to implement with our current design which relies on injecting Solidity event statements into the source code before compilation and tracking the tests’ execution path at the
log
opcode in the VM. We’re constrained by Solidity’s grammar for conditionals.That said, we’re working on re-writing solidity-coverage to use in-memory source mappings and passively track the vm’s opcode step with a websocket subscription. This additional level of detail should be possible if that approach succeeds - definitely worth aiming for.
Thanks @frangio 😉