Unit Test vs Integration Test | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Unit Test vs Integration Test

Hi all. I’ve been a bit of a hacker now for a while and was getting more into legit software development. I write decent code but often don’t do much testing. I simply write code and then test to see if it works by running it and if it gives proper output, I continue along and debug as I go. Not sure if this is a standard for TDD or not. My question is, can anyone explain the difference between or give some example code for a unit test vs an integration test?

11th Jun 2019, 12:12 AM
Hazmat
Hazmat - avatar
2 Answers
+ 2
Unit tests are typically used to test individual components of a system in isolation, while integration tests are used to test how those components work together. Unit tests are typically run more frequently than integration tests, since they are faster and easier to run. Integration tests are run less frequently, since they are more complex and time-consuming to run. https://code.sololearn.com/crbjk108GN43/?ref=app https://code.sololearn.com/c5pC1SGp1DeX/?ref=app
11th Dec 2022, 9:57 AM
Calviղ
Calviղ - avatar
0
Thanks Jay
11th Jun 2019, 2:51 AM
Hazmat
Hazmat - avatar