6
Daniil
8y

Started working as a "working student" in an it company to write unit tests. (which then will be executed automatically - so automated unit tests)

Realised that I write more or less the same code just changing the names and some parameters (sometimes more if it's not an number but a bool for example but it's pretty much the same scheme)

So I bought a tool for 1$ to use "auto complete" on custom templates.(I type testgetbool and the tool replaces this to the test case only asking for the variable name.)

So now I'm writing automated automated tests 😁😅

(which is btw pretty boring but cost & time effective)

Comments
  • 1
    Why not just create a function that takes the two or three different parameters and call that a bunch of times.
  • 1
    @KylePiira
    I also thought about that.
    But I would need more then five functions and it would not be "that" fast /easy to make them.
    Background: I'm testing properties.
    And to prepare them I'm calling a different function for each property (testing property papersize: then use functions 'getpapersize' and 'setpapersize'.) and I needed to create the helper functions myself too.
    And they differ from name and type. So it would be quite complicated writing functions that gets a "Name" or using switches on the' chosen property ' and then behaving differently depending on what property you are testing.
    So i took the simple way (since automated code writing is very fast done).
Add Comment