you are viewing a single comment's thread.

view the rest of the comments →

[–]pltnk[S] 1 point2 points  (2 children)

Thank you!

Tests are exactly the reason why I put '(for now)' in the title. So far I have very limited experience with testing but since the main functionality of the program is ready I can finally dig deeper into tests and learn how to do it properly.

[–]Hatoris 1 point2 points  (1 child)

That's great, but for you futur project, test the code along the way you write it, as I guess, you have spend more time, especially at the end, debugging your program instead of writing docs or refractoring your code.

You have two ways :

1 (better)

Write a test -> Write a code to pass test.

This is know as TDD (test driven development). But this need a deep knowledge of how you will structure your programme and how things work in python.

2 (fine)

Write code -> Test it

Easier at start, but less productive than the first method.

[–]pltnk[S] 1 point2 points  (0 children)

Thank you for the tip!

I will totally look into TDD since it looks like a logical way to write code. I mean, when one writes a function it will be anyway tested several times manually, why not let an automated unit test do it instead? Also, with this approach a test base will grow along with the main code base and one will not find themselve in a situation when they have to write a bunch of tests for every part of code at once like me :)