Open xp1632 opened 3 months ago
The test is based on checking:
expectation source code
from the ${}
formatted code based on assertion in nodeExecCheck
stderror
Sure case:
Add Node
into VP project
Not so sure case
What I want to say is:
source code checking
is enough for checking if a JSON file could be a working Visual Node in VPWhile learning refactoring, I get to know the term BDD, Behavior-driven development
https://en.wikipedia.org/wiki/Behavior-driven_development
this method test the software by desired behavior
one short example of desired behavior
:
Given: the initial context at the beginning of the scenario, in one or more clauses; When: the event that triggers the scenario; Then: the expected outcome, in one or more clauses.
- A more concrete example for our pipeline is :
Given : user input the information we need for one visual node specification: correct code snippet to run it, op name, input name, output name When: all information is feed into pipeline v1 Then: the specific information is extracted and formatted, and output the final visual node specification
- Main Purpose of this Pipeline v1.0
- Fei's proposal's Pipeline v2.0
However, Fei proposed to make this pipeline batch
for 100 nodes
based on BDD, I can roughly describe his desired scenario
Given: user inputs nothing, we get everything including the code snippet to call the plugin from a library,
When: we process the information from library's every method
Then: we get a batch
of visual nodes for VP project
Again, this batch method could be working, but the cost is the robustness of if this node is functioning when we generate it by a uniformed code snippet, while the op callings in ImageJ itself is not quite uniformed
My basic knowledge of testing is based on code:
expected
a certain result and get compare the current result with expected resultHowever, can people do a unit test for GUI? Here are several answers by searching
Strategies for GUI unit testing:
Model-View-Controller (MVC) or Model-View-Presenter (MVP) Design Patterns: These design patterns aim to separate the logic from the GUI as much as possible. This allows you to unit test the logic independently of the GUI.
Testing Small Units of GUI Behavior: You can write tests for small units of GUI behavior. For example, if your application includes graphs, you might have functions that calculate different shades of a color based on a ‘base’ color. You can extract this calculation to a function and write a unit test for it.
GUI Testing Tools: There are tools available that can help with GUI testing. For example, pytest-gui is a GUI-based test runner for Python Unittests and py.tests.
Checklist-Based Testing: This involves checking all the GUI elements for size, position, width, length, and acceptance of characters or numbers.