I’m very used to the ASP.Net and Java worlds when it comes to web development. While I have done some PHP in the past, I’ve found working on a jRuby on Rails project with a large amount of developers sometimes crashes very unexpectedly when, say, two people refactor the same areas.
So one person renamed MethodA to MethodB and someone else referencing MethodA does not update before check-in. Then we don’t find out the reference to MethodA broke until someone specifically runs that test scenario again.
Naturally we’re trying to cover as much as possible with automated testing using rspec and a third party application that tests the client-side but is there a way to almost “compile” or “verify” a rails app to ensure that all code paths are correct and there are no bad references, wrong types used, etc like a typically compiled framework?
Thanks!
EDIT: For clarification, I understand tests and updates cannot always make it known when a variable or method accidently gets renamed in a dynamic language. I was essentially looking for a way to verify a jRuby on Rails application to ensure nothing is glossed over / missed.
The nature of Ruby as a dynamic, duck-typed language makes it basically impossible to compile Ruby code in the manner you are referring to. That said, see https://blog.gregbrockman.com/2012/01/static-analysis-in-ruby/ though.
“… does not update before check-in”? What VCS are you using that allows this?
Also — if running the tests again finds the error, doesn’t that cover what you want compilation for? You have developers who not only commit without updating, they don’t run tests first either?
Now, if you’re saying that the tests will not fail for the developer who committed without updating, because they have not (umm) updated, then presumably, their compilation would not fail either, so I don’t see that compilation would help.