Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get a positive mental attitude towards testing?

I want to write tests for my app, though each time I look at rspec.info, I really don't see a definite path to take towards "doing things right" and testing first. I watched the peepcode videos on rspec more than once, yet it doesn't take. I want to take more pride in my work, and I think that testing will help. How can I break through this mental block?

like image 798
Jesse Avatar asked Dec 30 '08 00:12

Jesse


People also ask

How can I change my attitude towards studies?

Give your studies a boost by turning negativity into positivity, simply by adding the word “yet” to any statement you feel tempted to make about your inability to do something. Rather than “I can't do this”, tell yourself “I can't do this yet” (or, if you're feeling particularly positive, “I can do this”!).


1 Answers

Find tools that will reward you for testing. For example, make it very easy to run all the tests and get a message like

73 tests passed.

Try random testing because you can test against a lot of values quickly and easily.

See if your language provides a test-coverage analysis tool that gives you percentage of statement coverage or percentage of block coverage. It is very rewarding to drive code coverage from 60% up to 90%---and if you are lucky, you will find bugs.

My key advice is to quantify your progress in testing so that you can see the numbers going up. That will make it a lot more motivating. (Gee, I wonder what other numbers that go up can be found on this site...)

like image 178
Norman Ramsey Avatar answered Nov 15 '22 21:11

Norman Ramsey