News for hackers. Stuff that matters.
Re:27000 errors in the Tizen operating system by edejong on Wednesday July 12, 2017 @04:23PM (#14756297)
This sounds so familiar. Some 6 years ago, I joined a team of engineers developing a large (1.5M LOC) classic java/spring/hibernate application for administration in higher education. The software was buggy and loads of time was wasted on bug-fixing, so I introduced the Findbugs static analysis package. Result: >6000 (suspected) bugs. It took a couple of days of blunt perseverance of the whole team to clean up the mess and bring it back to normal proportions, but the result was a stable, well-functioning system.

If you have static analysis tools available and you're writing a larger application (more than 10k LOC), and intend to maintain it for longer than a couple of months, it is definitely worth the initial investment. Better than static analysis, is static typing in a language with an expressive type-system, such as Scala. You simply cannot have NPEs with Option types.

tldr; Used static analysis on 1.5M LOC codebase to reduce bugginess tremendously. Use of static analysis and statically typed languages is adviced.

Re:27000 errors in the Tizen operating system by blub on Thursday July 13, 2017 @01:27AM (#14758934)
The first time we ran static analysis on the C++ code base of a specific project, it found ~20 minor issues and a couple of medium severity ones which were mitigated by other checks. However, we also used 3rd-party open source C libraries, where it found thousands of problems. I'm talking about serious issues, memory leaks, invalid memory access, etc.

P.S: I hope Scala implemented optional types better than Java, where the optional types themselves are nullable :)

Re:27000 errors in the Tizen operating system by edejong on Thursday July 13, 2017 @05:55AM (#14759999)
Well, technically you could write `val opt: Option[Int] = null`, but I've never seen it used and would seriously consider sending the author back to a course Scala for Dummies.

It's interesting how many bugs can be found by static analysis. The problem with C and C++ is that the domain of 'normal' operations is much larger than Java, leading to more false positives in static analysis and/or less true positives.

Re:27000 errors in the Tizen operating system by pjmlp on Thursday July 13, 2017 @02:47AM (#14759237)
Optional types will eventually become value types on Java, you just need to wait until Java 10 for it.