1:1 test code to app code ratio is about right usually, for highly testable languages like Ruby. The reason people don’t test much outside Ruby world has less to do with testing and more with their language being so bad at it. Have you ever seen properly unit-tested C++ code or layout CSS?
CSS is hard to unit-test because nearly all the places where it can be messed up are detected by a human who says “Hey, this looks really ugly/hard to read/misorganized”, a category of problems that is generally hard to write automated tests for. I don’t think it’s a fault in the language, but the application domain.
C++ is also hard to unit-test, but in that case I agree that it really is part of the language. I enjoy working with C++ and use it for some of my own projects, but if I’m being honest I have to admit that its near-total lack of reflectivity and numerous odd potholes and tripwires makes it much less convenient to do certain sorts of things with it, in-language automated testing being a prominent one of those.
I’m optimistic about Vala, an in-development C#/Javaish language that compiles to Glib-using C and supports native (but language-mediated) access to C libraries, so you get all the performance and platform-specific benefits of working in C/C++, but with modern language features and a noticeable lack of C++’s slowly expanding layers of cruft.
1:1 test code to app code ratio is about right usually, for highly testable languages like Ruby. The reason people don’t test much outside Ruby world has less to do with testing and more with their language being so bad at it. Have you ever seen properly unit-tested C++ code or layout CSS?
CSS is hard to unit-test because nearly all the places where it can be messed up are detected by a human who says “Hey, this looks really ugly/hard to read/misorganized”, a category of problems that is generally hard to write automated tests for. I don’t think it’s a fault in the language, but the application domain.
C++ is also hard to unit-test, but in that case I agree that it really is part of the language. I enjoy working with C++ and use it for some of my own projects, but if I’m being honest I have to admit that its near-total lack of reflectivity and numerous odd potholes and tripwires makes it much less convenient to do certain sorts of things with it, in-language automated testing being a prominent one of those.
I’m optimistic about Vala, an in-development C#/Javaish language that compiles to Glib-using C and supports native (but language-mediated) access to C libraries, so you get all the performance and platform-specific benefits of working in C/C++, but with modern language features and a noticeable lack of C++’s slowly expanding layers of cruft.