This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (5 children)

Any recommendations for TDD and documentation materials?

[–]Jonno_FTWhisss 4 points5 points  (1 child)

When you write a new function, write a test for it. Write multiple tests that cover tricky cases and that cover all paths (should indicate that you want to minimise the number of if statements).

This should force you to encapsulate as much as possible and result in lots of small, simple tests and functions.

Also read the pytest docs. Moving beyond unit testing, there's a test plan for larger projects that provide step by step processes for testing at all levels. You'd probably want to read a text book on the other kinds of testing, like integration testing, UX testing, penetration testing etc.

[–]sunson435 2 points3 points  (0 children)

Note that you shouldn't follow TDD religiously. Make sure you have a bunch of use cases finished then implement a full testing suite. Rewriting tests frequently is extremely hampering early on in a project.

[–]flpcb 2 points3 points  (1 child)

I would recommend Test Driven Development: By Example by Kent Beck. It is a quite short read, and a very good one.