You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many unit tests we use in our codebase use Table Driven Tests (TDT)
The idea is to create a table of test cases containing input, expected output for better maintainability and visualisation.
In many of these tests, we perform first initialization before the table declaration. Most of the time, initialization of coordinators, chains, etc...
This context initialization makes our tests less in the idea of TDT where the whole purpose of a test case should be visualized in the test case itself and make the tests less visual and maintainable.
The idea would be to investigate how we could incorporate the context initialization in the test case itself as the initial state of the test case. For example, describing the list of coordinators in the test case, the coordinators are then initialized in the body of the TDT
lumtis
added
Epic
Epic issue
and removed
research
The task implies doing research and proposing a solution before implementation
labels
Jun 9, 2022
lumtis
changed the title
Investigate Table-Driven-Tests improvement to remove context initialization
Table-Driven-Tests (TDT) improvement to remove context initialization
Jun 9, 2022
#540 (comment)
Many unit tests we use in our codebase use Table Driven Tests (TDT)
The idea is to create a table of test cases containing
input, expected output
for better maintainability and visualisation.In many of these tests, we perform first initialization before the table declaration. Most of the time, initialization of coordinators, chains, etc...
This context initialization makes our tests less in the idea of TDT where the whole purpose of a test case should be visualized in the test case itself and make the tests less visual and maintainable.
The idea would be to investigate how we could incorporate the context initialization in the test case itself as the initial state of the test case. For example, describing the list of coordinators in the test case, the coordinators are then initialized in the body of the TDT
Example:
would become
Implementation example:
Test for
claim
CompleteMission
:spn/x/claim/keeper/mission_test.go
Line 63 in d828285
I'm open to any feedback, suggestion, critic on this implementation
Tasks
profile
#854launch
#855campaign
#856reward
#857monitoringc
#858monitoringp
#859participation
#860The text was updated successfully, but these errors were encountered: