Been there, done that, would not recommend
-
Its definitely a bad idea writing new code that builds up on your old code, that has not been tested properly, because you quickly have to start debugging multiple layer is code at once.
wrote last edited by [email protected]Test driven development means you write the test case first and then never write any additional tests.
-
Its definitely a bad idea writing new code that builds up on your old code, that has not been tested properly, because you quickly have to start debugging multiple layer is code at once.
-
Test driven development means you write the test case first and then never write any additional tests.
I usually do it thenother way around
-
Writing the tests first, or at least in tandem with your code, is the only way to fly. It's like publishing a proof along with your code.
it sounds trite: make the tests fit the code. Yes, it's a little more work to accomplish. The key here is that refactors of any scale become trivial to implement when you have unit-test coverage greater than 80%. This lets you extend your code with ease since that usually requires some refactor on some level.
Writing the tests first also ensures that the test actually fails when you expect it to. I've seen test suites that were silently failing for years because they were (presumably) written after the fact and people just assumed that they tested what they said they did. Went in for some other clean up, stared at the test for 10 minutes wondering "how did this ever pass", and then came to realize that test assertions in Jest inside a forEach apparently don't run in the context of the test and failures won't make the test fail. Changing the forEach to a for...of made it all fail immediately.
-
It's refreshing to see someone on social media who doesn't dismiss code as "outdated" just because of its age.
There are dozens of us! But also, I have a masochistic tendency to update my old code to use the new language features and make it somewhat readable.
-
Yeah of course I Am testing. I Am usually just not writing very extensive tests. I try to break it as much as possible with as little effort and try then to prevent it from breaking.
That sounds like you're doing TDD, albeit informally.
-
That sounds like you're doing TDD, albeit informally.
From what I understand the difference between how I code and what has Ben described as TDD in this thread is, that I set up everything first and then try to think of ways people could break the code and then test these vases/try to prevent them.
-
Its definitely a bad idea writing new code that builds up on your old code, that has not been tested properly, because you quickly have to start debugging multiple layer is code at once.
Should I finally write a game for my game engine?
Should I test its existing functionalities?
No, it's time to add a physics subsystem (which I'll be needing for some of the games anyways).
-
Should I finally write a game for my game engine?
Should I test its existing functionalities?
No, it's time to add a physics subsystem (which I'll be needing for some of the games anyways).
Testing means, that you dont trust your coding abilities. Dont be a pussy and dont test your code /s
-
There are dozens of us! But also, I have a masochistic tendency to update my old code to use the new language features and make it somewhat readable.
Shouldn't you write tests for your code before using the new language features though?