Alexandru Bolboaca - Unit Testing from the Trenches

1,095 views

Published on

Published in: Business, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,095
On SlideShare
0
From Embeds
0
Number of Embeds
522
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Alexandru Bolboaca - Unit Testing from the Trenches

  1. 1. Unit Testing From The Trenches Alexandru Bolboaca V1.0, because I embrace change
  2. 2. I write tests because I dont want this to happen
  3. 3. ...and I dont want to be this guy
  4. 4. Agenda Some clarifications 5 practical ideasAnswers to your questions
  5. 5. Clarification #1: What is a unit test?A piece of code that checks a unit from the system under test (SUT) A unit = a class (basic) A unit = a behavior (advanced)
  6. 6. A unit test Arrange Given Act When Assert Then
  7. 7. Clarification #2: Types of tests
  8. 8. Clarification #3: When we write testsDesign, Code, Test = Test After Design, Test, Code = Test First ProgrammingTest, Code, Design = Test Driven Development
  9. 9. Clarification #4: Who writes the tests Technology-facing tests: DevsBusiness facing tests: Analysts and Devs Critique tests: Testers and Devs
  10. 10. Clarification #5: Good unit tests Simple Fast Readable Independent Repeatable Easy to run
  11. 11. Clarification #6: Write tests for any tech … including bash scripting
  12. 12. Anything else to clarify?
  13. 13. 5 Practical Ideas
  14. 14. Situation #1 Cost: 12 hrs of businessCause: “a time calculation that was incorrect for the leap year”
  15. 15. Practical Idea #1The immune system of your product
  16. 16. Situation #2Large proportion of tests that are: Slow Unpredictable
  17. 17. Practical Idea #2
  18. 18. Situation #3 I measure the development timeI want the unit test coverage to be 90%
  19. 19. Practical Idea #3Managers measure Running Tested Features Developers measure coverageGuideline: Coverage must increase
  20. 20. Situation #4 We have unit tests, BUT: We extensively use the debugger Unit tests are based on test plansTesters still execute repeatedly manual test plans
  21. 21. Practical Idea #4Use automated developer tests to: Executable Specifications Replace debugging Complement learningReplace repetitive manual testing
  22. 22. Situation #5
  23. 23. Practical Idea #5
  24. 24. Wrap upI measure RTF/sprint
  25. 25. Alexandru Bolboaca alex.bolboaca@mozaicworks.com @alexboly, alexbolboaca.ro ● Trainings: Unit Testing, TDD, Legacy Code ● Technical Mentoring, Coaching, on-site and remote
  26. 26. QuestionsThe important thing is not to stop questioning

×