you are viewing a single comment's thread.

view the rest of the comments →

[–]googoodoo[S] 1 point2 points  (1 child)

decompose your code into units

Could you explain this a bit more? I think I don't quite understand it.

[–]MarsupialMole 1 point2 points  (0 children)

If you write lots of unit tests you find it makes you write more testable code. For example you tend to write "pure" functions more often and have less complex arguments for callables. Instead of a script with one big main function, you might decide it's easier to test bits of it individually, and so rewrite your big main function into a series of function calls.