Research Article

Performance Analysis of Spotify® for Android with Model-Based Testing

Listing 2

Extract of test cases translated into a Java program.
(1) // Transition 16: previous next S0 on view PrincipalView
(2) public void TestSpotifyclicSearch16 () throws UiObjectNotFoundException  
(3) UiObject control = new UiObject (new UiSelector ().
(4) className (" android. widget.TextView ")
(5) .index (0).textContains (" Search "));
(6) control. click ();
(7) Log.v(" DRACODROID ", " CONTROL - clicSearch: " + reportDate);
(8) //...
(9)
(10)
(11) // Transition 17: previous next S0 on view SearchView
(12) public void TestSpotifysetTitlePopular17 () throws UiObjectNotFoundException
(13) UiObject control = new UiObject (new UiSelector ().
(14) className (" android. widget.EditText ")
(15) .index (0).textContains (" Search "));
(16) control.setText (" Cant Hold Us ");
(17) Log.v(" DRACODROID ", " CONTROL - setTitlePopular: Cant Hold Us "
(18)   + reportDate);
(19) //...
(20)
(21)
(22) // Transition 18: previous S0 next S0 on view SearchView
(23) public void TestSpotifyclicsong18 () //...
(24)
(25) // Transition 19: previous S1 next S0 on view PrincipalView
(26) public void TestSpotifyclicPrincipalMenu19 () //...
(27)
(28) // Transition 20: previous S1 next S0 on view PrincipalView
(29) public void TestSpotifyclicSearch20 () //...
(30)
(31) // Transition 21: previous S1 next S0 on view SearchView
(32) public void TestSpotifysetTitlePopular21 () //...