HN user

fourier

18 karma
Posts0
Comments19
View on HN
No posts found.

We've used image comparison tool, which produces pixel-wise diff with the expected image, exactly to verify these kind of things(we've been developing the rendering tool). In addition to this unit tests, combined with the coverage tools, allows you to find potential problems/crashes etc in your code. Different levels of testing are for different things, unit tests just one of the pieces in the equation.

Your point is just for some tiny tiny scenarios of the software you are working on.

You don't need to think about 'how could I write a unit test', you need to think about how could you improve the quality of the code, and unit tests are just one of your tools available to solve this problem.

I'm working a lot with a huge legacy codebases in C/C++. Here are some advices:

1. Be sure what you can compile and run the program

2. Have good tools to navigate around the code (I use git grep mostly)

3. Most of the app contain some user or other service interaction - try to get some easy bit (like request for capabilities or some simple operation) and follow this until the end. You don't need a debugger for it - grep/git grep is enough, these simple tools will force you to understand codebase deeply.

4. Sometimes writing UML diagrams works -

- Draw the diagrams (class diagrams, sequence diagrams) of the current state of things

- Draw the diagrams with a proposal of how you would like to change

5. If it is possible, use a debugger, start with the main() function.

Yes I do. The reason is moral/aesthetical: to have books on my bookshelfs and organize them makes them always visible in my flat and allows me to easy glimpse over them and have an idea of what I did, what I planned and what I'll deferred. From functional point of view eBooks are more convenient, so if I got a chance I buy both ebook and paper versions, or if I download the eBook for free somewhere I make sure if the book is good to buy the paper version later.

Code Keyboards 11 years ago

And the Kinesis Advantage is programmable as well, so you can redefine keys as you please. For example I moved arrow keys to one side, remapped Delete to Ctrl and changed some alt/cmd keys configuration in thumb cluster.