Test & Code

Test & Code

Download on the App Store

Test & Code episodes

  • 138: Mutation Testing in Python with mutmut - Anders Hovmöller

    Your test suite tells you about the quality of your code under test.

     Mutation testing is a way to tell you about the quality of your test suite.

     Anders Hovmöller wrote mutmut for mutation testing in Python, and can be used with pytest, unittest, and others.

    In this episode, Anders explains mutation testing, how mutation testing with mutmut works, and good workflows.


    Special Guest: Anders Hovmöller.


    Links:

    • mutmut · PyPI
    • cosmic-ray · PyPI
    • MutPy · PyPI
    • parso · PyPI
    • mutmut documentation
    • Ned Batchelder article on mutmut



    29 min
  • 137: Become an Author - Matt Harrison interviews Brian Okken

    Matt Harrison, author of many Python books, is putting together a course, Effective Book Authoring, to help other people write and publish books.
     As part of this course, he's including interviews with people who have already written books, including me. This is that interview.

    We discuss:

    • Why I wrote "Python Testing with pytest"
    • Self publishing vs working with a publisher
    • The writing, editing, and publishing process
    • Writing format
    • Book promotion
    • Advice to other writers

    Special Guest: Matt Harrison.

    Links:

    • Effective Book Authoring — Matt's course
    • Python Testing with pytest - Simple, Rapid, Effective, and Scalable



    41 min
  • 136: Wearable Technology - Sophy Wong

    Wearable technology is not just smart consumer devices like watches and activity trackers. 

    Wearable tech also includes one off projects by designers, makers, and hackers and there are more and more people producing tutorials on how to get started. Wearable tech is also a great way to get both kids and adults excited about coding, electronics, and in general, engineering skills. 

    Sophy Wong is a designer who makes really cool stuff using code, technology, costuming, soldering, and even jewelry techniques to get tech onto the human body. 

    Sophy joins the show to answer my many questions about getting started safely with wearable tech.

    Some of the questions and topics:

    • Can I wash my clothing if I've added tech to it?
    • Is there any danger in wearing technology or building wearable tech?
    • Are there actual wires and cables conductive thread in the fabric and textiles of some wearable tech projects?
    • What's a good starter project? Especially if I want to do a wearable tech project with my kids?
    • Dealing with stretch with clothing and non-bendy electronics.
    • Some questions around the Sophy Wong and HackSpace "Wearable Tech Projects" book.
    • How did you get into wearable tech?
    • Do you have a favorite project?
    • Can I get into wearable tech if I don't know how to code or solder?
    • Are these projects accessible to people with limited budgets?
    • Making projects so you can reuse the expensive bits on multiple projects.

    Special Guest: Sophy Wong.


    Links:

    • sophywong.com
    • Wearable Tech Projects book — The wearable technology book
    • costumes — The dress is on this page, as well as the Ghostbuster pack and costume.
    • spacesuit
    • Music video with Sophy's space suit
    • Kobakant tutorials



    30 min
  • 135: Speeding up Django Test Suites - Adam Johnson

    All test suites start fast. But as you grow your set of tests, each test adds a little bit of time to the suite. 
     What can you do about it to keep test suites fast? 
     Some things, like parallelization, are applicable to many domains. 
     What about, for instance, Django applications?
     Well, Adam Johnson has thought about it a lot, and is here to tell us how we can speed up our Django test suites. 

    Topics include:

    • parallelizing tests
    • moving from disk to memory
    • using fake data and factory functions
    • targeted mocking

    Special Guest: Adam Johnson.


    Links:

    • Speed Up Your Django Tests — the book by Adam Johnson
    • Kukicha — "or twig tea, ..., is a Japanese blend made of stems, stalks, and twigs."



    22 min
  • 134: Business Outcomes and Software Development - Benjamin Harding

    Within software projects, there are lots of metrics we could measure. But which ones really matter. Instead of a list, Benjamin Harding shares with us a way of thinking about business outcomes that can help us with every day decision making. 

    We talk about:

    • Business outcomes vs vanity metrics
    • As a developer, how do you keep business outcomes in mind
    • Thinking about customer value all the time
    • Communicating decisions and options in terms of costs and impact on business outcomes
    • Company culture and it's role in reinforcing a business outcome mindset
    • And even the role of team lead as impact multiplier 

    I really enjoyed this conversation. But I admit that at first, I didn't realize how important this is on all software development. Metrics are front and center in a web app. But what about a service, or an embedded system with no telemetry. It still matters, maybe even more so. Little and big decisions developers face every day that have impact on costs and benefits with respect to customer value and business outcome, even if it's difficult to measure.

    Special Guest: Benjamin Harding.





    30 min
  • 133: Major League Hacking - Jon Gottfried

    Hackathons have been spreading around the world; many at university campuses. Major League Hacking, MLH, has been encouraging and helping hackathons.

    Hacking can be thought of as tinkering. Taking things apart and putting them back together as an interesting experience. There's always been some of this as part of software culture.

    The people at Major League Hacking have taken this to a whole new level, bringing together Tech creators who enjoy playing around with and crating new technology, on campuses, and now in virtual spaces, all over the world.

    Jonathon Gottfried, one of the cofounders of Major League Hacking, joins the show to talk about:

    • hacker meetups and events
    • hackathons
    • what it's like to go to a hackathon
    • how to help out with hackathons as an experienced engineer, even virtually as a mentor
    • hackathons continuing virtually during the pandemic
    • internships and fellowships on open source projects to help students gain experience, even during the pandemic
    • MLH approach to internships, giving interns a support group, including peers, mentors, and project maintainers
    • and MLH itself

    Special Guest: Jon Gottfried.


    Links:

    • Major League Hacking



    27 min
  • 132: mocking in Python - Anna-Lena Popkes

    Using mock objects during testing in Python.

    Anna-Lena joins the podcast to teach us about mocks and using unittest.mock objects during testing. 

    We discuss:

    • the different styles of using mocks
    • pros and cons of mocks
    • dependency injection
    • adapter pattern
    • mock hell
    • magical universe
    • and much more

    Special Guest: Anna-Lena Popkes.


    Links:

    • Personal webpage of Anna-Lena Popkes
    • Magical Universe — Awesome Python features explained using the world of magic
    • Test & Code 102: Cosmic Python, TDD, testing and external dependencies — The episode where Harry Percival discusses mocking.
    • Talk: Harry Percival - Stop Using Mocks (for a while) - YouTube — Talk: Harry Percival - Stop Using Mocks (for a while)
    • unittest.mock 
    • Autospeccing
    • Mock Hell Talk (45 min version) Edwin Jung - PyCon 2019 
    • Mock Hell Talk (30 min version) - Edwin Jung - PyConDE 
    • PyCon Estonia
    • KI macht Schule!
    • Talk Python #186 : 100 Days of Python in a Magical Universe



    39 min
  • 131: Test Smarter, Not Harder

    Some people avoid writing tests. Some drudge through it painfully.
     There is a better way.
     In this episode, I'm going to share some advice from Luke Plant on how to "Test Smarter, Not Harder".


    Links:

    • Test smarter, not harder - lukeplant.me.uk — The original article by Luke



    8 min
  • 130: virtualenv activation prompt consistency across shells - an open source dev and test adventure - Brian Skinn

    virtualenv supports six shells: bash, csh, fish, xonsh, cmd, posh. Each handles prompts slightly differently. Although the virtualenv custom prompt behavior should be the same across shells, Brian Skinn noticed inconsistencies. He set out to fix those inconsistencies. That was the start of an adventure in open source collaboration, shell prompt internals, difficult test problems, and continuous integration quirks. 

    Brian Skinn initially noticed that on Windows cmd, a space was added between a prefix defined by --prompt and the rest of the prompt, whereas on bash no space was added.

    For reference, there were/are three nominal virtualenv prompt modification behaviors, all of which apply to the prompt changes that are made at the time of virtualenv activation:

    1. If the environment variable VIRTUAL_ENV_DISABLE_PROMPT is defined and non-empty at activation time, do not modify the prompt at all. Otherwise:
    2.  If the --prompt argument was supplied at creation time, use that argument as the prefix to apply to the prompt; or,
    3. If the --prompt argument was not supplied at creation time, use the default prefix of "() " as the prefix (the environment folder name surrounded by parentheses, and with a trailing space after the last paren.

    Special Guest: Brian Skinn.


    Links:

    • virtualenv
    • Initial issue that started the adventure
    • final PR
    • pent: pent Extracts Numerical Text -- Mini-language driven parser for structured numerical data
    • Lightening talk on pent



    34 min
  • 129: How to Test Anything - David Lord

    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.





    41 min

About Test & Code

From the publisher's feed

The Python Test Podcast hosted by Brian Okken

More shows like Test & Code

Radiolab by WNYC Studios

Radiolab

43,853 Listeners

Software Engineering Daily by Software Engineering Daily

Software Engineering Daily

623 Listeners

Heavy Networking by Packet Pushers

Heavy Networking

327 Listeners

Talk Python To Me by Michael Kennedy

Talk Python To Me

582 Listeners

Python Bytes by Michael Kennedy and Calvin Hendryx-Parker

Python Bytes

213 Listeners

Darknet Diaries by Jack Rhysider

Darknet Diaries

8,059 Listeners

The Real Python Podcast by Real Python

The Real Python Podcast

139 Listeners

Unexplainable by Vox

Unexplainable

2,313 Listeners

Network Automation Nerds by Packet Pushers

Network Automation Nerds

5 Listeners