I've been hearing alot about unit testing lately.
What I'm trying to understand is how would one / should one go about unit testing a cruddy business app? (basically an app that writes data in / reads data out of a database).
Is unit testing even worth it in that scenerio or do you usually unit test more complicated things?
Thanks
Unit testing is the first testing phase and it is practiced before moving to the phase of integration testing. Hence, before moving for the next testing level, make sure to fix all the identified bugs in the unit testing phase.
Definition of CRUD Create – INSERT an entry in the Database. Read or Retrieve – SELECT the entry from the Database and View it. Update – UPDATE the entry completely or partially. Delete or Destroy – DROP/DELETE the entry.
No. Deployments don't include tests nor the supporting libraries (e.g. unit test libraries, mocking etc.)
Unit testing is about testing discrete units of code - a single method, no more.
The moment you go into CRUD, you are talking about testing network, IO, database and other things - this is beyond what unit testing is about. In this case, this is called integration testing (you are testing how your code integrates with other code/systems).
There is place for both types of testing (and other types - regression, performance etc...) in any software project, CRUD application or not.
If all your application does is CRUD, then there is no point in unit testing it. Now, if there is any kind of business logic manipulating the values as they come out of the db or validating them before them going in, yes, it is a good idea to build unit tests. Testing the CRUD part does not belong in unit testing IMO.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With