3 ms·
I was having a discussion with ChatGPT about development difficulties in a micro services architecture. It helped me arrive at a possible improvement using depe
by brylie 3y ago
I was having a discussion with ChatGPT about development difficulties in a micro services architecture. It helped me arrive at a possible improvement using dependency injection functions like get_sentry and get_mongo that can return a MagicMock instance of the respective runtime dependency by checking a RUN_MODE environment variable. The idea solves an immediate need to allow me to bootstrap the application to a minimum functional state in a CI or pre-commit environment. We can also expand on the idea by defining RUN_MODE behaviours for development, staging, and production environments with various gRPC stubs and service mocks in some environments.
I’ve also had a great experience using ChatGPT and GitHub Copilot assist me in writing unit tests for a Dango/WagtailCMS website project. ChatGPT particularly knows some subtle nuances of the Django and Wagtail APIs. It has been like having a personal tutor. Copilot then picks up on unit test patterns to write tests based on comment prompts or function names. In some cases, Copilot is suggesting test cases that I didn’t even think of simply by pausing my cursor on a blank line.
I’ve been live streaming my open source development using these tools, in case anyone would like to see how they are making me a better developer.
https://youtube.com/@brylie https://youtube.com/@brylie