-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Labels
FeatNew feature or requestNew feature or requestUphillNeeds research before being implementedNeeds research before being implemented
Description
It would be interesting to find a way to specify the coverage used while building a tree (and reflect it in the test contract name or top-level comment).
For instance, for the following function and coverage type, we'd scaffold 2 tests contracts which we could name Foo_Test_Branch
and Foo_Test_FullPath
bool foo (bool x, bool y) {
if (a && b) {
return true;
}
return false;
}
based on the following coverages (amongst other possibilities):
- branch coverage: where we're assessing if we covered every result of every decision structure (tested both true and false in an if for instance)
flowchart TD
A[foo] --> C{a && b}
C -->|True| D[return true]
C -->|False| E[return false]
with the tree
TestMe::foo(branch)
├── when a and b are true
│ └── it should return true
└── when a is false
└── it should return false
- path coverage: where we're assessing if we are covering each flow within the function under test
flowchart TD
A[foo] --> C{a}
C -->|True| D{b}
C -->|False| E{b}
D -->|True| F(true)
D -->|False| G(false)
E -->|False| H(false)
E -->|False| I(false)
with the following tree
TestMe::foo(full path)
├── given a is true
│ ├── when b is true
│ │ └── it should return true
│ └── when b is false
│ └── it should return false
└── given a is false
├── when b is true
│ └── it should return false
└── when b is false
└── it should return false
Metadata
Metadata
Assignees
Labels
FeatNew feature or requestNew feature or requestUphillNeeds research before being implementedNeeds research before being implemented