Fireship · @fireship

Software Testing Explained in 100 Seconds

Uploaded May 24, 2021 · Length 2:16

Software Testing Explained in 100 Seconds

Summary

software testing explained in 100 seconds, including manual and automated testing methods, unit, integration, and end-to-end testing.

  • software testing
  • test driven development
  • unit testing
  • integration testing
  • end-to-end testing
  • automated testing

Transcript preview

The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.

  1. 0:00

    software it's not like engineering

  2. 0:02

    something easy like a bridge where you

  3. 0:03

    start with a blueprint

  4. 0:04

    build it to spec then forget about it

  5. 0:06

    software is dynamic with a lot of moving

  6. 0:08

    parts and requirements that evolve over

  7. 0:10

    time

  8. 0:11

    developers build apps on top of a

  9. 0:12

    mountain of abstractions and nobody

  10. 0:14

    fully understands how every layer works

  11. 0:16

    that's okay because we just need to make

  12. 0:18

    sure that our code matches the

  13. 0:19

    requirements of the product test driven

  14. 0:21

    development is scientifically proven to

  15. 0:23

    reduce defects and improve the

  16. 0:25

    maintainability of a code base but it

  17. 0:26

    does require some additional effort

  18. 0:28

    one option is manual testing where a

  19. 0:30

    human being clicks on every button and

  20. 0:32

    fills out every form then assigns a

  21. 0:34

    bunch of jira tickets so they can be

  22. 0:35

    backlogged by the developers

  23. 0:37

    but that's not very efficient for a

  24. 0:38

    large scale product a better approach is

  25. 0:41

    to use automated testing tools that

  26. 0:42

    allow developers to write code for the

  27. 0:44

    sole purpose of testing the main

  28. 0:46

    application code in a code base you'll

  29. 0:48

    often find files that end in

  30. 0:49

    test or dot spec inside you'll first

  31. 0:52

    find a line of code that describes the

  32. 0:54

    feature or thing that's being tested

  33. 0:56

    that's known as a test suite and it

  34. 0:57

    contains one or more individual tests

  35. 1:00

    an individual test usually starts with

  36. 1:02

    it followed by a description

  37. 1:03

    of what is being tested the idea is to

  38. 1:06

    describe the behavior of the code in

  39. 1:07

    human readable terms

  40. 1:09

    inside the test the code will be

  41. 1:10

    executed then one or more

  42. 1:12

    expectations or assertions are used to

  43. 1:14

    check that the code produces the

  44. 1:16

    expected result if the expectation

  45. 1:18

    returns false then the test fails

  46. 1:20

    if it's true it passes test runners like

  47. 1:22

    jest or karma

  48. 1:23

    can run all your tests automatically in

  49. 1:25

    the background or on a continuous

  50. 1:26

    integration server before you deploy

  51. 1:28

    now there are many different automated

  52. 1:30

    testing strategies that you should be

  53. 1:32

    aware of

  54. 1:32

    at the most granular level we have unit

  55. 1:34

    testing which is designed to test

  56. 1:36

    individual functions or methods

  57. 1:37

    like does this function return the

  58. 1:39

    proper value when given the arguments of

  59. 1:41

    a

  60. 1:41

    and b then we have integration testing

  61. 1:43

    to determine how well different

  62. 1:44

    components or modules work together like

  63. 1:46

    is the component

  64. 1:47

    able to use the database service to get

  65. 1:49

    data from the server at the highest

  66. 1:51

    level we have end-to-end testing which

  67. 1:53

    usually happens in a mock browser or

  68. 1:54

    device

  69. 1:55

    and simulates actual user behaviors like

  70. 1:57

    clicking on buttons and filling out

  71. 1:59

    forms

  72. 1:59

    it's like having a robot to do all your