Skip to main content

3 posts tagged with "tdd"

tdd tag description

View All Tags

Testing hello world function in python with doctests

· 5 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

Sometimes even the simplest programs deserve solid testing-especially when you're working in a team or trying to set strong standards for code quality. In this note, we'll take the most basic example-"Hello, World!"-and build out everything around it to demonstrate how doctests can be used effectively, even for something so trivial. The goal is to build intuition for testing, not just solve a toy problem.

Various Ways for Executing Doctests in Python

· 8 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

Executing Doctests in Python: A Comprehensive Guide​

Doctest is a module in the Python Standard Library that enables you to write tests within the documentation of your code-typically inside docstrings. These tests look like interactive Python sessions (as if they were run in a Python shell), and the doctest module verifies that the output matches the expected result. While doctests are generally simpler than unit tests written with unittest or pytest, they are powerful for checking that code examples in documentation remain correct over time.

This guide explores the various ways to execute doctests in Python, from running them via the command line to embedding them in code and running them programmatically.

Paradigms Every Beginner Should Know Before Learning Shift Left

· 5 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

Before diving into Shift Left, which emphasizes catching bugs, performance, and security issues early in the software development lifecycle, it’s important for new programmers to learn the foundational paradigms that support this philosophy.

These paradigms teach early thinking, good code hygiene, and automation - all of which are building blocks of effective software engineering.