Androidでテストってどないすんねん!
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Androidでテストってどないすんねん!

on

  • 312 views

 

Statistics

Views

Total Views
312
Views on SlideShare
312
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Androidでテストってどないすんねん! Presentation Transcript

  • 1. サンプル:http://books.ascii.jp/9784048860680/2013/03/15 
  • 2. ✤ ✤ ✤ ✤✤ ✤ ✤
  • 3. ✤ ✤ ✤
  • 4. ✤ ✤ ✤ ✤✤ ✤
  • 5. ! !! !
  • 6. ※抜け漏れあり ※リスクベースである程度の  取捨選択が現実的(自己弁護)テストケース番号 入力値 ユニットテスト UIテスト 検証項目 出力メッセージ(メソッド名) (辺a, 辺b, 辺c) で検証 で検証
  • 7. public class TriangleTest extends TestCase { public void test01() { Triangle testee = new Triangle(2,3,4); assertEquals(Triangle.Type.SCALENCE, testee.checkType()); } public void test02() { Triangle testee = new Triangle(1,2,2); assertEquals(Triangle.Type.ISOSCELES, testee.checkType()); } public void test03() { (割愛)  } public void test04() { (割愛)  } public void test05() { try { Triangle testee = new Triangle(1,2,3); fail("Wrong instance: " + testee.checkType().toString()); } catch (RuntimeException e) { assertEquals(" ",e.getMessage()); } }}
  • 8. public class TriangleActivityTest extends TestCase {  (テストメソッド以外は割愛) public void test01() { driver.startActivity(TESTEE); // テスト対象の絶対クラスパスを文字列で指定 inputText("editText_a", "2"); inputText("editText_b", "3"); inputText("editText_c", "4"); assertTrue(driver.findElement(By.id("do_check")).isEnabled()); buttonClick(); assertEquals("", driver.findElement(By.id("error_message")).getText()); assertEquals(" ", driver.findElement(By.id("result_message")).getText()); } public void test06() { (test06とほぼ同じ ! 割愛) } public void test06() { driver.startActivity(TESTEE); inputText("editText_a", "a"); inputText("editText_b", "2"); inputText("editText_c", "2"); assertFalse(driver.findElement(By.id("do_check")).isEnabled()); assertEquals("", driver.findElement(By.id("result_message")).getText()); assertEquals(" ", driver.findElement(By.id("error_message")).getText()); }}
  • 9. ✤✤ サンプル:http://books.ascii.jp/9784048860680/      “ch3/3-3/”
  • 10. ✤✤✤ ✤
  • 11. ✤ ✤ ✤ ✤ ✤