SWTBot vs. Unit Testing

We use SWTBot to write functional tests. It is very difficult to test some cases, and some programmers use classes and their methods directly from the implementation (for example, methods of calling from a class AddUserDialog, etc.). Is this a good approach? And why?

And the next qustion please. Is this SWTBot enough to test an application based on Eclipse RCP? Do I need to write unit tests, please?

Note. We are a wrestling team.

+4
source share
1 answer

SWTBot and JUnit serve for different purposes.

Junit

, JUnit . . , .

() . :

, TDD, . . , . , . , , TDD, , , . , .

RCP ( ). , PDE JUnit, JUnit. API RCP.

. : JUnit Eclipse RCP

SWTBot

SWTBot JUnit , . SWTBot RCP . , , . Rules .

SWTBot . , , SWTBot , , OK. SWTBot .

, SWTBot . , , OK. , SWTBot:

dialog.textField.setText( "data" );
dialog.okButton.notifyListeners( SWT.Selection, null );

assertThat( dialog.getEnteredData() ).isEqualTo( "data" );

, , , , .

, , , , .

+7

Source: https://habr.com/ru/post/1615648/


All Articles