Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ecopque/tdd

This project explores the use of Test-Driven Development (TDD) methodology along with type hints in Python, aiming to increase code clarity and reliability.
https://github.com/ecopque/tdd

python3 tdd tdd-python typehints

Last synced: 16 days ago
JSON representation

This project explores the use of Test-Driven Development (TDD) methodology along with type hints in Python, aiming to increase code clarity and reliability.

Awesome Lists containing this project

README

        

# Testing Project with TDD and Type Hints

## Overview

This project explores the use of Test-Driven Development (TDD) methodology along with type hints in Python, aiming to increase code clarity and reliability. We use the unittest module to create automated tests, following the TDD cycle of Red, Green, and Refactor. Additionally, we apply the typing module to define data types, allowing for early error detection with tools like mypy.

## Summary
- Introduction to TDD: Explanation of the Red-Green-Refactor cycle and the importance of writing tests before implementing functionality.
- Environment Setup: Instructions for installing dependencies, including mypy for static type checking.
- Project Structure: Organization of files, including the test module (test_baconwitheggs.py) and the implementation module with type hints (typehints1.py).
- Writing Tests with unittest: Demonstration of how to write tests for different scenarios, including exception handling and specific input cases.
- Type Hints with mypy: Use of type hints with typing to increase type accuracy and reduce errors, especially in lists, dictionaries, and functions.
- Module Communication Summary: Explanation of the integration between the test module and the main implementation module.

This project is ideal for those looking to understand the practical application of TDD in Python, combining it with type hints to improve code quality and maintainability.

## Images of the project
![readme](https://github.com/ecopque/tdd/blob/main/prints/Screenshot%20from%202024-11-15%2011-13-46.png)
![readme](https://github.com/ecopque/tdd/blob/main/prints/Screenshot%20from%202024-11-15%2011-14-07.png)
![readme](https://github.com/ecopque/tdd/blob/main/prints/qrcode_linktree_edson_copque2.png)