g00glen00b / dimitri.codes

Static generator for dimitri.codes using Gatsby
https://dimitri.codes
Other
20 stars 8 forks source link

https://dimitri.codes/unit-testing-spring-boot #101

Open utterances-bot opened 2 years ago

utterances-bot commented 2 years ago

Unit testing your Spring boot applications | Dimitri's tutorials

Testing is an important part of development, and in this tutorial I'll show you how you can unit test your Spring boot application

http://localhost:8000/unit-testing-spring-boot

g00glen00b commented 2 years ago

Test

maheshvarmasanga commented 2 years ago

Good article! is it good to write unit tests after the development is done? is it good idea? in our project someone else has written code and I have been tasked to write unit tests....

maheshvarmasanga commented 2 years ago

in the github there is no test code

g00glen00b commented 2 years ago

@maheshvarmasanga

Good article! is it good to write unit tests after the development is done? is it good idea? in our project someone else has written code and I have been tasked to write unit tests....

Unit tests should be written by the person who knows the best what that code should do, so the developer who wrote the code.

If you have to write unit tests now, how will you know what the right behaviour is? If you ask me, there are two answers to that, either you have some very detailed documentation (which I assume is unlikely), or you write your unit tests based on what the code does. If you choose the latter, then if the code contains a bug, so will your unit test.

in the github there is no test code

Yeah sorry, I was hoping to finish everything before the time this article was published, but I didn't make it. I'll try to push them as soon as I can.