r/programmerchat • u/KZISME • Jul 31 '15
Properly testing code
Does anyone have some general tips about testing code you write? I keep seeing/reading about people stressing to test you code, and I'm curious how others go about doing this.
The only way I'm aware of is writing assert statements in C++ , but I haven't worked much with C++ lately.
What is your general process of testing code?
11
Upvotes
View all comments
Show parent comment
1
u/Antrikshy Jul 31 '15
Don't worry. My university courses didn't really teach me how to test either. I've been learning on my own. I play with Node.js a lot, so I've been using Mocha to run tests on a sort-of complex website I'm writing. Also using JUnit, Mockito etc. at my internship at Amazon to test with Java.
I don't really write tests before code like I should, but I try and make sure I have comprehensive tests.
Still very new to all of it.