• About
  • Projects & Research
  • Publications
  • Archives
  • Categories
  • Posts Tagged ‘testing’

    Fragmented OS


    2010 - 03.01

    So, the Technical Account Manager for Android at Google came for the department’s seminar session. She’s basically in charge of Google’s relationship with manufacturers that use the Android OS. First off, Google is not the soul creator of Android. It’s actually a creation of the Open Handset Alliance, a group of handset manufacturers, software developers, cell phone service companies, etc.

    The Android OS, despite being less than a year and a half old, has fragmented to an appalling degree. Different manufacturers include varied screen sizes, sensors and actuators. So, application developers cannot predict what hardware is available. And consumers cannot easily predict if an application they download will function correctly.

    The operating system itself has even become fragmented. There are five different versions of Android available across different hardware. Developers now have to consider these different versions, not unlike working with different browsers. Developing for the latest version (as Google does), effectively tells anyone with an older version (79.6% of the Android market at the moment) that they’re out of luck.

    I will note that the speaker suggested using version 1.5 or 1.6 rather than 2.1 in developing. On the one hand, that does solve a short term problem of diverse systems. On the other, it makes an unsafe assumption of developers: that we’d want to use an older specification. For most programming languages, it is better practice and makes a person more employable to use the latest standard whenever possible.

    And, there are some genuine reasons for this fragmentation. With more varied hardware, it becomes increasingly difficult to include the appropriate drivers (needing to write one for every new feature for every individual piece of hardware). Some devices do not contain the memory or processing to be upgraded, which effectively keeps them trapped with their original version.

    It’s this fragmentation that will eventually lead to different flavors of the Android OS, more or less defeating the purpose of a unified operating system. Manufacturers may want to consider having an easy Lego-like means of upgrading hardware, but that still does not account for building the drivers (and assumes that manufacturers would even want open hardware).

    Ah well. It was a nice idea.

    JUnit


    2010 - 02.03

    JUnit is a unit testing framework developed for Java programs. It’s not my favorite thing in the world. For starters, it only tests public methods. Which is a bit of a problem if from a development standpoint; many internal “heavy lifting” methods are not needed by outside classes and should be private. In addition, I cannot use Eclipse, my IDE, to debug as I do with other code.

    For my software engineering course, I am creating a very simple Roman to Arabic numeral converter. (If anyone knows what the unicode character for Roman numeral 5000, a V with a line over it, I would appreciate it for accuracy.) It isn’t the converter program that is important. The purpose is to demonstrate black box testing methodologies: testing without knowledge of the internals of a program.

    I developed a test plan and wrote the test cases in JUnit, as instructed, before proceeding on to writing the actual converter. I then ran my tests. A couple failed and a hand full had an error. I rewrote the code; the class is small enough to justify it, rather than worry about where my sometimes failing  bug was.

    Yet, I still had the same problems. So, I copied the short bits of code into a main() function to use the debugger. The debugger revealed no faults: my system produced the correct output. JUnit had produced a false negative. I didn’t know it could even do that. It did not occur across similar tests with identical assert statements, so I’m not sure what it could be.