Test & Code

129: How to Test Anything - David Lord


Listen Later

I asked people on twitter to fill in "How do I test _____?" to find out what people want to know how to test.

Lots of responses. David Lord agreed to answer them with me.
In the process, we come up with lots of great general advice on how to test just about anything.

Specific Questions people asked:

  • What makes a good test?
  • How do you test web app performance?
  • How do you test cookie cutter templates?
  • How do I test my test framework?
  • How do I test permission management?
  • How do I test SQLAlchemy models and pydantic schemas in a FastAPI app?
  • How do I test warehouse ETL code?
  • How do I test and mock GPIO pins on hardware for code running MicroPython on a device?
  • How do I test PyQt apps?
  • How do I test web scrapers?
  • Is it the best practice to put static html in your test directory or just snippets stored in string variables?
  • What's the best way to to test server client API contracts?
  • How do I test a monitoring tool?
  • We also talk about:

    • What is the Flask testing philosophy?
    • What do Flask tests look like?
    • Flask and Pallets using pytest
    • Code coverage
    • Some of the resulting testing strategies:

      • Set up some preconditions. Run the function. Get the result.
      • Don't test external services.
      • Do test external service failures.
      • Don't test the frameworks you are using.
      • Do test your use of a framework.
      • Use open source projects to learn how something similar to your project tests things.
      • Focus on your code.
      • Focus on testing your new code.
      • Try to architect your application such that actual GUI testing is minimal.
      • Split up a large problem into smaller parts that are easier to test.
      • Nail down as many parts as you can.
      • Special Guest: David Lord.

        Sponsored By:

        • Datadog: Modern monitoring & security. See inside any stack, any app, at any scale, anywhere.
        Visit testandcode.com/datadog to get started.
      • Talk Python Training: Online video courses for Python developers
      • ★ Support this podcast on Patreon ★
        ...more
        View all episodesView all episodes
        Download on the App Store

        Test & CodeBy Brian Okken

        • 4.7
        • 4.7
        • 4.7
        • 4.7
        • 4.7

        4.7

        70 ratings


        More shows like Test & Code

        View all
        Software Engineering Radio - the podcast for professional software developers by se-radio@computer.org

        Software Engineering Radio - the podcast for professional software developers

        272 Listeners

        The Changelog: Software Development, Open Source by Changelog Media

        The Changelog: Software Development, Open Source

        283 Listeners

        Thoughtworks Technology Podcast by Thoughtworks

        Thoughtworks Technology Podcast

        41 Listeners

        Data Skeptic by Kyle Polich

        Data Skeptic

        483 Listeners

        Talk Python To Me by Michael Kennedy

        Talk Python To Me

        592 Listeners

        Software Engineering Daily by Software Engineering Daily

        Software Engineering Daily

        624 Listeners

        Soft Skills Engineering by Jamison Dance and Dave Smith

        Soft Skills Engineering

        269 Listeners

        Python Bytes by Michael Kennedy and Brian Okken

        Python Bytes

        213 Listeners

        Data Engineering Podcast by Tobias Macey

        Data Engineering Podcast

        142 Listeners

        Syntax - Tasty Web Development Treats by Wes Bos & Scott Tolinski - Full Stack JavaScript Web Developers

        Syntax - Tasty Web Development Treats

        982 Listeners

        Practical AI by Practical AI LLC

        Practical AI

        190 Listeners

        The Stack Overflow Podcast by The Stack Overflow Podcast

        The Stack Overflow Podcast

        64 Listeners

        The Real Python Podcast by Real Python

        The Real Python Podcast

        140 Listeners

        Oxide and Friends by Oxide Computer Company

        Oxide and Friends

        47 Listeners

        The Pragmatic Engineer by Gergely Orosz

        The Pragmatic Engineer

        52 Listeners