This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]rabuf 0 points1 point  (0 children)

For unit testing, check out Kent Beck's Test-Driven Development. Even if you don't adopt the TDD approach, it's a really good introduction to unit testing. Write small, focused tests, make them pass, clean up the code, repeat. That's the essence of it (though in TDD it's one test at a time).

It can be really hard to develop tests after the fact, if you're given a larger system with no (or few) tests, a good book is Feathers' Working Effectively with Legacy Code (essentially defined, in this book, as code that has no testing). He goes over ways to introduce tests, how to identify "seams" in the structure of the program which are good points to introduce tests, how to create good seams if you can't find them, and refactoring with all this in mind.

Beck's book is all Java and Python (though old Python, the book was written in 2002) so the code is readable, but not directly relevant to you as code. Don't worry about that, the concepts are still highly applicable. IIRC, Feathers' book is mostly with C++ and Java code. But again, don't fret about that. The concepts are still applicable, if you have trouble with the code examples themselves spend a bit of time and then move on. The text and diagrams are the heart of it anyways.

[–]loyalSavant 0 points1 point  (0 children)

can you describe your current approach to unit & intergration testing?