Unit Testing @ Educ 2016

Unit Testing @ Educ 2016

Talk about unit testing in particular, and automated testing in general, at the 2016 European Dataflex Users' Conference in Berlin

36c905c1a5d3270d1d01a99773256b2d?s=128

Ola Eldøy

May 13, 2016
Tweet

Transcript

  1. UNIT TESTING BE A HAPPY PROGRAMMER

  2. OLA ELDØY DEVELOPER EMMA EDB AS

  3. None
  4. None
  5. None
  6. UNIT TESTING BE A HAPPY DATAFLEX PROGRAMMER

  7. BEFORE UNIT TESTING AFRAID TO CHANGE YOUR CODE?

  8. BEFORE UNIT TESTING SOMETHING MIGHT BREAK?

  9. None
  10. UNIT TESTS GIVE YOU A SAFETY NET – INSTANT FEEDBACK

    EXECUTABLE SPECS WORKING SOFTWARE
  11. AUTOMATED TESTING UNIT TESTING INTEGRATION TESTING END-TO-END TESTING

  12. TDD ≠ UNIT TESTING TDD = WRITE TESTS FIRST THEN

    PRODUCTION CODE
  13. VERSION CONTROL CONTINUOUS INTEGRATION AUTOMATED TESTING THREE AMIGOS

  14. VERSION CONTROL GIT MERCURIAL

  15. None
  16. None
  17. VDFUNIT UNIT TESTING FOR DATAFLEX

  18. None
  19. GETTING VDFUNIT • VERSION CONTROL or DIRECT DOWNLOAD • INCLUDE

    LIBRARY IN YOUR WORKSPACE
  20. None
  21. None
  22. None
  23. None
  24. None
  25. None
  26. None
  27. None
  28. None
  29. None
  30. None
  31. None
  32. WHAT IS A UNIT TEST FAST REPEATABLE INDEPENDENT

  33. NOT A UNIT TEST USES THE DATABASE FILE SYSTEM NETWORK

  34. AN INTEGRATION TEST MAY USE THE DATABASE FILE SYSTEM NETWORK

  35. A UNIT TEST TESTS YOUR CODE LOGIC

  36. AN INTEGRATION TEST MAY USE THE DATABASE NEEDS A FRESH

    START EVERY TIME STILL NEEDS TO BE AUTOMATED
  37. None
  38. LEGACY CODE OLD CODE I’M NOT TOUCHING IT!

  39. LEGACY CODE CODE WITHOUT TESTS

  40. LEGACY CODE NEEDS REGRESSION TESTS

  41. LEGACY CODE DEMO INTEGRATION TEST

  42. CONTINUOUS INTEGRATION COMPILES UPON CHECKIN RUNS TESTS CONSTANT FEEDBACK

  43. None
  44. None
  45. ACCEPTANCE TESTING BUSINESS FACING CONCRETE EXAMPLES

  46. ACCEPTANCE TESTING The human brain is much better at understanding

    concrete things than abstractions
  47. ACCEPTANCE TESTING BUSINESS FACING CONCRETE EXAMPLES

  48. None
  49. None
  50. FITNESSE FOR DATAFLEX OPEN SOURCE FREE AVAILABLE SOON

  51. WRITING GOOD UNIT TESTS TEST CODE vs PRODUCTION CODE EQUALLY

    IMPORTANT
  52. WRITING GOOD UNIT TESTS YOUR UNIT TESTS ARE A VALUABLE

    ASSET
  53. YOUR UNIT TESTS ARE LIVING DOCUMENTATION EMPIRICAL EVIDENCE (SAYING: YOUR

    SOFTWARE WORKS)
  54. VERSION CONTROL TESTS YOUR TEST CODE IS AN IMPORTANT ASSET

    PUT IT IN VERSION CONTROL
  55. TEST CODE SHOULD BE READABLE TELLS A STORY EASY TO

    UNDERSTAND MAINTAINABLE
  56. BEWARE OF BRITTLE TESTS TEST FEATURES NOT IMPLEMENTATION DETAILS

  57. SHOULD I UNIT TEST… EVERYTHING?

  58. PROBABLY NOT FOR… GUI EXPLORATORY TESTING PROTOTYPING

  59. THIS IS ALL JOLLY GOOD… BUT…

  60. BUT… I DON’T HAVE TIME TO WRITE TESTS

  61. NO TIME TO WRITE TESTS? WHAT ABOUT… HAVING CODE THAT

    WORKS THAT YOU CAN CHANGE, REFACTOR
  62. BUT… WRITING THE TESTS ALMOST TAKES AS LONG AS WRITING

    THE PRODUCTION CODE
  63. IT TAKES A LOT OF TIME "Your tests represent a

    significant investment. They’ll pay off in minimizing defects and by allowing you to keep your production system clean through refactoring. But they also represent a continual cost. You need to continually revisit your tests as your system changes." - Pragmatic Unit Testing in Java 8 with JUnit (Jeff Langr with Andy Hunt & Dave Thomas)
  64. WRITING TESTS IS A SKILL DON’T EXPECT TO BE PRODUCTIVE

    FROM DAY 1
  65. THIS IS COOL! HOW DO I START?

  66. FIRST STEPS ADD VDFUNIT TO YOUR PROJECT THEN TEST SOMETHING

  67. THEN… BE A HAPPY DATAFLEX PROGRAMMER

  68. QUESTIONS?