I spent a short time working in mechanical engineering, for a company that makes quick release anchors for oil rigs. Every part was tested, as you can imagine. But not only the finished assembly. Even fragments of the castings used to construct the main component were taken for destructive testing to prove that the metal had the correct characteristics.
Why should it be any different in software engineering? Software testing is an established part of producing reliable code. I have been slack at implementing this. So I took an online course through Pluralsight, kindly made available for free during the recent lockdown, on writing tests for software. The course is aimed at Python, which I use for scripting the software implemented on the PC.
So I am slowly getting to grips with writing tests. I find writing stand alone doctests a useful tool. I test the code from the command line, then copy and paste the tests into a separate file. It is not quite as simple as this, but you get the idea. I am slowly getting to grips with mocks and pytest. Using the doctests is fast and easier, so I am more likely to actually write some tests.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.