Automated testing: Difference between revisions

imported>Paulproteus
imported>Paulproteus
Line 44:
=== How to write code that is easy to test ===
 
* If you are writing a function, make it '''accept arguments''' for its data, rather having it calculate the input itself. For example:
Here are some tips on making code easy to test:
 
* If you are writing a function, make it '''accept arguments''' for its data, rather having it calculate the input itself. For example:
 
'''Good'''
Anonymous user