Skip to content

Latest commit

 

History

History
executable file
·
80 lines (68 loc) · 3.73 KB

testing.md

File metadata and controls

executable file
·
80 lines (68 loc) · 3.73 KB

Testing

  • We need to talk about testing 2021 Dan North

    • Or how programmers and testers can work together for a happy and fulfilling life
    • #agile #bdd #tdd #testing
  • How programmers make sure that their software is correct

    • Overview of whole area
    • Formal mathematical proofs are difficult for large programs
    • Unit and Integration tests
  • The Big TDD Misunderstanding

    • However, when people consider a “unit” as a class/method of the system, two things usually happen. The primary consequence is that developers dogmatically write one “unit test” for every class or method. The second consequence is the isolation of these “units” from other “units” using test doubles (mocks).

  • Mocks for Commands, Stubs for Queries Mark Seemann

    • (Anti-)Example: Mocking Queries
      • IMPORTATNT read
  • [automated-testing]

  • The Myth of Code Coverage

    • 1/3 of the code every software project is irrelevant, buggy, overly complicated, or simply sucks.
    • covering every line will only make it more difficult to get rid of bad code
  • LionBridge

    • Leveraging the crowd for testing of mobile apps, games and other software
  • Types of Errors

    • Syntax Errors
      • Wrong words
      • reserved words
      • order
      • too many, too few params
    • Logic Errors
    • Runtime Errors
      • User input outside expected ranges
      • Runs out of memory or other resources
      • Permissions issues
  • Types of testing

    • Static
      • compilation
    • Dynamic
      • programs executed and checked
    • Passive/Explorative
      • Humans explore functionality
  • Black box / white box

  • Manual / Automated

  • Good Unit tests

    • isolation (should not affect other tests) - always return same result
    • Short - are they understandable to read?
    • application requirements - relevant to future
    • small surface area - failure should help identity source of error
    • fast
  • It is skilled/hard to write good tests

    • Arrange (setup your state/variables/env)
    • Act (perform the operation)
    • Assert (check the output)
  • Mocks Aren't Stubs Martin Fowler

    • Defining test terminology
    • Dummy
      • objects are passed around but never actually used. Usually they are just used to fill parameter lists.
    • Fake
      • objects actually have working implementations, but usually take some shortcut which makes them not suitable for production (an in memory database is a good example).
    • Stubs
      • provide canned answers to calls made during the test, usually not responding at all to anything outside what's programmed in for the test.
    • Spies
      • are stubs that also record some information based on how they were called. One form of this might be an email service that records how many messages it was sent.
    • Mocks
      • are what we are talking about here: objects pre-programmed with expectations which form a specification of the calls they are expected to receive.
  • fuzzmap.io

    • Creating a visual map of state-changes/journey for non-coders
    • Demo of react app and visual user jorny