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.





...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
Radiolab by WNYC Studios

Radiolab

44,010 Listeners

Software Engineering Daily by Software Engineering Daily

Software Engineering Daily

623 Listeners

Heavy Networking by Packet Pushers

Heavy Networking

328 Listeners

Talk Python To Me by Michael Kennedy

Talk Python To Me

587 Listeners

Python Bytes by Michael Kennedy and Brian Okken

Python Bytes

214 Listeners

Darknet Diaries by Jack Rhysider

Darknet Diaries

8,001 Listeners

The Real Python Podcast by Real Python

The Real Python Podcast

141 Listeners

Unexplainable by Vox

Unexplainable

2,285 Listeners

Network Automation Nerds by Packet Pushers

Network Automation Nerds

3 Listeners