Automated testing: Difference between revisions

Content added Content deleted
imported>Paulproteus
imported>Paulproteus
Line 44: Line 44:
=== How to write code that is easy to test ===
=== 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'''
'''Good'''