This content originally appeared on DEV Community and was authored by vamsi pavan mahesh gunturu
We have started doing TDD by pair programming at work for the past 14 days.
Some of the benefits that we could observe :
Tests don't feel like extra work that we need to fill once the code is written, they are part of the workflow.
Insane clarity on how the interfaces are going to look like because we design the interfaces in tests themselves.
Doing TDD is fun, you get a small joy whenever the test changes from red to green.
The side effect of all this is 100% test coverage.
Finished in 3.17 seconds (files took 6.89 seconds to load)
102 examples, 0 failures
Coverage report generated for RSpec to /Users/user/work/video_ops_backend/app/coverage. 813 / 814 LOC (99.88%) covered.
Okay maybe I lied a little, we have not covered one line :p
That line happens to be in our exceptions handler, where we are not covering Generic catching of exception because we are catching all of them in the hierarchy above.
I don't think we are ever going back to writing code and backfilling tests after discovering this wonderful world of TDD.
Full disclosure:
The pair working on this project has a senior engineer(me) and a lead engineer, who are already familiar with the tech stack, writing tests for a couple of years, YMMV.
This content originally appeared on DEV Community and was authored by vamsi pavan mahesh gunturu
vamsi pavan mahesh gunturu | Sciencx (2021-04-17T04:02:33+00:00) Review on doing TDD for 14 days, 100% test coverage ?. Retrieved from https://www.scien.cx/2021/04/17/review-on-doing-tdd-for-14-days-100-test-coverage-%f0%9f%98%b1/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.