xp1632 / VPE_IP

0 stars 0 forks source link

Node_specification_unit_test #78

Open xp1632 opened 3 months ago

xp1632 commented 3 months ago

My basic knowledge of testing is based on code:


However, can people do a unit test for GUI? Here are several answers by searching


Strategies for GUI unit testing:

  1. 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.

  2. 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.

  3. 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.

  4. Checklist-Based Testing: This involves checking all the GUI elements for size, position, width, length, and acceptance of characters or numbers.

xp1632 commented 3 months ago

Intention for a GUI_unit_test for VP_Node_generation_pipeline

xp1632 commented 3 months ago

Current existing unit test in Visual programming Language project


image

image image


xp1632 commented 3 months ago

What we need to solve


Sure case:

  1. We can not Add Node into VP project
    • when clicking on the node on the search menu, nothing happens

Not so sure case

  1. The source code is correct, but the node is not working

What I want to say is:

xp1632 commented 3 months ago

Behavior-driven development


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

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