For those of you paying attention, you may have realised that I didn't post a blog yesterday - sorry for that 🙈 Now I'm back to start my first project written in Rust. The plan is to create a simple CLI tool that measures the time elapsed running a command in your terminal. In this blog post, I'm going to sum up my learning objectives as well as some feature requirements for the first iteration of the project.
Lets start by naming some learning objectives for the project:
- Packaging and exporting a Rust executable
- Building a robust and maintainable tool by applying TDD principles
- Familiarising myself with the Rust standard library
Cool, now we know at a higher level what we're trying to achieve, it's important to outline some kind of rudimentary product vision. This will be expressed in problem terms and feature ideations:
- I want to easily and reliably test how fast my programs or library components run;
- We have good unit and integration test suites, but don't have resources to commit to non-functional testing;
- I develop locally with large amounts of data and want to check memory or CPU bottlenecks.
I can see a CLI solution to these problems. But problems 2 and 3 would require advanced capabilities. Focussing in the first iteration on solving problem 1 seems reasonable. There are suitable features that should get some of the problem's requirements solved:
- "Test easily" -> One line installation, simple inward and outward APIs, language agnostic
- "Test reliably" -> Robust error handling, taking averages over results.
Before breaking these down further to actionable steps, let's look at some prerequisites that need to be sorted first.
Including the right linting and testing tools as well as commit hooks can reduce the burden of project management overhead. The company I work for has an open-source project template for Python. I'll first look to find a similar template to that. From there we'll then initialise a public git repo and work on the very first feature areas.
There are two major starting points for this project:
- CLI installation and arg parsing;
- Process management and meta data collection.
At this stage I'd feel more comfortable starting with objective two. I'll start with TDD and see how that goes. Once I've got the ability to start and await the completion of a subprocess, I'll pause and go to objective one. My aim is to create an automatic test suite for the CLI aspect.
Each day I'll run through the questions and answers from the previous day and then move on to describe some of the challenges I encountered. Apologies in advance for terrible GIF or pun action 😄