So really quick update, I did not managed to put a lot of effort in this project during the week, but at least a few things were done:
Server is running
With the current incomplete implementation, the server is running it’s giving the response that are expected.
That was not a big challenge, but the most important part was to create the dynamic loader for each blueprints. This means that the core of the application is now decoupled from any API module, that provide quite a few neat feature, such as onboarding a new destination for the API is code-free. I just create a file in the module directory and voilĂ , automatically added to the server.
Also, this confirms that the configuration module is working just fine. So we are quite good for the future, as things get really decoupled.
Moving to Red/Green development
I know that is required to provide, so I’ll be able to prepare the unit tests, after a bit of experiment on how to test with flask. Once all tests are ready, the real implementation will start. I just want to ensure I start working on clean ground.
For the test, I will also try to improve the way I build tests to have cleaner and more understandable code here.
For reminder: Red/Green is a kind of Test Driven Development where you write the tests before putting any real implementation, the idea is that tests should all fails at first. If any test you wrote passed while the code was empty that’s an indicator the you are not creating any new feature.
That’s a be demanding, but helps to put things straight before any real work. I tend to set the asserts quite early, and only leave the testing setup part for after the implementation (mocking, etc..)
Comment Improvement
Another part I’ll rework quite a bit will be the docstring comment, I tend to only put the bare minimum, and I was told that giving implementation details in there would make everything easier, so let’s settle this good work habit.
So yes, overall quick update, but I put a few of the previous code into motion and that’s always a good feeling to see that stuff works.
I hope that for next update on this project, I’ll be able to share some code with the tests and explain how to test Flask Application.
0 Replies to “Devblog – Red/Green Enabled”