Hi everyone,
My whole project currently constitutes of a rails app which provides a web interface for creating a calendar for students, a push server which knows how to send push to a particular mobile, one Android project and an iOS project.
All the bare minimum functionalities are over. But one main problem I face is integration testing. Every time I change something in my code I fear of breaking the implementation or showing the demo to a potential user.
My basic question is should I implement the testing right now? Or should I instead focus on adding more functionalities to my existing app because there are many many things I can think of adding to it. But I am afraid without putting in proper test will make it very hard for me to evolve project later on.
I wish that every time I changed something, my tests ran the whole integration tests and told me how I was breaking the code. I wish I could first spent my days by learning about testing rails, unit testing etc.
Iād suggest you start writing tests. One advice many people give for projects which have poor (or doesnāt have any) test coverage is to write tests for code youāll work with next. For me the easiest way was to start with unit tests (testing models etc. with rspec). Once you get comfortable with these tests, the next thing which is good to test are controllers. For me however it was more important to add acceptance tests using capybara.
You definitely should write the most important acceptance tests; from you description Iād say you start by scenarios like: āuser adds a new event to the calendarā and testing the event is properly shown in the overview pageā¦ I imagine it will be the easiest to test push notifications in model layer but think about how you could test this inside your acceptance tests as it sounds like an important feature.
Bottom line is that your feelings about tests are right. Start adding tests! Youāll feel much more comfortable when you have couple of tests to backup your code. Start by introducing one, two ā¦ and the coverage will grow with time as well as your confidence that the app is working as you expect it to work.