Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Jeremias Rößler (ReTest), Tested by Monkeys — The end of banana software!, CodeFest 2017

CodeFest
February 01, 2018

Jeremias Rößler (ReTest), Tested by Monkeys — The end of banana software!, CodeFest 2017

https://2017.codefest.ru/lecture/1141

Various automation tools have been available for quite some time now, but due to high creation and maintenance efforts of tests, GUI-Testing is still mainly a manual task. Meanwhile overall testing effort has risen to make up 30% of a typical software budget. Is crowd-testing the answer? What if we could have automated test cases be created automatically?

Monkey Testing is not a new idea. But combined with a manually trainable AI and an innovative new testing approach (dubbed "difference testing"), we can now not only have the monkey search for technical bugs (i.e. crashes) but generate functional test cases that are optimized towards several goals and are even better than manually created ones.

Visit the future of testing and see how AI can help us create better software!

CodeFest

February 01, 2018
Tweet

More Decks by CodeFest

Other Decks in Technology

Transcript

  1. 2

  2. 28 Infinite-Monkey-Theorem: A monkey hitting keys at random on a

    typewriter for a long enough time will type the complete works of William Shakespeare.
  3. Infinite Monkey 30 public static void main(String... args) throws Exception

    { Robot robot = new Robot(); while (true) { robot.mouseMove(random.nextInt(maxX), random.nextInt(maxY)); robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); robot.delay(200); for (char inputChar : randomString().toCharArray()) { robot.keyPress((int) inputChar); robot.keyRelease((int) inputChar); robot.delay(10); } robot.keyPress(KeyEvent.VK_ENTER); robot.keyRelease(KeyEvent.VK_ENTER); } } 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16.
  4. 32

  5. 33

  6. 34

  7. Intelligent Monkey 35 public static void main(String... args) throws Exception

    { WebDriver driver = new FirefoxDriver(); driver.get("http://www.retest.de"); while (true) { List<WebElement> links = driver.findElements(By.tagName("a")); links.get(random.nextInt(links.size())).click(); Thread.sleep(500); List<WebElement> fields = driver.findElements(By.xpath("//input[@type='text']")); WebElement field = fields.get(random.nextInt(fields.size())); field.sendKeys(randomString()); Thread.sleep(500); } } 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14.
  8. 37

  9. 40 - quick and easy to implement - finds bugs

    Traditional monkey testing but: - relevant bugs? - not intelligent - not trainable - needs sandboxing
  10. 42

  11. 43

  12. 45

  13. 46

  14. 47

  15. 48 - bases on realistic use case - covers corner

    cases - what about coverage? Trainable monkey testing
  16. 49

  17. Tower of Hanoi 54 © André Karwath aka Aka Source:

    http://en.wikipedia.org/wiki/File:Tower_of_Hanoi_4.gif
  18. 59

  19. 60 - bases on realistic use case - optimises for

    coverage - very effective intelligent monkey testing
  20. 63 AI in Testing? – so far I do not

    see anyone doing it in a useful way. Antony Edwards, CTO of TestPlant “
  21. 65

  22. 68 What is a bug? Without specification, there are no

    bugs — only surprises. Brian Kernighan “
  23. 70

  24. 71

  25. 72

  26. 73 Why do we test? After implementation? 1 + 1

    = 3 2 + 2 = 4 After change? 1 + 1 = 3 1 + 1 = 5
  27. 76

  28. 77

  29. 78

  30. 79

  31. 80 - oracle problems hinders AI - regression testing needs

    no oracle - VCS for the GUI functional monkey testing
  32. 81 Intelligenter Affe Summary Monkey-Testing: cheaper faster better multiplies manual

    tests Difference Testing little maintenance no wasteful testing yet more complete
  33. 82

  34. 86 1. if (name[0] == '.') continue; Is it a

    bug? . .. text.c other.files